mirror of
https://github.com/open-cluster-management-io/ocm.git
synced 2026-02-14 18:09:57 +00:00
using api auth consts (#1146)
Signed-off-by: Wei Liu <liuweixa@redhat.com>
This commit is contained in:
@@ -91,6 +91,89 @@ spec:
|
||||
DeployOption contains the options of deploying a cluster-manager
|
||||
Default mode is used if DeployOption is not set.
|
||||
properties:
|
||||
default:
|
||||
description: Default includes optional configurations for clustermanager
|
||||
in the Default mode.
|
||||
properties:
|
||||
registrationWebhookConfiguration:
|
||||
description: RegistrationWebhookConfiguration represents the
|
||||
customized webhook-server configuration of registration.
|
||||
properties:
|
||||
bindConfiguration:
|
||||
description: BindConfiguration represents server bind
|
||||
configuration for the webhook server
|
||||
properties:
|
||||
healthProbePort:
|
||||
default: 8000
|
||||
description: |-
|
||||
HealthProbePort represents the bind port of a webhook-server's healthcheck endpoint. The default value is 8000.
|
||||
Healthchecks may be disabled by setting a value less than or equal to 0.
|
||||
format: int32
|
||||
maximum: 65535
|
||||
type: integer
|
||||
hostNetwork:
|
||||
description: |-
|
||||
HostNetwork enables running webhook pods in host networking mode.
|
||||
This may be required in some installations, such as EKS with Calico CNI,
|
||||
to allow the API Server to communicate with the webhook pods.
|
||||
type: boolean
|
||||
metricsPort:
|
||||
default: 8080
|
||||
description: |-
|
||||
MetricsPort represents the bind port for a webhook-server's metric endpoint. The default value is 8080.
|
||||
Metrics may be disabled by setting a value less than or equal to 0.
|
||||
format: int32
|
||||
maximum: 65535
|
||||
type: integer
|
||||
port:
|
||||
default: 9443
|
||||
description: Port represents the primary bind port
|
||||
of a server. The default value is 9443.
|
||||
format: int32
|
||||
maximum: 65535
|
||||
type: integer
|
||||
type: object
|
||||
type: object
|
||||
workWebhookConfiguration:
|
||||
description: WorkWebhookConfiguration represents the customized
|
||||
webhook-server configuration of work.
|
||||
properties:
|
||||
bindConfiguration:
|
||||
description: BindConfiguration represents server bind
|
||||
configuration for the webhook server
|
||||
properties:
|
||||
healthProbePort:
|
||||
default: 8000
|
||||
description: |-
|
||||
HealthProbePort represents the bind port of a webhook-server's healthcheck endpoint. The default value is 8000.
|
||||
Healthchecks may be disabled by setting a value less than or equal to 0.
|
||||
format: int32
|
||||
maximum: 65535
|
||||
type: integer
|
||||
hostNetwork:
|
||||
description: |-
|
||||
HostNetwork enables running webhook pods in host networking mode.
|
||||
This may be required in some installations, such as EKS with Calico CNI,
|
||||
to allow the API Server to communicate with the webhook pods.
|
||||
type: boolean
|
||||
metricsPort:
|
||||
default: 8080
|
||||
description: |-
|
||||
MetricsPort represents the bind port for a webhook-server's metric endpoint. The default value is 8080.
|
||||
Metrics may be disabled by setting a value less than or equal to 0.
|
||||
format: int32
|
||||
maximum: 65535
|
||||
type: integer
|
||||
port:
|
||||
default: 9443
|
||||
description: Port represents the primary bind port
|
||||
of a server. The default value is 9443.
|
||||
format: int32
|
||||
maximum: 65535
|
||||
type: integer
|
||||
type: object
|
||||
type: object
|
||||
type: object
|
||||
hosted:
|
||||
description: Hosted includes configurations we need for clustermanager
|
||||
in the Hosted mode.
|
||||
@@ -106,9 +189,43 @@ spec:
|
||||
The Address must be reachable by apiserver of the hub cluster.
|
||||
pattern: ^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]*[a-zA-Z0-9])\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9\-]*[A-Za-z0-9])$
|
||||
type: string
|
||||
bindConfiguration:
|
||||
description: BindConfiguration represents server bind
|
||||
configuration for the webhook server
|
||||
properties:
|
||||
healthProbePort:
|
||||
default: 8000
|
||||
description: |-
|
||||
HealthProbePort represents the bind port of a webhook-server's healthcheck endpoint. The default value is 8000.
|
||||
Healthchecks may be disabled by setting a value less than or equal to 0.
|
||||
format: int32
|
||||
maximum: 65535
|
||||
type: integer
|
||||
hostNetwork:
|
||||
description: |-
|
||||
HostNetwork enables running webhook pods in host networking mode.
|
||||
This may be required in some installations, such as EKS with Calico CNI,
|
||||
to allow the API Server to communicate with the webhook pods.
|
||||
type: boolean
|
||||
metricsPort:
|
||||
default: 8080
|
||||
description: |-
|
||||
MetricsPort represents the bind port for a webhook-server's metric endpoint. The default value is 8080.
|
||||
Metrics may be disabled by setting a value less than or equal to 0.
|
||||
format: int32
|
||||
maximum: 65535
|
||||
type: integer
|
||||
port:
|
||||
default: 9443
|
||||
description: Port represents the primary bind port
|
||||
of a server. The default value is 9443.
|
||||
format: int32
|
||||
maximum: 65535
|
||||
type: integer
|
||||
type: object
|
||||
port:
|
||||
default: 443
|
||||
description: Port represents the port of a webhook-server.
|
||||
description: Port represents the external port of a webhook-server.
|
||||
The default value of Port is 443.
|
||||
format: int32
|
||||
maximum: 65535
|
||||
@@ -127,9 +244,43 @@ spec:
|
||||
The Address must be reachable by apiserver of the hub cluster.
|
||||
pattern: ^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]*[a-zA-Z0-9])\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9\-]*[A-Za-z0-9])$
|
||||
type: string
|
||||
bindConfiguration:
|
||||
description: BindConfiguration represents server bind
|
||||
configuration for the webhook server
|
||||
properties:
|
||||
healthProbePort:
|
||||
default: 8000
|
||||
description: |-
|
||||
HealthProbePort represents the bind port of a webhook-server's healthcheck endpoint. The default value is 8000.
|
||||
Healthchecks may be disabled by setting a value less than or equal to 0.
|
||||
format: int32
|
||||
maximum: 65535
|
||||
type: integer
|
||||
hostNetwork:
|
||||
description: |-
|
||||
HostNetwork enables running webhook pods in host networking mode.
|
||||
This may be required in some installations, such as EKS with Calico CNI,
|
||||
to allow the API Server to communicate with the webhook pods.
|
||||
type: boolean
|
||||
metricsPort:
|
||||
default: 8080
|
||||
description: |-
|
||||
MetricsPort represents the bind port for a webhook-server's metric endpoint. The default value is 8080.
|
||||
Metrics may be disabled by setting a value less than or equal to 0.
|
||||
format: int32
|
||||
maximum: 65535
|
||||
type: integer
|
||||
port:
|
||||
default: 9443
|
||||
description: Port represents the primary bind port
|
||||
of a server. The default value is 9443.
|
||||
format: int32
|
||||
maximum: 65535
|
||||
type: integer
|
||||
type: object
|
||||
port:
|
||||
default: 443
|
||||
description: Port represents the port of a webhook-server.
|
||||
description: Port represents the external port of a webhook-server.
|
||||
The default value of Port is 443.
|
||||
format: int32
|
||||
maximum: 65535
|
||||
|
||||
@@ -91,6 +91,89 @@ spec:
|
||||
DeployOption contains the options of deploying a cluster-manager
|
||||
Default mode is used if DeployOption is not set.
|
||||
properties:
|
||||
default:
|
||||
description: Default includes optional configurations for clustermanager
|
||||
in the Default mode.
|
||||
properties:
|
||||
registrationWebhookConfiguration:
|
||||
description: RegistrationWebhookConfiguration represents the
|
||||
customized webhook-server configuration of registration.
|
||||
properties:
|
||||
bindConfiguration:
|
||||
description: BindConfiguration represents server bind
|
||||
configuration for the webhook server
|
||||
properties:
|
||||
healthProbePort:
|
||||
default: 8000
|
||||
description: |-
|
||||
HealthProbePort represents the bind port of a webhook-server's healthcheck endpoint. The default value is 8000.
|
||||
Healthchecks may be disabled by setting a value less than or equal to 0.
|
||||
format: int32
|
||||
maximum: 65535
|
||||
type: integer
|
||||
hostNetwork:
|
||||
description: |-
|
||||
HostNetwork enables running webhook pods in host networking mode.
|
||||
This may be required in some installations, such as EKS with Calico CNI,
|
||||
to allow the API Server to communicate with the webhook pods.
|
||||
type: boolean
|
||||
metricsPort:
|
||||
default: 8080
|
||||
description: |-
|
||||
MetricsPort represents the bind port for a webhook-server's metric endpoint. The default value is 8080.
|
||||
Metrics may be disabled by setting a value less than or equal to 0.
|
||||
format: int32
|
||||
maximum: 65535
|
||||
type: integer
|
||||
port:
|
||||
default: 9443
|
||||
description: Port represents the primary bind port
|
||||
of a server. The default value is 9443.
|
||||
format: int32
|
||||
maximum: 65535
|
||||
type: integer
|
||||
type: object
|
||||
type: object
|
||||
workWebhookConfiguration:
|
||||
description: WorkWebhookConfiguration represents the customized
|
||||
webhook-server configuration of work.
|
||||
properties:
|
||||
bindConfiguration:
|
||||
description: BindConfiguration represents server bind
|
||||
configuration for the webhook server
|
||||
properties:
|
||||
healthProbePort:
|
||||
default: 8000
|
||||
description: |-
|
||||
HealthProbePort represents the bind port of a webhook-server's healthcheck endpoint. The default value is 8000.
|
||||
Healthchecks may be disabled by setting a value less than or equal to 0.
|
||||
format: int32
|
||||
maximum: 65535
|
||||
type: integer
|
||||
hostNetwork:
|
||||
description: |-
|
||||
HostNetwork enables running webhook pods in host networking mode.
|
||||
This may be required in some installations, such as EKS with Calico CNI,
|
||||
to allow the API Server to communicate with the webhook pods.
|
||||
type: boolean
|
||||
metricsPort:
|
||||
default: 8080
|
||||
description: |-
|
||||
MetricsPort represents the bind port for a webhook-server's metric endpoint. The default value is 8080.
|
||||
Metrics may be disabled by setting a value less than or equal to 0.
|
||||
format: int32
|
||||
maximum: 65535
|
||||
type: integer
|
||||
port:
|
||||
default: 9443
|
||||
description: Port represents the primary bind port
|
||||
of a server. The default value is 9443.
|
||||
format: int32
|
||||
maximum: 65535
|
||||
type: integer
|
||||
type: object
|
||||
type: object
|
||||
type: object
|
||||
hosted:
|
||||
description: Hosted includes configurations we need for clustermanager
|
||||
in the Hosted mode.
|
||||
@@ -106,9 +189,43 @@ spec:
|
||||
The Address must be reachable by apiserver of the hub cluster.
|
||||
pattern: ^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]*[a-zA-Z0-9])\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9\-]*[A-Za-z0-9])$
|
||||
type: string
|
||||
bindConfiguration:
|
||||
description: BindConfiguration represents server bind
|
||||
configuration for the webhook server
|
||||
properties:
|
||||
healthProbePort:
|
||||
default: 8000
|
||||
description: |-
|
||||
HealthProbePort represents the bind port of a webhook-server's healthcheck endpoint. The default value is 8000.
|
||||
Healthchecks may be disabled by setting a value less than or equal to 0.
|
||||
format: int32
|
||||
maximum: 65535
|
||||
type: integer
|
||||
hostNetwork:
|
||||
description: |-
|
||||
HostNetwork enables running webhook pods in host networking mode.
|
||||
This may be required in some installations, such as EKS with Calico CNI,
|
||||
to allow the API Server to communicate with the webhook pods.
|
||||
type: boolean
|
||||
metricsPort:
|
||||
default: 8080
|
||||
description: |-
|
||||
MetricsPort represents the bind port for a webhook-server's metric endpoint. The default value is 8080.
|
||||
Metrics may be disabled by setting a value less than or equal to 0.
|
||||
format: int32
|
||||
maximum: 65535
|
||||
type: integer
|
||||
port:
|
||||
default: 9443
|
||||
description: Port represents the primary bind port
|
||||
of a server. The default value is 9443.
|
||||
format: int32
|
||||
maximum: 65535
|
||||
type: integer
|
||||
type: object
|
||||
port:
|
||||
default: 443
|
||||
description: Port represents the port of a webhook-server.
|
||||
description: Port represents the external port of a webhook-server.
|
||||
The default value of Port is 443.
|
||||
format: int32
|
||||
maximum: 65535
|
||||
@@ -127,9 +244,43 @@ spec:
|
||||
The Address must be reachable by apiserver of the hub cluster.
|
||||
pattern: ^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]*[a-zA-Z0-9])\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9\-]*[A-Za-z0-9])$
|
||||
type: string
|
||||
bindConfiguration:
|
||||
description: BindConfiguration represents server bind
|
||||
configuration for the webhook server
|
||||
properties:
|
||||
healthProbePort:
|
||||
default: 8000
|
||||
description: |-
|
||||
HealthProbePort represents the bind port of a webhook-server's healthcheck endpoint. The default value is 8000.
|
||||
Healthchecks may be disabled by setting a value less than or equal to 0.
|
||||
format: int32
|
||||
maximum: 65535
|
||||
type: integer
|
||||
hostNetwork:
|
||||
description: |-
|
||||
HostNetwork enables running webhook pods in host networking mode.
|
||||
This may be required in some installations, such as EKS with Calico CNI,
|
||||
to allow the API Server to communicate with the webhook pods.
|
||||
type: boolean
|
||||
metricsPort:
|
||||
default: 8080
|
||||
description: |-
|
||||
MetricsPort represents the bind port for a webhook-server's metric endpoint. The default value is 8080.
|
||||
Metrics may be disabled by setting a value less than or equal to 0.
|
||||
format: int32
|
||||
maximum: 65535
|
||||
type: integer
|
||||
port:
|
||||
default: 9443
|
||||
description: Port represents the primary bind port
|
||||
of a server. The default value is 9443.
|
||||
format: int32
|
||||
maximum: 65535
|
||||
type: integer
|
||||
type: object
|
||||
port:
|
||||
default: 443
|
||||
description: Port represents the port of a webhook-server.
|
||||
description: Port represents the external port of a webhook-server.
|
||||
The default value of Port is 443.
|
||||
format: int32
|
||||
maximum: 65535
|
||||
|
||||
@@ -59,7 +59,7 @@ metadata:
|
||||
categories: Integration & Delivery,OpenShift Optional
|
||||
certified: "false"
|
||||
containerImage: quay.io/open-cluster-management/registration-operator:latest
|
||||
createdAt: "2025-08-05T10:41:01Z"
|
||||
createdAt: "2025-08-27T08:41:10Z"
|
||||
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
|
||||
|
||||
@@ -91,6 +91,89 @@ spec:
|
||||
DeployOption contains the options of deploying a cluster-manager
|
||||
Default mode is used if DeployOption is not set.
|
||||
properties:
|
||||
default:
|
||||
description: Default includes optional configurations for clustermanager
|
||||
in the Default mode.
|
||||
properties:
|
||||
registrationWebhookConfiguration:
|
||||
description: RegistrationWebhookConfiguration represents the
|
||||
customized webhook-server configuration of registration.
|
||||
properties:
|
||||
bindConfiguration:
|
||||
description: BindConfiguration represents server bind
|
||||
configuration for the webhook server
|
||||
properties:
|
||||
healthProbePort:
|
||||
default: 8000
|
||||
description: |-
|
||||
HealthProbePort represents the bind port of a webhook-server's healthcheck endpoint. The default value is 8000.
|
||||
Healthchecks may be disabled by setting a value less than or equal to 0.
|
||||
format: int32
|
||||
maximum: 65535
|
||||
type: integer
|
||||
hostNetwork:
|
||||
description: |-
|
||||
HostNetwork enables running webhook pods in host networking mode.
|
||||
This may be required in some installations, such as EKS with Calico CNI,
|
||||
to allow the API Server to communicate with the webhook pods.
|
||||
type: boolean
|
||||
metricsPort:
|
||||
default: 8080
|
||||
description: |-
|
||||
MetricsPort represents the bind port for a webhook-server's metric endpoint. The default value is 8080.
|
||||
Metrics may be disabled by setting a value less than or equal to 0.
|
||||
format: int32
|
||||
maximum: 65535
|
||||
type: integer
|
||||
port:
|
||||
default: 9443
|
||||
description: Port represents the primary bind port
|
||||
of a server. The default value is 9443.
|
||||
format: int32
|
||||
maximum: 65535
|
||||
type: integer
|
||||
type: object
|
||||
type: object
|
||||
workWebhookConfiguration:
|
||||
description: WorkWebhookConfiguration represents the customized
|
||||
webhook-server configuration of work.
|
||||
properties:
|
||||
bindConfiguration:
|
||||
description: BindConfiguration represents server bind
|
||||
configuration for the webhook server
|
||||
properties:
|
||||
healthProbePort:
|
||||
default: 8000
|
||||
description: |-
|
||||
HealthProbePort represents the bind port of a webhook-server's healthcheck endpoint. The default value is 8000.
|
||||
Healthchecks may be disabled by setting a value less than or equal to 0.
|
||||
format: int32
|
||||
maximum: 65535
|
||||
type: integer
|
||||
hostNetwork:
|
||||
description: |-
|
||||
HostNetwork enables running webhook pods in host networking mode.
|
||||
This may be required in some installations, such as EKS with Calico CNI,
|
||||
to allow the API Server to communicate with the webhook pods.
|
||||
type: boolean
|
||||
metricsPort:
|
||||
default: 8080
|
||||
description: |-
|
||||
MetricsPort represents the bind port for a webhook-server's metric endpoint. The default value is 8080.
|
||||
Metrics may be disabled by setting a value less than or equal to 0.
|
||||
format: int32
|
||||
maximum: 65535
|
||||
type: integer
|
||||
port:
|
||||
default: 9443
|
||||
description: Port represents the primary bind port
|
||||
of a server. The default value is 9443.
|
||||
format: int32
|
||||
maximum: 65535
|
||||
type: integer
|
||||
type: object
|
||||
type: object
|
||||
type: object
|
||||
hosted:
|
||||
description: Hosted includes configurations we need for clustermanager
|
||||
in the Hosted mode.
|
||||
@@ -106,9 +189,43 @@ spec:
|
||||
The Address must be reachable by apiserver of the hub cluster.
|
||||
pattern: ^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]*[a-zA-Z0-9])\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9\-]*[A-Za-z0-9])$
|
||||
type: string
|
||||
bindConfiguration:
|
||||
description: BindConfiguration represents server bind
|
||||
configuration for the webhook server
|
||||
properties:
|
||||
healthProbePort:
|
||||
default: 8000
|
||||
description: |-
|
||||
HealthProbePort represents the bind port of a webhook-server's healthcheck endpoint. The default value is 8000.
|
||||
Healthchecks may be disabled by setting a value less than or equal to 0.
|
||||
format: int32
|
||||
maximum: 65535
|
||||
type: integer
|
||||
hostNetwork:
|
||||
description: |-
|
||||
HostNetwork enables running webhook pods in host networking mode.
|
||||
This may be required in some installations, such as EKS with Calico CNI,
|
||||
to allow the API Server to communicate with the webhook pods.
|
||||
type: boolean
|
||||
metricsPort:
|
||||
default: 8080
|
||||
description: |-
|
||||
MetricsPort represents the bind port for a webhook-server's metric endpoint. The default value is 8080.
|
||||
Metrics may be disabled by setting a value less than or equal to 0.
|
||||
format: int32
|
||||
maximum: 65535
|
||||
type: integer
|
||||
port:
|
||||
default: 9443
|
||||
description: Port represents the primary bind port
|
||||
of a server. The default value is 9443.
|
||||
format: int32
|
||||
maximum: 65535
|
||||
type: integer
|
||||
type: object
|
||||
port:
|
||||
default: 443
|
||||
description: Port represents the port of a webhook-server.
|
||||
description: Port represents the external port of a webhook-server.
|
||||
The default value of Port is 443.
|
||||
format: int32
|
||||
maximum: 65535
|
||||
@@ -127,9 +244,43 @@ spec:
|
||||
The Address must be reachable by apiserver of the hub cluster.
|
||||
pattern: ^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]*[a-zA-Z0-9])\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9\-]*[A-Za-z0-9])$
|
||||
type: string
|
||||
bindConfiguration:
|
||||
description: BindConfiguration represents server bind
|
||||
configuration for the webhook server
|
||||
properties:
|
||||
healthProbePort:
|
||||
default: 8000
|
||||
description: |-
|
||||
HealthProbePort represents the bind port of a webhook-server's healthcheck endpoint. The default value is 8000.
|
||||
Healthchecks may be disabled by setting a value less than or equal to 0.
|
||||
format: int32
|
||||
maximum: 65535
|
||||
type: integer
|
||||
hostNetwork:
|
||||
description: |-
|
||||
HostNetwork enables running webhook pods in host networking mode.
|
||||
This may be required in some installations, such as EKS with Calico CNI,
|
||||
to allow the API Server to communicate with the webhook pods.
|
||||
type: boolean
|
||||
metricsPort:
|
||||
default: 8080
|
||||
description: |-
|
||||
MetricsPort represents the bind port for a webhook-server's metric endpoint. The default value is 8080.
|
||||
Metrics may be disabled by setting a value less than or equal to 0.
|
||||
format: int32
|
||||
maximum: 65535
|
||||
type: integer
|
||||
port:
|
||||
default: 9443
|
||||
description: Port represents the primary bind port
|
||||
of a server. The default value is 9443.
|
||||
format: int32
|
||||
maximum: 65535
|
||||
type: integer
|
||||
type: object
|
||||
port:
|
||||
default: 443
|
||||
description: Port represents the port of a webhook-server.
|
||||
description: Port represents the external port of a webhook-server.
|
||||
The default value of Port is 443.
|
||||
format: int32
|
||||
maximum: 65535
|
||||
|
||||
@@ -272,6 +272,12 @@ spec:
|
||||
required:
|
||||
- maxCustomClusterClaims
|
||||
type: object
|
||||
clusterLabels:
|
||||
additionalProperties:
|
||||
type: string
|
||||
description: ClusterLabels is labels set on ManagedCluster when
|
||||
creating only, other actors can update it afterwards.
|
||||
type: object
|
||||
featureGates:
|
||||
description: "FeatureGates represents the list of feature gates
|
||||
for registration\nIf it is set empty, default feature gates
|
||||
|
||||
@@ -272,6 +272,12 @@ spec:
|
||||
required:
|
||||
- maxCustomClusterClaims
|
||||
type: object
|
||||
clusterLabels:
|
||||
additionalProperties:
|
||||
type: string
|
||||
description: ClusterLabels is labels set on ManagedCluster when
|
||||
creating only, other actors can update it afterwards.
|
||||
type: object
|
||||
featureGates:
|
||||
description: "FeatureGates represents the list of feature gates
|
||||
for registration\nIf it is set empty, default feature gates
|
||||
|
||||
@@ -31,7 +31,7 @@ metadata:
|
||||
categories: Integration & Delivery,OpenShift Optional
|
||||
certified: "false"
|
||||
containerImage: quay.io/open-cluster-management/registration-operator:latest
|
||||
createdAt: "2025-08-05T10:41:01Z"
|
||||
createdAt: "2025-08-27T08:41:10Z"
|
||||
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
|
||||
|
||||
@@ -272,6 +272,12 @@ spec:
|
||||
required:
|
||||
- maxCustomClusterClaims
|
||||
type: object
|
||||
clusterLabels:
|
||||
additionalProperties:
|
||||
type: string
|
||||
description: ClusterLabels is labels set on ManagedCluster when
|
||||
creating only, other actors can update it afterwards.
|
||||
type: object
|
||||
featureGates:
|
||||
description: "FeatureGates represents the list of feature gates
|
||||
for registration\nIf it is set empty, default feature gates
|
||||
|
||||
4
go.mod
4
go.mod
@@ -18,7 +18,7 @@ require (
|
||||
github.com/onsi/ginkgo/v2 v2.25.1
|
||||
github.com/onsi/gomega v1.38.0
|
||||
github.com/openshift/api v0.0.0-20250710004639-926605d3338b
|
||||
github.com/openshift/build-machinery-go v0.0.0-20250530140348-dc5b2804eeee
|
||||
github.com/openshift/build-machinery-go v0.0.0-20250602125535-1b6d00b8c37c
|
||||
github.com/openshift/library-go v0.0.0-20250711143941-47604345e7ea
|
||||
github.com/pkg/errors v0.9.1
|
||||
github.com/prometheus/client_golang v1.23.0
|
||||
@@ -39,7 +39,7 @@ require (
|
||||
k8s.io/kubectl v0.33.4
|
||||
k8s.io/utils v0.0.0-20241210054802-24370beab758
|
||||
open-cluster-management.io/addon-framework v1.0.1-0.20250722093201-ee47752c02f3
|
||||
open-cluster-management.io/api v1.0.1-0.20250730122947-5e3423e7794a
|
||||
open-cluster-management.io/api v1.0.1-0.20250827024027-f3e5dab96ea1
|
||||
open-cluster-management.io/sdk-go v1.0.1-0.20250805021042-68bb7fc51d4e
|
||||
sigs.k8s.io/about-api v0.0.0-20250131010323-518069c31c03
|
||||
sigs.k8s.io/cluster-inventory-api v0.0.0-20240730014211-ef0154379848
|
||||
|
||||
8
go.sum
8
go.sum
@@ -264,8 +264,8 @@ github.com/opencontainers/image-spec v1.1.1 h1:y0fUlFfIZhPF1W537XOLg0/fcx6zcHCJw
|
||||
github.com/opencontainers/image-spec v1.1.1/go.mod h1:qpqAh3Dmcf36wStyyWU+kCeDgrGnAve2nCC8+7h8Q0M=
|
||||
github.com/openshift/api v0.0.0-20250710004639-926605d3338b h1:A8OY6adT2aZNp7tsGsilHuQ3RqhzrFx5dzGr/UwXfJg=
|
||||
github.com/openshift/api v0.0.0-20250710004639-926605d3338b/go.mod h1:SPLf21TYPipzCO67BURkCfK6dcIIxx0oNRVWaOyRcXM=
|
||||
github.com/openshift/build-machinery-go v0.0.0-20250530140348-dc5b2804eeee h1:+Sp5GGnjHDhT/a/nQ1xdp43UscBMr7G5wxsYotyhzJ4=
|
||||
github.com/openshift/build-machinery-go v0.0.0-20250530140348-dc5b2804eeee/go.mod h1:8jcm8UPtg2mCAsxfqKil1xrmRMI3a+XU2TZ9fF8A7TE=
|
||||
github.com/openshift/build-machinery-go v0.0.0-20250602125535-1b6d00b8c37c h1:gJvhduWIrpzoUTwrJjjeul+hGETKkhRhEZosBg/X3Hg=
|
||||
github.com/openshift/build-machinery-go v0.0.0-20250602125535-1b6d00b8c37c/go.mod h1:8jcm8UPtg2mCAsxfqKil1xrmRMI3a+XU2TZ9fF8A7TE=
|
||||
github.com/openshift/client-go v0.0.0-20250710075018-396b36f983ee h1:tOtrrxfDEW8hK3eEsHqxsXurq/D6LcINGfprkQC3hqY=
|
||||
github.com/openshift/client-go v0.0.0-20250710075018-396b36f983ee/go.mod h1:zhRiYyNMk89llof2qEuGPWPD+joQPhCRUc2IK0SB510=
|
||||
github.com/openshift/library-go v0.0.0-20250711143941-47604345e7ea h1:0BNis5UGo5Z7J9GtRY1nw/pt8hWxIZqvfqnqH3eV5cs=
|
||||
@@ -493,8 +493,8 @@ k8s.io/utils v0.0.0-20241210054802-24370beab758 h1:sdbE21q2nlQtFh65saZY+rRM6x6aJ
|
||||
k8s.io/utils v0.0.0-20241210054802-24370beab758/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0=
|
||||
open-cluster-management.io/addon-framework v1.0.1-0.20250722093201-ee47752c02f3 h1:r7f57/YPg4caE2N1JQX5sVdBMW5f4VftIUZoW2AWzMs=
|
||||
open-cluster-management.io/addon-framework v1.0.1-0.20250722093201-ee47752c02f3/go.mod h1:U/AQsLpMi4jay9SC3x+uSh2vsB7ZZPLm63MiRnA9mX4=
|
||||
open-cluster-management.io/api v1.0.1-0.20250730122947-5e3423e7794a h1:RtfQsfeU+uedsi7btdGdYeSVJw6v2Zp1pMB5XkgHRW8=
|
||||
open-cluster-management.io/api v1.0.1-0.20250730122947-5e3423e7794a/go.mod h1:KEj/4wbUjdbWktrKLL8+mWzAIzE6Ii3bcRr4CvnBNEg=
|
||||
open-cluster-management.io/api v1.0.1-0.20250827024027-f3e5dab96ea1 h1:X5dL1aKnkLGHItMsEexGhLZsyZJHDlxGD4eRvsD181g=
|
||||
open-cluster-management.io/api v1.0.1-0.20250827024027-f3e5dab96ea1/go.mod h1:lEc5Wkc9ON5ym/qAtIqNgrE7NW7IEOCOC611iQMlnKM=
|
||||
open-cluster-management.io/sdk-go v1.0.1-0.20250805021042-68bb7fc51d4e h1:jI/RdWsyShHxLxAt5OilP0YOiH2qsSYcDtHPS1bT8Is=
|
||||
open-cluster-management.io/sdk-go v1.0.1-0.20250805021042-68bb7fc51d4e/go.mod h1:sHOVhUgA286ceEq3IjFWqxobt9Lu+VBCAUZByFgN0oM=
|
||||
sigs.k8s.io/about-api v0.0.0-20250131010323-518069c31c03 h1:1ShFiMjGQOR/8jTBkmZrk1gORxnvMwm1nOy2/DbHg4U=
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
package helpers
|
||||
|
||||
const (
|
||||
AwsIrsaAuthType = "awsirsa"
|
||||
CSRAuthType = "csr"
|
||||
GRPCCAuthType = "grpc"
|
||||
)
|
||||
|
||||
const GRPCCAuthSigner = "open-cluster-management.io/grpc"
|
||||
|
||||
// CSRUserAnnotation will be added to a CSR and used to identify the user who request the CSR
|
||||
const CSRUserAnnotation = "open-cluster-management.io/csruser"
|
||||
@@ -41,8 +41,6 @@ import (
|
||||
apiregistrationclient "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/typed/apiregistration/v1"
|
||||
|
||||
operatorapiv1 "open-cluster-management.io/api/operator/v1"
|
||||
|
||||
commonhelpers "open-cluster-management.io/ocm/pkg/common/helpers"
|
||||
)
|
||||
|
||||
const (
|
||||
@@ -926,7 +924,7 @@ func GRPCAuthEnabled(cm *operatorapiv1.ClusterManager) bool {
|
||||
return false
|
||||
}
|
||||
for _, registrationDriver := range cm.Spec.RegistrationConfiguration.RegistrationDrivers {
|
||||
if registrationDriver.AuthType == commonhelpers.GRPCCAuthType {
|
||||
if registrationDriver.AuthType == operatorapiv1.GRPCAuthType {
|
||||
return true
|
||||
}
|
||||
}
|
||||
@@ -938,7 +936,7 @@ func GRPCServerHostNames(clustermanagerNamespace string, cm *operatorapiv1.Clust
|
||||
hostNames := []string{fmt.Sprintf("%s-grpc-server.%s.svc", cm.Name, clustermanagerNamespace)}
|
||||
if cm.Spec.RegistrationConfiguration != nil {
|
||||
for _, registrationDriver := range cm.Spec.RegistrationConfiguration.RegistrationDrivers {
|
||||
if registrationDriver.AuthType != commonhelpers.GRPCCAuthType {
|
||||
if registrationDriver.AuthType != operatorapiv1.GRPCAuthType {
|
||||
continue
|
||||
}
|
||||
|
||||
|
||||
@@ -38,7 +38,6 @@ import (
|
||||
operatorapiv1 "open-cluster-management.io/api/operator/v1"
|
||||
|
||||
"open-cluster-management.io/ocm/manifests"
|
||||
"open-cluster-management.io/ocm/pkg/common/helpers"
|
||||
)
|
||||
|
||||
const nameFoo = "foo"
|
||||
@@ -1832,7 +1831,7 @@ func TestGRPCAuthEnabled(t *testing.T) {
|
||||
Spec: operatorapiv1.ClusterManagerSpec{
|
||||
RegistrationConfiguration: &operatorapiv1.RegistrationHubConfiguration{
|
||||
RegistrationDrivers: []operatorapiv1.RegistrationDriverHub{
|
||||
{AuthType: helpers.GRPCCAuthType},
|
||||
{AuthType: operatorapiv1.GRPCAuthType},
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -1845,7 +1844,7 @@ func TestGRPCAuthEnabled(t *testing.T) {
|
||||
Spec: operatorapiv1.ClusterManagerSpec{
|
||||
RegistrationConfiguration: &operatorapiv1.RegistrationHubConfiguration{
|
||||
RegistrationDrivers: []operatorapiv1.RegistrationDriverHub{
|
||||
{AuthType: helpers.CSRAuthType},
|
||||
{AuthType: operatorapiv1.CSRAuthType},
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -1858,8 +1857,8 @@ func TestGRPCAuthEnabled(t *testing.T) {
|
||||
Spec: operatorapiv1.ClusterManagerSpec{
|
||||
RegistrationConfiguration: &operatorapiv1.RegistrationHubConfiguration{
|
||||
RegistrationDrivers: []operatorapiv1.RegistrationDriverHub{
|
||||
{AuthType: helpers.CSRAuthType},
|
||||
{AuthType: helpers.GRPCCAuthType},
|
||||
{AuthType: operatorapiv1.CSRAuthType},
|
||||
{AuthType: operatorapiv1.GRPCAuthType},
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -1922,7 +1921,7 @@ func TestGRPCServerHostNames(t *testing.T) {
|
||||
Spec: operatorapiv1.ClusterManagerSpec{
|
||||
RegistrationConfiguration: &operatorapiv1.RegistrationHubConfiguration{
|
||||
RegistrationDrivers: []operatorapiv1.RegistrationDriverHub{
|
||||
{AuthType: helpers.CSRAuthType},
|
||||
{AuthType: operatorapiv1.CSRAuthType},
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -1939,7 +1938,7 @@ func TestGRPCServerHostNames(t *testing.T) {
|
||||
Spec: operatorapiv1.ClusterManagerSpec{
|
||||
RegistrationConfiguration: &operatorapiv1.RegistrationHubConfiguration{
|
||||
RegistrationDrivers: []operatorapiv1.RegistrationDriverHub{
|
||||
{AuthType: helpers.GRPCCAuthType},
|
||||
{AuthType: operatorapiv1.GRPCAuthType},
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -1957,7 +1956,7 @@ func TestGRPCServerHostNames(t *testing.T) {
|
||||
RegistrationConfiguration: &operatorapiv1.RegistrationHubConfiguration{
|
||||
RegistrationDrivers: []operatorapiv1.RegistrationDriverHub{
|
||||
{
|
||||
AuthType: helpers.GRPCCAuthType,
|
||||
AuthType: operatorapiv1.GRPCAuthType,
|
||||
GRPC: &operatorapiv1.GRPCConfig{
|
||||
EndpointExposure: &operatorapiv1.GRPCEndpointExposure{
|
||||
Type: operatorapiv1.GRPCEndpointTypeHostname,
|
||||
|
||||
@@ -21,7 +21,6 @@ import (
|
||||
operatorinformers "open-cluster-management.io/api/client/operator/informers/externalversions"
|
||||
operatorapiv1 "open-cluster-management.io/api/operator/v1"
|
||||
|
||||
commonhelpers "open-cluster-management.io/ocm/pkg/common/helpers"
|
||||
testingcommon "open-cluster-management.io/ocm/pkg/common/testing"
|
||||
"open-cluster-management.io/ocm/pkg/operator/helpers"
|
||||
)
|
||||
@@ -46,10 +45,10 @@ func newClusterManager(name string, mode operatorapiv1.InstallMode) *operatorapi
|
||||
RegistrationConfiguration: &operatorapiv1.RegistrationHubConfiguration{
|
||||
RegistrationDrivers: []operatorapiv1.RegistrationDriverHub{
|
||||
{
|
||||
AuthType: commonhelpers.GRPCCAuthType,
|
||||
AuthType: operatorapiv1.GRPCAuthType,
|
||||
},
|
||||
{
|
||||
AuthType: commonhelpers.CSRAuthType,
|
||||
AuthType: operatorapiv1.CSRAuthType,
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -219,7 +218,7 @@ func TestCertRotationGRPCAuth(t *testing.T) {
|
||||
cm.Spec.RegistrationConfiguration = &operatorapiv1.RegistrationHubConfiguration{
|
||||
RegistrationDrivers: []operatorapiv1.RegistrationDriverHub{
|
||||
{
|
||||
AuthType: commonhelpers.CSRAuthType,
|
||||
AuthType: operatorapiv1.CSRAuthType,
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -262,7 +261,7 @@ func TestCertRotationGRPCAuth(t *testing.T) {
|
||||
cm.Spec.RegistrationConfiguration = &operatorapiv1.RegistrationHubConfiguration{
|
||||
RegistrationDrivers: []operatorapiv1.RegistrationDriverHub{
|
||||
{
|
||||
AuthType: commonhelpers.CSRAuthType,
|
||||
AuthType: operatorapiv1.CSRAuthType,
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
@@ -388,7 +388,7 @@ func isIPFormat(address string) bool {
|
||||
return true
|
||||
}
|
||||
|
||||
func convertWebhookConfiguration(webhookConfiguration operatorapiv1.WebhookConfiguration) manifests.Webhook {
|
||||
func convertWebhookConfiguration(webhookConfiguration operatorapiv1.HostedWebhookConfiguration) manifests.Webhook {
|
||||
return manifests.Webhook{
|
||||
Address: webhookConfiguration.Address,
|
||||
Port: webhookConfiguration.Port,
|
||||
@@ -436,7 +436,7 @@ func (n *clusterManagerController) getImagePullSecret(ctx context.Context) (stri
|
||||
func getIdentityCreatorRoleAndTags(cm operatorapiv1.ClusterManager) string {
|
||||
if cm.Spec.RegistrationConfiguration != nil {
|
||||
for _, registrationDriver := range cm.Spec.RegistrationConfiguration.RegistrationDrivers {
|
||||
if registrationDriver.AuthType == commonhelper.AwsIrsaAuthType && registrationDriver.AwsIrsa != nil {
|
||||
if registrationDriver.AuthType == operatorapiv1.AwsIrsaAuthType && registrationDriver.AwsIrsa != nil {
|
||||
hubClusterArn := registrationDriver.AwsIrsa.HubClusterArn
|
||||
hubClusterAccountId, hubClusterName := commonhelper.GetAwsAccountIdAndClusterName(hubClusterArn)
|
||||
return "arn:aws:iam::" + hubClusterAccountId + ":role/" + hubClusterName + "_managed-cluster-identity-creator"
|
||||
|
||||
@@ -36,7 +36,6 @@ import (
|
||||
"open-cluster-management.io/sdk-go/pkg/patcher"
|
||||
|
||||
"open-cluster-management.io/ocm/manifests"
|
||||
commonhelpers "open-cluster-management.io/ocm/pkg/common/helpers"
|
||||
testingcommon "open-cluster-management.io/ocm/pkg/common/testing"
|
||||
"open-cluster-management.io/ocm/pkg/operator/helpers"
|
||||
)
|
||||
@@ -559,10 +558,10 @@ func TestSyncDeployWithGRPCAuthEnabled(t *testing.T) {
|
||||
clusterManager.Spec.RegistrationConfiguration = &operatorapiv1.RegistrationHubConfiguration{
|
||||
RegistrationDrivers: []operatorapiv1.RegistrationDriverHub{
|
||||
{
|
||||
AuthType: commonhelpers.CSRAuthType,
|
||||
AuthType: operatorapiv1.CSRAuthType,
|
||||
},
|
||||
{
|
||||
AuthType: commonhelpers.GRPCCAuthType,
|
||||
AuthType: operatorapiv1.GRPCAuthType,
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -623,10 +622,10 @@ func TestSyncDeleteWithGRPCAuthEnabled(t *testing.T) {
|
||||
clusterManager.Spec.RegistrationConfiguration = &operatorapiv1.RegistrationHubConfiguration{
|
||||
RegistrationDrivers: []operatorapiv1.RegistrationDriverHub{
|
||||
{
|
||||
AuthType: commonhelpers.CSRAuthType,
|
||||
AuthType: operatorapiv1.CSRAuthType,
|
||||
},
|
||||
{
|
||||
AuthType: commonhelpers.GRPCCAuthType,
|
||||
AuthType: operatorapiv1.GRPCAuthType,
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
@@ -21,7 +21,6 @@ import (
|
||||
operatorapiv1 "open-cluster-management.io/api/operator/v1"
|
||||
|
||||
"open-cluster-management.io/ocm/manifests"
|
||||
commonhelpers "open-cluster-management.io/ocm/pkg/common/helpers"
|
||||
"open-cluster-management.io/ocm/pkg/operator/helpers"
|
||||
)
|
||||
|
||||
@@ -91,17 +90,17 @@ func (c *runtimeReconcile) reconcile(ctx context.Context, cm *operatorapiv1.Clus
|
||||
for _, registrationDriver := range cm.Spec.RegistrationConfiguration.RegistrationDrivers {
|
||||
enabledRegistrationDrivers = append(enabledRegistrationDrivers, registrationDriver.AuthType)
|
||||
switch registrationDriver.AuthType {
|
||||
case commonhelpers.AwsIrsaAuthType:
|
||||
case operatorapiv1.AwsIrsaAuthType:
|
||||
if registrationDriver.AwsIrsa != nil {
|
||||
config.HubClusterArn = registrationDriver.AwsIrsa.HubClusterArn
|
||||
config.AutoApprovedARNPatterns = strings.Join(registrationDriver.AwsIrsa.AutoApprovedIdentities, ",")
|
||||
config.AwsResourceTags = strings.Join(registrationDriver.AwsIrsa.Tags, ",")
|
||||
}
|
||||
case commonhelpers.CSRAuthType:
|
||||
case operatorapiv1.CSRAuthType:
|
||||
if registrationDriver.CSR != nil {
|
||||
config.AutoApprovedCSRUsers = strings.Join(registrationDriver.CSR.AutoApprovedIdentities, ",")
|
||||
}
|
||||
case commonhelpers.GRPCCAuthType:
|
||||
case operatorapiv1.GRPCAuthType:
|
||||
if registrationDriver.GRPC == nil {
|
||||
// using registration image as default
|
||||
config.GRPCServerImage = cm.Spec.RegistrationImagePullSpec
|
||||
|
||||
@@ -351,7 +351,7 @@ func (n *klusterletController) sync(ctx context.Context, controllerContext facto
|
||||
config.RegistrationKubeAPIBurst = klusterlet.Spec.RegistrationConfiguration.KubeAPIBurst
|
||||
// Configuring Registration driver depending on registration auth
|
||||
if &klusterlet.Spec.RegistrationConfiguration.RegistrationDriver != nil &&
|
||||
klusterlet.Spec.RegistrationConfiguration.RegistrationDriver.AuthType == commonhelpers.AwsIrsaAuthType {
|
||||
klusterlet.Spec.RegistrationConfiguration.RegistrationDriver.AuthType == operatorapiv1.AwsIrsaAuthType {
|
||||
|
||||
hubClusterArn := klusterlet.Spec.RegistrationConfiguration.RegistrationDriver.AwsIrsa.HubClusterArn
|
||||
managedClusterArn := klusterlet.Spec.RegistrationConfiguration.RegistrationDriver.AwsIrsa.ManagedClusterArn
|
||||
|
||||
@@ -43,7 +43,6 @@ import (
|
||||
"open-cluster-management.io/sdk-go/pkg/patcher"
|
||||
|
||||
"open-cluster-management.io/ocm/manifests"
|
||||
commonhelpers "open-cluster-management.io/ocm/pkg/common/helpers"
|
||||
testingcommon "open-cluster-management.io/ocm/pkg/common/testing"
|
||||
"open-cluster-management.io/ocm/pkg/operator/helpers"
|
||||
testinghelper "open-cluster-management.io/ocm/pkg/operator/helpers/testing"
|
||||
@@ -1037,7 +1036,7 @@ func TestGetServersFromKlusterlet(t *testing.T) {
|
||||
func TestAWSIrsaAuthInSingletonModeWithInvalidClusterArns(t *testing.T) {
|
||||
klusterlet := newKlusterlet("klusterlet", "testns", "cluster1")
|
||||
awsIrsaRegistrationDriver := operatorapiv1.RegistrationDriver{
|
||||
AuthType: commonhelpers.AwsIrsaAuthType,
|
||||
AuthType: operatorapiv1.AwsIrsaAuthType,
|
||||
AwsIrsa: &operatorapiv1.AwsIrsa{
|
||||
HubClusterArn: "arn:aws:bks:us-west-2:123456789012:cluster/hub-cluster1",
|
||||
ManagedClusterArn: "arn:aws:eks:us-west-2:123456789012:cluster/managed-cluster1",
|
||||
@@ -1068,7 +1067,7 @@ func TestAWSIrsaAuthInSingletonModeWithInvalidClusterArns(t *testing.T) {
|
||||
func TestAWSIrsaAuthInSingletonMode(t *testing.T) {
|
||||
klusterlet := newKlusterlet("klusterlet", "testns", "cluster1")
|
||||
awsIrsaRegistrationDriver := operatorapiv1.RegistrationDriver{
|
||||
AuthType: commonhelpers.AwsIrsaAuthType,
|
||||
AuthType: operatorapiv1.AwsIrsaAuthType,
|
||||
AwsIrsa: &operatorapiv1.AwsIrsa{
|
||||
HubClusterArn: "arn:aws:eks:us-west-2:123456789012:cluster/hub-cluster1",
|
||||
ManagedClusterArn: "arn:aws:eks:us-west-2:123456789012:cluster/managed-cluster1",
|
||||
@@ -1094,13 +1093,13 @@ func TestAWSIrsaAuthInSingletonMode(t *testing.T) {
|
||||
t.Errorf("Expected non error when sync, %v", err)
|
||||
}
|
||||
|
||||
assertKlusterletDeployment(t, commonhelpers.AwsIrsaAuthType, controller.kubeClient.Actions(), createVerb, "", "cluster1", nil)
|
||||
assertKlusterletDeployment(t, operatorapiv1.AwsIrsaAuthType, controller.kubeClient.Actions(), createVerb, "", "cluster1", nil)
|
||||
}
|
||||
|
||||
func TestAWSIrsaAuthInNonSingletonMode(t *testing.T) {
|
||||
klusterlet := newKlusterlet("klusterlet", "testns", "cluster1")
|
||||
awsIrsaRegistrationDriver := operatorapiv1.RegistrationDriver{
|
||||
AuthType: commonhelpers.AwsIrsaAuthType,
|
||||
AuthType: operatorapiv1.AwsIrsaAuthType,
|
||||
AwsIrsa: &operatorapiv1.AwsIrsa{
|
||||
HubClusterArn: "arn:aws:eks:us-west-2:123456789012:cluster/hub-cluster1",
|
||||
ManagedClusterArn: "arn:aws:eks:us-west-2:123456789012:cluster/managed-cluster1",
|
||||
@@ -1462,7 +1461,7 @@ func TestClusterClaimConfigInSingletonMode(t *testing.T) {
|
||||
t.Errorf("Expected non error when sync, %v", err)
|
||||
}
|
||||
|
||||
assertKlusterletDeployment(t, commonhelpers.CSRAuthType, controller.kubeClient.Actions(), createVerb,
|
||||
assertKlusterletDeployment(t, operatorapiv1.CSRAuthType, controller.kubeClient.Actions(), createVerb,
|
||||
"", "cluster1", claimConfig)
|
||||
}
|
||||
|
||||
|
||||
@@ -27,6 +27,7 @@ import (
|
||||
workv1informers "open-cluster-management.io/api/client/work/informers/externalversions"
|
||||
clusterv1 "open-cluster-management.io/api/cluster/v1"
|
||||
ocmfeature "open-cluster-management.io/api/feature"
|
||||
operatorv1 "open-cluster-management.io/api/operator/v1"
|
||||
|
||||
commonhelpers "open-cluster-management.io/ocm/pkg/common/helpers"
|
||||
"open-cluster-management.io/ocm/pkg/features"
|
||||
@@ -73,7 +74,7 @@ func NewHubManagerOptions() *HubManagerOptions {
|
||||
GCResourceList: []string{"addon.open-cluster-management.io/v1alpha1/managedclusteraddons",
|
||||
"work.open-cluster-management.io/v1/manifestworks"},
|
||||
ImportOption: importeroptions.New(),
|
||||
EnabledRegistrationDrivers: []string{commonhelpers.CSRAuthType},
|
||||
EnabledRegistrationDrivers: []string{operatorv1.CSRAuthType},
|
||||
GRPCSigningDuration: 720 * time.Hour,
|
||||
}
|
||||
}
|
||||
@@ -191,7 +192,7 @@ func (m *HubManagerOptions) RunControllerManagerWithInformers(
|
||||
var drivers []register.HubDriver
|
||||
for _, enabledRegistrationDriver := range m.EnabledRegistrationDrivers {
|
||||
switch enabledRegistrationDriver {
|
||||
case commonhelpers.CSRAuthType:
|
||||
case operatorv1.CSRAuthType:
|
||||
autoApprovedCSRUsers := m.ClusterAutoApprovalUsers
|
||||
if len(m.AutoApprovedCSRUsers) > 0 {
|
||||
autoApprovedCSRUsers = m.AutoApprovedCSRUsers
|
||||
@@ -201,13 +202,13 @@ func (m *HubManagerOptions) RunControllerManagerWithInformers(
|
||||
return err
|
||||
}
|
||||
drivers = append(drivers, csrDriver)
|
||||
case commonhelpers.AwsIrsaAuthType:
|
||||
case operatorv1.AwsIrsaAuthType:
|
||||
awsIRSAHubDriver, err := awsirsa.NewAWSIRSAHubDriver(ctx, m.HubClusterArn, m.AutoApprovedARNPatterns, m.AwsResourceTags)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
drivers = append(drivers, awsIRSAHubDriver)
|
||||
case commonhelpers.GRPCCAuthType:
|
||||
case operatorv1.GRPCAuthType:
|
||||
grpcHubDriver, err := grpc.NewGRPCHubDriver(
|
||||
kubeClient, kubeInformers,
|
||||
m.GRPCCAKeyFile, m.GRPCCAFile, m.GRPCSigningDuration,
|
||||
|
||||
@@ -3,7 +3,8 @@ package factory
|
||||
import (
|
||||
"github.com/spf13/pflag"
|
||||
|
||||
"open-cluster-management.io/ocm/pkg/common/helpers"
|
||||
operatorv1 "open-cluster-management.io/api/operator/v1"
|
||||
|
||||
"open-cluster-management.io/ocm/pkg/registration/register"
|
||||
awsirsa "open-cluster-management.io/ocm/pkg/registration/register/aws_irsa"
|
||||
"open-cluster-management.io/ocm/pkg/registration/register/csr"
|
||||
@@ -13,14 +14,14 @@ import (
|
||||
type Options struct {
|
||||
RegistrationAuth string
|
||||
CSROption *csr.Option
|
||||
AWSISRAOption *awsirsa.AWSOption
|
||||
AWSIRSAOption *awsirsa.AWSOption
|
||||
GRPCOption *grpc.Option
|
||||
}
|
||||
|
||||
func NewOptions() *Options {
|
||||
return &Options{
|
||||
CSROption: csr.NewCSROption(),
|
||||
AWSISRAOption: awsirsa.NewAWSOption(),
|
||||
AWSIRSAOption: awsirsa.NewAWSOption(),
|
||||
GRPCOption: grpc.NewOptions(),
|
||||
}
|
||||
}
|
||||
@@ -29,15 +30,15 @@ func (s *Options) AddFlags(fs *pflag.FlagSet) {
|
||||
fs.StringVar(&s.RegistrationAuth, "registration-auth", s.RegistrationAuth,
|
||||
"The type of authentication to use to authenticate with hub.")
|
||||
s.CSROption.AddFlags(fs)
|
||||
s.AWSISRAOption.AddFlags(fs)
|
||||
s.AWSIRSAOption.AddFlags(fs)
|
||||
s.GRPCOption.AddFlags(fs)
|
||||
}
|
||||
|
||||
func (s *Options) Validate() error {
|
||||
switch s.RegistrationAuth {
|
||||
case helpers.AwsIrsaAuthType:
|
||||
return s.AWSISRAOption.Validate()
|
||||
case helpers.GRPCCAuthType:
|
||||
case operatorv1.AwsIrsaAuthType:
|
||||
return s.AWSIRSAOption.Validate()
|
||||
case operatorv1.GRPCAuthType:
|
||||
return s.GRPCOption.Validate()
|
||||
default:
|
||||
return s.CSROption.Validate()
|
||||
@@ -46,9 +47,9 @@ func (s *Options) Validate() error {
|
||||
|
||||
func (s *Options) Driver(secretOption register.SecretOption) (register.RegisterDriver, error) {
|
||||
switch s.RegistrationAuth {
|
||||
case helpers.AwsIrsaAuthType:
|
||||
return awsirsa.NewAWSIRSADriver(s.AWSISRAOption, secretOption), nil
|
||||
case helpers.GRPCCAuthType:
|
||||
case operatorv1.AwsIrsaAuthType:
|
||||
return awsirsa.NewAWSIRSADriver(s.AWSIRSAOption, secretOption), nil
|
||||
case operatorv1.GRPCAuthType:
|
||||
return grpc.NewGRPCDriver(s.GRPCOption, s.CSROption, secretOption)
|
||||
default:
|
||||
return csr.NewCSRDriver(s.CSROption, secretOption)
|
||||
|
||||
@@ -38,7 +38,7 @@ func TestValidate(t *testing.T) {
|
||||
name: "aws validate",
|
||||
opt: &Options{
|
||||
RegistrationAuth: "awsirsa",
|
||||
AWSISRAOption: &awsirsa.AWSOption{},
|
||||
AWSIRSAOption: &awsirsa.AWSOption{},
|
||||
},
|
||||
expectErr: true,
|
||||
},
|
||||
@@ -46,7 +46,7 @@ func TestValidate(t *testing.T) {
|
||||
name: "aws validate pass",
|
||||
opt: &Options{
|
||||
RegistrationAuth: "awsirsa",
|
||||
AWSISRAOption: &awsirsa.AWSOption{
|
||||
AWSIRSAOption: &awsirsa.AWSOption{
|
||||
HubClusterArn: "arn:aws:iam::123456789012:role/aws-iam-authenticator",
|
||||
},
|
||||
},
|
||||
|
||||
@@ -21,9 +21,9 @@ import (
|
||||
|
||||
clusterv1 "open-cluster-management.io/api/cluster/v1"
|
||||
ocmfeature "open-cluster-management.io/api/feature"
|
||||
operatorv1 "open-cluster-management.io/api/operator/v1"
|
||||
sdkhelpers "open-cluster-management.io/sdk-go/pkg/helpers"
|
||||
|
||||
"open-cluster-management.io/ocm/pkg/common/helpers"
|
||||
"open-cluster-management.io/ocm/pkg/features"
|
||||
"open-cluster-management.io/ocm/pkg/registration/register"
|
||||
"open-cluster-management.io/ocm/pkg/registration/register/csr"
|
||||
@@ -51,11 +51,11 @@ func NewGRPCHubDriver(
|
||||
duration time.Duration,
|
||||
autoApprovedCSRUsers []string,
|
||||
recorder events.Recorder) (register.HubDriver, error) {
|
||||
csrReconciles := []csr.Reconciler{csr.NewCSRRenewalReconciler(kubeClient, helpers.GRPCCAuthSigner, recorder)}
|
||||
csrReconciles := []csr.Reconciler{csr.NewCSRRenewalReconciler(kubeClient, operatorv1.GRPCAuthSigner, recorder)}
|
||||
if features.HubMutableFeatureGate.Enabled(ocmfeature.ManagedClusterAutoApproval) {
|
||||
csrReconciles = append(csrReconciles, csr.NewCSRBootstrapReconciler(
|
||||
kubeClient,
|
||||
helpers.GRPCCAuthSigner,
|
||||
operatorv1.GRPCAuthSigner,
|
||||
autoApprovedCSRUsers,
|
||||
recorder,
|
||||
))
|
||||
@@ -170,7 +170,7 @@ func (c *csrSignController) sync(ctx context.Context, syncCtx factory.SyncContex
|
||||
}
|
||||
|
||||
// Do not sign apiserver cert
|
||||
if csr.Spec.SignerName != helpers.GRPCCAuthSigner {
|
||||
if csr.Spec.SignerName != operatorv1.GRPCAuthSigner {
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -192,7 +192,7 @@ func getCSRInfo(c *certificatesv1.CertificateSigningRequest) csr.CSRInfo {
|
||||
Name: c.Name,
|
||||
Labels: c.Labels,
|
||||
SignerName: c.Spec.SignerName,
|
||||
Username: c.Annotations[helpers.CSRUserAnnotation],
|
||||
Username: c.Annotations[operatorv1.CSRUsernameAnnotation],
|
||||
UID: c.Spec.UID,
|
||||
Groups: c.Spec.Groups,
|
||||
Extra: extra,
|
||||
@@ -203,7 +203,7 @@ func getCSRInfo(c *certificatesv1.CertificateSigningRequest) csr.CSRInfo {
|
||||
func eventFilter(csr any) bool {
|
||||
switch v := csr.(type) {
|
||||
case *certificatesv1.CertificateSigningRequest:
|
||||
return v.Spec.SignerName == helpers.GRPCCAuthSigner
|
||||
return v.Spec.SignerName == operatorv1.GRPCAuthSigner
|
||||
default:
|
||||
return false
|
||||
}
|
||||
|
||||
@@ -16,7 +16,8 @@ import (
|
||||
certutil "k8s.io/client-go/util/cert"
|
||||
"k8s.io/client-go/util/keyutil"
|
||||
|
||||
"open-cluster-management.io/ocm/pkg/common/helpers"
|
||||
operatorv1 "open-cluster-management.io/api/operator/v1"
|
||||
|
||||
testingcommon "open-cluster-management.io/ocm/pkg/common/testing"
|
||||
)
|
||||
|
||||
@@ -101,7 +102,7 @@ func TestSignCSR(t *testing.T) {
|
||||
Usages: []certificatesv1.KeyUsage{
|
||||
certificatesv1.UsageClientAuth,
|
||||
},
|
||||
SignerName: helpers.GRPCCAuthSigner,
|
||||
SignerName: operatorv1.GRPCAuthSigner,
|
||||
Username: "system:open-cluster-management:test",
|
||||
Request: request,
|
||||
},
|
||||
@@ -167,7 +168,7 @@ func TestEventFilter(t *testing.T) {
|
||||
name: "v1 CSR with matching signer",
|
||||
input: &certificatesv1.CertificateSigningRequest{
|
||||
Spec: certificatesv1.CertificateSigningRequestSpec{
|
||||
SignerName: helpers.GRPCCAuthSigner,
|
||||
SignerName: operatorv1.GRPCAuthSigner,
|
||||
},
|
||||
},
|
||||
expected: true,
|
||||
@@ -196,11 +197,11 @@ func TestGetCSRInfo(t *testing.T) {
|
||||
csr := &certificatesv1.CertificateSigningRequest{
|
||||
ObjectMeta: metav1.ObjectMeta{
|
||||
Annotations: map[string]string{
|
||||
helpers.CSRUserAnnotation: "test",
|
||||
operatorv1.CSRUsernameAnnotation: "test",
|
||||
},
|
||||
},
|
||||
Spec: certificatesv1.CertificateSigningRequestSpec{
|
||||
SignerName: helpers.GRPCCAuthSigner,
|
||||
SignerName: operatorv1.GRPCAuthSigner,
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
@@ -22,6 +22,7 @@ import (
|
||||
addoninformers "open-cluster-management.io/api/client/addon/informers/externalversions"
|
||||
clusterinformers "open-cluster-management.io/api/client/cluster/informers/externalversions"
|
||||
clusterv1 "open-cluster-management.io/api/cluster/v1"
|
||||
operatorv1 "open-cluster-management.io/api/operator/v1"
|
||||
cloudeventsaddon "open-cluster-management.io/sdk-go/pkg/cloudevents/clients/addon"
|
||||
cloudeventscluster "open-cluster-management.io/sdk-go/pkg/cloudevents/clients/cluster"
|
||||
cloudeventscsr "open-cluster-management.io/sdk-go/pkg/cloudevents/clients/csr"
|
||||
@@ -34,7 +35,6 @@ import (
|
||||
"open-cluster-management.io/sdk-go/pkg/cloudevents/generic/options/cert"
|
||||
"open-cluster-management.io/sdk-go/pkg/cloudevents/generic/options/grpc"
|
||||
|
||||
"open-cluster-management.io/ocm/pkg/common/helpers"
|
||||
"open-cluster-management.io/ocm/pkg/registration/register"
|
||||
"open-cluster-management.io/ocm/pkg/registration/register/csr"
|
||||
)
|
||||
@@ -50,7 +50,7 @@ var _ register.RegisterDriver = &GRPCDriver{}
|
||||
var _ register.AddonDriver = &GRPCDriver{}
|
||||
|
||||
func NewGRPCDriver(opt *Option, csrOption *csr.Option, secretOption register.SecretOption) (register.RegisterDriver, error) {
|
||||
secretOption.Signer = helpers.GRPCCAuthSigner
|
||||
secretOption.Signer = operatorv1.GRPCAuthSigner
|
||||
csrDriver, err := csr.NewCSRDriver(csrOption, secretOption)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
||||
@@ -19,8 +19,8 @@ import (
|
||||
"sigs.k8s.io/controller-runtime/pkg/log/zap"
|
||||
|
||||
ocmfeature "open-cluster-management.io/api/feature"
|
||||
operatorv1 "open-cluster-management.io/api/operator/v1"
|
||||
|
||||
commonhelpers "open-cluster-management.io/ocm/pkg/common/helpers"
|
||||
commonoptions "open-cluster-management.io/ocm/pkg/common/options"
|
||||
testingcommon "open-cluster-management.io/ocm/pkg/common/testing"
|
||||
"open-cluster-management.io/ocm/pkg/features"
|
||||
@@ -82,8 +82,8 @@ func TestValidate(t *testing.T) {
|
||||
options: func() *SpokeAgentOptions {
|
||||
awsDefaultCompletedOptions := NewSpokeAgentOptions()
|
||||
awsDefaultCompletedOptions.BootstrapKubeconfig = "/spoke/bootstrap/kubeconfig"
|
||||
awsDefaultCompletedOptions.RegisterDriverOption.RegistrationAuth = commonhelpers.AwsIrsaAuthType
|
||||
awsDefaultCompletedOptions.RegisterDriverOption.AWSISRAOption.HubClusterArn = "arn:aws:eks:us-west-2:123456789012:cluster/hub-cluster1"
|
||||
awsDefaultCompletedOptions.RegisterDriverOption.RegistrationAuth = operatorv1.AwsIrsaAuthType
|
||||
awsDefaultCompletedOptions.RegisterDriverOption.AWSIRSAOption.HubClusterArn = "arn:aws:eks:us-west-2:123456789012:cluster/hub-cluster1"
|
||||
return awsDefaultCompletedOptions
|
||||
}(),
|
||||
expectedErr: "",
|
||||
@@ -93,7 +93,7 @@ func TestValidate(t *testing.T) {
|
||||
options: func() *SpokeAgentOptions {
|
||||
awsCompletedOptionsHubArnMissing := NewSpokeAgentOptions()
|
||||
awsCompletedOptionsHubArnMissing.BootstrapKubeconfig = "/spoke/bootstrap/kubeconfig"
|
||||
awsCompletedOptionsHubArnMissing.RegisterDriverOption.RegistrationAuth = commonhelpers.AwsIrsaAuthType
|
||||
awsCompletedOptionsHubArnMissing.RegisterDriverOption.RegistrationAuth = operatorv1.AwsIrsaAuthType
|
||||
return awsCompletedOptionsHubArnMissing
|
||||
}(),
|
||||
expectedErr: "EksHubClusterArn cannot be empty if RegistrationAuth is awsirsa",
|
||||
|
||||
@@ -16,12 +16,12 @@ import (
|
||||
"k8s.io/klog/v2"
|
||||
|
||||
clusterv1 "open-cluster-management.io/api/cluster/v1"
|
||||
operatorv1 "open-cluster-management.io/api/operator/v1"
|
||||
csrce "open-cluster-management.io/sdk-go/pkg/cloudevents/clients/csr"
|
||||
"open-cluster-management.io/sdk-go/pkg/cloudevents/generic/types"
|
||||
"open-cluster-management.io/sdk-go/pkg/cloudevents/server"
|
||||
"open-cluster-management.io/sdk-go/pkg/cloudevents/server/grpc/authn"
|
||||
|
||||
"open-cluster-management.io/ocm/pkg/common/helpers"
|
||||
"open-cluster-management.io/ocm/pkg/server/services"
|
||||
)
|
||||
|
||||
@@ -90,7 +90,7 @@ func (c *CSRService) HandleStatusUpdate(ctx context.Context, evt *cloudevents.Ev
|
||||
// the username in the csr is the service account of gRPC server rather than the user of agent.
|
||||
// The approver controller in the registration will not be able to know where this CSR originates
|
||||
// from. Therefore, this annotation with the agent's username is added for CSR approval checks.
|
||||
csr.Annotations = map[string]string{helpers.CSRUserAnnotation: fmt.Sprintf("%v", ctx.Value(authn.ContextUserKey))}
|
||||
csr.Annotations = map[string]string{operatorv1.CSRUsernameAnnotation: fmt.Sprintf("%v", ctx.Value(authn.ContextUserKey))}
|
||||
_, err := c.csrClient.CertificatesV1().CertificateSigningRequests().Create(ctx, csr, metav1.CreateOptions{})
|
||||
return err
|
||||
default:
|
||||
|
||||
@@ -10,8 +10,6 @@ import (
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
|
||||
operatorapiv1 "open-cluster-management.io/api/operator/v1"
|
||||
|
||||
"open-cluster-management.io/ocm/pkg/common/helpers"
|
||||
)
|
||||
|
||||
var _ = ginkgo.Describe("ClusterManager Default Mode with aws registration", func() {
|
||||
@@ -48,7 +46,7 @@ var _ = ginkgo.Describe("ClusterManager Default Mode with aws registration", fun
|
||||
clusterManager.Spec.RegistrationConfiguration = &operatorapiv1.RegistrationHubConfiguration{}
|
||||
clusterManager.Spec.RegistrationConfiguration.RegistrationDrivers = []operatorapiv1.RegistrationDriverHub{
|
||||
{
|
||||
AuthType: helpers.AwsIrsaAuthType,
|
||||
AuthType: operatorapiv1.AwsIrsaAuthType,
|
||||
AwsIrsa: &operatorapiv1.AwsIrsaConfig{
|
||||
HubClusterArn: hubClusterArn,
|
||||
Tags: []string{
|
||||
@@ -145,7 +143,7 @@ var _ = ginkgo.Describe("ClusterManager Default Mode with aws registration", fun
|
||||
clusterManager.Spec.RegistrationConfiguration = &operatorapiv1.RegistrationHubConfiguration{}
|
||||
clusterManager.Spec.RegistrationConfiguration.RegistrationDrivers = []operatorapiv1.RegistrationDriverHub{
|
||||
{
|
||||
AuthType: helpers.AwsIrsaAuthType,
|
||||
AuthType: operatorapiv1.AwsIrsaAuthType,
|
||||
AwsIrsa: &operatorapiv1.AwsIrsaConfig{
|
||||
HubClusterArn: hubClusterArn,
|
||||
},
|
||||
|
||||
@@ -17,7 +17,6 @@ import (
|
||||
operatorclient "open-cluster-management.io/api/client/operator/clientset/versioned"
|
||||
operatorapiv1 "open-cluster-management.io/api/operator/v1"
|
||||
|
||||
commonhelpers "open-cluster-management.io/ocm/pkg/common/helpers"
|
||||
"open-cluster-management.io/ocm/pkg/operator/helpers"
|
||||
"open-cluster-management.io/ocm/test/integration/util"
|
||||
)
|
||||
@@ -331,10 +330,10 @@ func enableGRPCAuth(operatorClient operatorclient.Interface, clusterManagerName
|
||||
clusterManager.Spec.RegistrationConfiguration = &operatorapiv1.RegistrationHubConfiguration{
|
||||
RegistrationDrivers: []operatorapiv1.RegistrationDriverHub{
|
||||
{
|
||||
AuthType: commonhelpers.CSRAuthType,
|
||||
AuthType: operatorapiv1.CSRAuthType,
|
||||
},
|
||||
{
|
||||
AuthType: commonhelpers.GRPCCAuthType,
|
||||
AuthType: operatorapiv1.GRPCAuthType,
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -342,10 +341,10 @@ func enableGRPCAuth(operatorClient operatorclient.Interface, clusterManagerName
|
||||
clusterManager.Spec.RegistrationConfiguration = &operatorapiv1.RegistrationHubConfiguration{
|
||||
RegistrationDrivers: []operatorapiv1.RegistrationDriverHub{
|
||||
{
|
||||
AuthType: commonhelpers.CSRAuthType,
|
||||
AuthType: operatorapiv1.CSRAuthType,
|
||||
},
|
||||
{
|
||||
AuthType: commonhelpers.GRPCCAuthType,
|
||||
AuthType: operatorapiv1.GRPCAuthType,
|
||||
GRPC: &operatorapiv1.GRPCConfig{
|
||||
AutoApprovedIdentities: autoApprovedIdentities,
|
||||
},
|
||||
|
||||
@@ -167,11 +167,11 @@ var _ = ginkgo.BeforeSuite(func() {
|
||||
DeployOption: operatorapiv1.ClusterManagerDeployOption{
|
||||
Mode: operatorapiv1.InstallModeHosted,
|
||||
Hosted: &operatorapiv1.HostedClusterManagerConfiguration{
|
||||
RegistrationWebhookConfiguration: operatorapiv1.WebhookConfiguration{
|
||||
RegistrationWebhookConfiguration: operatorapiv1.HostedWebhookConfiguration{
|
||||
Address: "localhost",
|
||||
Port: 443,
|
||||
},
|
||||
WorkWebhookConfiguration: operatorapiv1.WebhookConfiguration{
|
||||
WorkWebhookConfiguration: operatorapiv1.HostedWebhookConfiguration{
|
||||
Address: "localhost",
|
||||
Port: 443,
|
||||
},
|
||||
|
||||
@@ -12,7 +12,6 @@ import (
|
||||
|
||||
operatorapiv1 "open-cluster-management.io/api/operator/v1"
|
||||
|
||||
commonhelpers "open-cluster-management.io/ocm/pkg/common/helpers"
|
||||
"open-cluster-management.io/ocm/pkg/operator/helpers"
|
||||
"open-cluster-management.io/ocm/test/integration/util"
|
||||
)
|
||||
@@ -57,7 +56,7 @@ var _ = ginkgo.Describe("Klusterlet using aws auth", func() {
|
||||
Namespace: klusterletNamespace,
|
||||
RegistrationConfiguration: &operatorapiv1.RegistrationConfiguration{
|
||||
RegistrationDriver: operatorapiv1.RegistrationDriver{
|
||||
AuthType: commonhelpers.AwsIrsaAuthType,
|
||||
AuthType: operatorapiv1.AwsIrsaAuthType,
|
||||
AwsIrsa: &operatorapiv1.AwsIrsa{
|
||||
HubClusterArn: util.HubClusterArn,
|
||||
ManagedClusterArn: util.ManagedClusterArn,
|
||||
|
||||
@@ -12,7 +12,6 @@ import (
|
||||
|
||||
operatorapiv1 "open-cluster-management.io/api/operator/v1"
|
||||
|
||||
commonhelpers "open-cluster-management.io/ocm/pkg/common/helpers"
|
||||
"open-cluster-management.io/ocm/pkg/operator/helpers"
|
||||
"open-cluster-management.io/ocm/test/integration/util"
|
||||
)
|
||||
@@ -44,7 +43,7 @@ var _ = ginkgo.Describe("Klusterlet Singleton mode with aws auth", func() {
|
||||
},
|
||||
RegistrationConfiguration: &operatorapiv1.RegistrationConfiguration{
|
||||
RegistrationDriver: operatorapiv1.RegistrationDriver{
|
||||
AuthType: commonhelpers.AwsIrsaAuthType,
|
||||
AuthType: operatorapiv1.AwsIrsaAuthType,
|
||||
AwsIrsa: &operatorapiv1.AwsIrsa{
|
||||
HubClusterArn: util.HubClusterArn,
|
||||
ManagedClusterArn: util.ManagedClusterArn,
|
||||
|
||||
@@ -10,7 +10,6 @@ import (
|
||||
|
||||
operatorv1 "open-cluster-management.io/api/operator/v1"
|
||||
|
||||
commonhelpers "open-cluster-management.io/ocm/pkg/common/helpers"
|
||||
commonoptions "open-cluster-management.io/ocm/pkg/common/options"
|
||||
"open-cluster-management.io/ocm/pkg/registration/register/aws_irsa"
|
||||
registerfactory "open-cluster-management.io/ocm/pkg/registration/register/factory"
|
||||
@@ -30,8 +29,8 @@ var _ = ginkgo.Describe("Cluster Annotations for aws", func() {
|
||||
hubClusterArn := "arn:aws:eks:us-west-2:123456789012:cluster/hub-cluster1"
|
||||
agentOptions := &spoke.SpokeAgentOptions{
|
||||
RegisterDriverOption: ®isterfactory.Options{
|
||||
RegistrationAuth: commonhelpers.AwsIrsaAuthType,
|
||||
AWSISRAOption: &aws_irsa.AWSOption{
|
||||
RegistrationAuth: operatorv1.AwsIrsaAuthType,
|
||||
AWSIRSAOption: &aws_irsa.AWSOption{
|
||||
HubClusterArn: hubClusterArn,
|
||||
ManagedClusterArn: managedClusterArn,
|
||||
ManagedClusterRoleSuffix: managedClusterRoleSuffix,
|
||||
|
||||
@@ -24,8 +24,8 @@ import (
|
||||
workclientset "open-cluster-management.io/api/client/work/clientset/versioned"
|
||||
clusterv1 "open-cluster-management.io/api/cluster/v1"
|
||||
ocmfeature "open-cluster-management.io/api/feature"
|
||||
operatorv1 "open-cluster-management.io/api/operator/v1"
|
||||
|
||||
"open-cluster-management.io/ocm/pkg/common/helpers"
|
||||
commonoptions "open-cluster-management.io/ocm/pkg/common/options"
|
||||
"open-cluster-management.io/ocm/pkg/features"
|
||||
"open-cluster-management.io/ocm/pkg/registration/hub"
|
||||
@@ -209,7 +209,7 @@ var _ = ginkgo.BeforeSuite(func() {
|
||||
var ctx context.Context
|
||||
|
||||
hubOption = hub.NewHubManagerOptions()
|
||||
hubOption.EnabledRegistrationDrivers = []string{helpers.CSRAuthType}
|
||||
hubOption.EnabledRegistrationDrivers = []string{operatorv1.CSRAuthType}
|
||||
hubOption.ClusterAutoApprovalUsers = []string{util.AutoApprovalBootstrapUser}
|
||||
|
||||
startHub = func(m *hub.HubManagerOptions) {
|
||||
|
||||
@@ -12,6 +12,8 @@ import (
|
||||
"k8s.io/apimachinery/pkg/util/sets"
|
||||
"k8s.io/client-go/tools/clientcmd"
|
||||
|
||||
operatorv1 "open-cluster-management.io/api/operator/v1"
|
||||
|
||||
"open-cluster-management.io/ocm/pkg/common/helpers"
|
||||
commonoptions "open-cluster-management.io/ocm/pkg/common/options"
|
||||
"open-cluster-management.io/ocm/pkg/registration/hub"
|
||||
@@ -34,7 +36,7 @@ var _ = ginkgo.Describe("Joining Process for aws flow", ginkgo.Ordered, func() {
|
||||
stopHub()
|
||||
|
||||
awsHubOption := hub.NewHubManagerOptions()
|
||||
awsHubOption.EnabledRegistrationDrivers = []string{helpers.CSRAuthType, helpers.AwsIrsaAuthType}
|
||||
awsHubOption.EnabledRegistrationDrivers = []string{operatorv1.CSRAuthType, operatorv1.AwsIrsaAuthType}
|
||||
awsHubOption.HubClusterArn = "arn:aws:eks:us-west-2:123456789012:cluster/hub-cluster1"
|
||||
awsHubOption.AutoApprovedARNPatterns = []string{"arn:aws:eks:us-west-2:123456789012:cluster/.*"}
|
||||
startHub(awsHubOption)
|
||||
@@ -64,8 +66,8 @@ var _ = ginkgo.Describe("Joining Process for aws flow", ginkgo.Ordered, func() {
|
||||
// run registration agent
|
||||
agentOptions := &spoke.SpokeAgentOptions{
|
||||
RegisterDriverOption: ®isterfactory.Options{
|
||||
RegistrationAuth: helpers.AwsIrsaAuthType,
|
||||
AWSISRAOption: &awsirsa.AWSOption{
|
||||
RegistrationAuth: operatorv1.AwsIrsaAuthType,
|
||||
AWSIRSAOption: &awsirsa.AWSOption{
|
||||
HubClusterArn: hubClusterArn,
|
||||
ManagedClusterArn: managedClusterArn,
|
||||
ManagedClusterRoleSuffix: managedClusterRoleSuffix,
|
||||
@@ -194,8 +196,8 @@ var _ = ginkgo.Describe("Joining Process for aws flow", ginkgo.Ordered, func() {
|
||||
// run registration agent
|
||||
agentOptions := &spoke.SpokeAgentOptions{
|
||||
RegisterDriverOption: ®isterfactory.Options{
|
||||
RegistrationAuth: helpers.AwsIrsaAuthType,
|
||||
AWSISRAOption: &awsirsa.AWSOption{
|
||||
RegistrationAuth: operatorv1.AwsIrsaAuthType,
|
||||
AWSIRSAOption: &awsirsa.AWSOption{
|
||||
HubClusterArn: hubClusterArn,
|
||||
ManagedClusterArn: managedClusterArn,
|
||||
ManagedClusterRoleSuffix: managedClusterRoleSuffix,
|
||||
@@ -231,8 +233,8 @@ var _ = ginkgo.Describe("Joining Process for aws flow", ginkgo.Ordered, func() {
|
||||
// run registration agent
|
||||
agentOptions := &spoke.SpokeAgentOptions{
|
||||
RegisterDriverOption: ®isterfactory.Options{
|
||||
RegistrationAuth: helpers.AwsIrsaAuthType,
|
||||
AWSISRAOption: &awsirsa.AWSOption{
|
||||
RegistrationAuth: operatorv1.AwsIrsaAuthType,
|
||||
AWSIRSAOption: &awsirsa.AWSOption{
|
||||
HubClusterArn: hubClusterArn,
|
||||
ManagedClusterArn: managedClusterArn,
|
||||
ManagedClusterRoleSuffix: managedClusterRoleSuffix,
|
||||
|
||||
@@ -14,6 +14,7 @@ import (
|
||||
"k8s.io/apimachinery/pkg/util/rand"
|
||||
|
||||
clusterv1 "open-cluster-management.io/api/cluster/v1"
|
||||
operatorv1 "open-cluster-management.io/api/operator/v1"
|
||||
addonce "open-cluster-management.io/sdk-go/pkg/cloudevents/clients/addon"
|
||||
clusterce "open-cluster-management.io/sdk-go/pkg/cloudevents/clients/cluster"
|
||||
csrce "open-cluster-management.io/sdk-go/pkg/cloudevents/clients/csr"
|
||||
@@ -22,7 +23,6 @@ import (
|
||||
grpcauthn "open-cluster-management.io/sdk-go/pkg/cloudevents/server/grpc/authn"
|
||||
grpcoptions "open-cluster-management.io/sdk-go/pkg/cloudevents/server/grpc/options"
|
||||
|
||||
"open-cluster-management.io/ocm/pkg/common/helpers"
|
||||
commonhelpers "open-cluster-management.io/ocm/pkg/common/helpers"
|
||||
commonoptions "open-cluster-management.io/ocm/pkg/common/options"
|
||||
"open-cluster-management.io/ocm/pkg/registration/hub"
|
||||
@@ -114,7 +114,7 @@ var _ = ginkgo.Describe("Registration using GRPC", ginkgo.Ordered, ginkgo.Label(
|
||||
ginkgo.BeforeEach(func() {
|
||||
postfix = rand.String(5)
|
||||
hubOptionWithGRPC = hub.NewHubManagerOptions()
|
||||
hubOptionWithGRPC.EnabledRegistrationDrivers = []string{helpers.CSRAuthType, helpers.GRPCCAuthType}
|
||||
hubOptionWithGRPC.EnabledRegistrationDrivers = []string{operatorv1.CSRAuthType, operatorv1.GRPCAuthType}
|
||||
hubOptionWithGRPC.GRPCCAFile = gRPCServerOptions.ClientCAFile
|
||||
hubOptionWithGRPC.GRPCCAKeyFile = gRPCCAKeyFile
|
||||
startHub(hubOptionWithGRPC)
|
||||
@@ -125,7 +125,7 @@ var _ = ginkgo.Describe("Registration using GRPC", ginkgo.Ordered, ginkgo.Label(
|
||||
hubGRPCConfigSecret = fmt.Sprintf("%s-hub-grpcconfig-secret-%s", grpcTest, postfix)
|
||||
hubGRPCConfigDir = path.Join(util.TestDir, fmt.Sprintf("%s-grpc-%s", grpcTest, postfix), "hub-kubeconfig")
|
||||
grpcDriverOption := factory.NewOptions()
|
||||
grpcDriverOption.RegistrationAuth = helpers.GRPCCAuthType
|
||||
grpcDriverOption.RegistrationAuth = operatorv1.GRPCAuthType
|
||||
grpcDriverOption.GRPCOption = &grpc.Option{
|
||||
BootstrapConfigFile: bootstrapGRPCConfigFile,
|
||||
ConfigFile: path.Join(hubGRPCConfigDir, "config.yaml"),
|
||||
@@ -208,7 +208,7 @@ var _ = ginkgo.Describe("Registration using GRPC", ginkgo.Ordered, ginkgo.Label(
|
||||
ginkgo.BeforeEach(func() {
|
||||
postfix = rand.String(5)
|
||||
hubOptionWithGRPC = hub.NewHubManagerOptions()
|
||||
hubOptionWithGRPC.EnabledRegistrationDrivers = []string{helpers.GRPCCAuthType}
|
||||
hubOptionWithGRPC.EnabledRegistrationDrivers = []string{operatorv1.GRPCAuthType}
|
||||
hubOptionWithGRPC.GRPCCAFile = gRPCServerOptions.ClientCAFile
|
||||
hubOptionWithGRPC.GRPCCAKeyFile = gRPCCAKeyFile
|
||||
hubOptionWithGRPC.GRPCSigningDuration = 5 * time.Second
|
||||
@@ -219,7 +219,7 @@ var _ = ginkgo.Describe("Registration using GRPC", ginkgo.Ordered, ginkgo.Label(
|
||||
hubGRPCConfigSecret = fmt.Sprintf("%s-hub-grpcconfig-secret-%s", grpcTest, postfix)
|
||||
hubGRPCConfigDir = path.Join(util.TestDir, fmt.Sprintf("%s-grpc-%s", grpcTest, postfix), "hub-kubeconfig")
|
||||
grpcDriverOption := factory.NewOptions()
|
||||
grpcDriverOption.RegistrationAuth = helpers.GRPCCAuthType
|
||||
grpcDriverOption.RegistrationAuth = operatorv1.GRPCAuthType
|
||||
grpcDriverOption.GRPCOption = &grpc.Option{
|
||||
BootstrapConfigFile: bootstrapGRPCConfigFile,
|
||||
ConfigFile: path.Join(hubGRPCConfigDir, "config.yaml"),
|
||||
@@ -279,7 +279,7 @@ var _ = ginkgo.Describe("Registration using GRPC", ginkgo.Ordered, ginkgo.Label(
|
||||
ginkgo.BeforeEach(func() {
|
||||
postfix = rand.String(5)
|
||||
hubOptionWithGRPC = hub.NewHubManagerOptions()
|
||||
hubOptionWithGRPC.EnabledRegistrationDrivers = []string{helpers.GRPCCAuthType}
|
||||
hubOptionWithGRPC.EnabledRegistrationDrivers = []string{operatorv1.GRPCAuthType}
|
||||
hubOptionWithGRPC.GRPCCAFile = gRPCServerOptions.ClientCAFile
|
||||
hubOptionWithGRPC.GRPCCAKeyFile = gRPCCAKeyFile
|
||||
hubOptionWithGRPC.AutoApprovedGRPCUsers = []string{"test-client"}
|
||||
@@ -290,7 +290,7 @@ var _ = ginkgo.Describe("Registration using GRPC", ginkgo.Ordered, ginkgo.Label(
|
||||
hubGRPCConfigSecret = fmt.Sprintf("%s-hub-grpcconfig-secret-%s", grpcTest, postfix)
|
||||
hubGRPCConfigDir = path.Join(util.TestDir, fmt.Sprintf("%s-grpc-%s", grpcTest, postfix), "hub-kubeconfig")
|
||||
grpcDriverOption := factory.NewOptions()
|
||||
grpcDriverOption.RegistrationAuth = helpers.GRPCCAuthType
|
||||
grpcDriverOption.RegistrationAuth = operatorv1.GRPCAuthType
|
||||
grpcDriverOption.GRPCOption = &grpc.Option{
|
||||
BootstrapConfigFile: bootstrapGRPCConfigFile,
|
||||
ConfigFile: path.Join(hubGRPCConfigDir, "config.yaml"),
|
||||
|
||||
3
vendor/github.com/openshift/build-machinery-go/make/targets/openshift/yq.mk
generated
vendored
3
vendor/github.com/openshift/build-machinery-go/make/targets/openshift/yq.mk
generated
vendored
@@ -8,8 +8,7 @@ include $(addprefix $(dir $(lastword $(MAKEFILE_LIST))), \
|
||||
|
||||
YQ_VERSION ?=2.4.0
|
||||
YQ ?=$(PERMANENT_TMP_GOPATH)/bin/yq-$(YQ_VERSION)
|
||||
yq_dir :=$(dir $(YQ))
|
||||
|
||||
yq_dir =$(dir $(YQ))
|
||||
|
||||
ensure-yq:
|
||||
ifeq "" "$(wildcard $(YQ))"
|
||||
|
||||
6
vendor/modules.txt
vendored
6
vendor/modules.txt
vendored
@@ -491,7 +491,7 @@ github.com/openshift/api/template
|
||||
github.com/openshift/api/template/v1
|
||||
github.com/openshift/api/user
|
||||
github.com/openshift/api/user/v1
|
||||
# github.com/openshift/build-machinery-go v0.0.0-20250530140348-dc5b2804eeee
|
||||
# github.com/openshift/build-machinery-go v0.0.0-20250602125535-1b6d00b8c37c
|
||||
## explicit; go 1.22.0
|
||||
github.com/openshift/build-machinery-go
|
||||
github.com/openshift/build-machinery-go/make
|
||||
@@ -1732,8 +1732,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 v1.0.1-0.20250730122947-5e3423e7794a
|
||||
## explicit; go 1.23.6
|
||||
# open-cluster-management.io/api v1.0.1-0.20250827024027-f3e5dab96ea1
|
||||
## explicit; go 1.24.0
|
||||
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
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
package fake
|
||||
|
||||
import (
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
"k8s.io/apimachinery/pkg/watch"
|
||||
"k8s.io/client-go/discovery"
|
||||
@@ -34,9 +35,13 @@ func NewSimpleClientset(objects ...runtime.Object) *Clientset {
|
||||
cs.discovery = &fakediscovery.FakeDiscovery{Fake: &cs.Fake}
|
||||
cs.AddReactor("*", "*", testing.ObjectReaction(o))
|
||||
cs.AddWatchReactor("*", func(action testing.Action) (handled bool, ret watch.Interface, err error) {
|
||||
var opts metav1.ListOptions
|
||||
if watchActcion, ok := action.(testing.WatchActionImpl); ok {
|
||||
opts = watchActcion.ListOptions
|
||||
}
|
||||
gvr := action.GetResource()
|
||||
ns := action.GetNamespace()
|
||||
watch, err := o.Watch(gvr, ns)
|
||||
watch, err := o.Watch(gvr, ns, opts)
|
||||
if err != nil {
|
||||
return false, nil, err
|
||||
}
|
||||
|
||||
@@ -45,9 +45,7 @@ func (c *AddonV1alpha1Client) ManagedClusterAddOns(namespace string) ManagedClus
|
||||
// where httpClient was generated with rest.HTTPClientFor(c).
|
||||
func NewForConfig(c *rest.Config) (*AddonV1alpha1Client, error) {
|
||||
config := *c
|
||||
if err := setConfigDefaults(&config); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
setConfigDefaults(&config)
|
||||
httpClient, err := rest.HTTPClientFor(&config)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -59,9 +57,7 @@ func NewForConfig(c *rest.Config) (*AddonV1alpha1Client, error) {
|
||||
// Note the http client provided takes precedence over the configured transport values.
|
||||
func NewForConfigAndClient(c *rest.Config, h *http.Client) (*AddonV1alpha1Client, error) {
|
||||
config := *c
|
||||
if err := setConfigDefaults(&config); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
setConfigDefaults(&config)
|
||||
client, err := rest.RESTClientForConfigAndClient(&config, h)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -84,7 +80,7 @@ func New(c rest.Interface) *AddonV1alpha1Client {
|
||||
return &AddonV1alpha1Client{c}
|
||||
}
|
||||
|
||||
func setConfigDefaults(config *rest.Config) error {
|
||||
func setConfigDefaults(config *rest.Config) {
|
||||
gv := addonv1alpha1.SchemeGroupVersion
|
||||
config.GroupVersion = &gv
|
||||
config.APIPath = "/apis"
|
||||
@@ -93,8 +89,6 @@ func setConfigDefaults(config *rest.Config) error {
|
||||
if config.UserAgent == "" {
|
||||
config.UserAgent = rest.DefaultKubernetesUserAgent()
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// RESTClient returns a RESTClient that is used to communicate
|
||||
|
||||
@@ -47,13 +47,25 @@ func NewFilteredAddOnDeploymentConfigInformer(client versioned.Interface, namesp
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&options)
|
||||
}
|
||||
return client.AddonV1alpha1().AddOnDeploymentConfigs(namespace).List(context.TODO(), options)
|
||||
return client.AddonV1alpha1().AddOnDeploymentConfigs(namespace).List(context.Background(), options)
|
||||
},
|
||||
WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&options)
|
||||
}
|
||||
return client.AddonV1alpha1().AddOnDeploymentConfigs(namespace).Watch(context.TODO(), options)
|
||||
return client.AddonV1alpha1().AddOnDeploymentConfigs(namespace).Watch(context.Background(), options)
|
||||
},
|
||||
ListWithContextFunc: func(ctx context.Context, options v1.ListOptions) (runtime.Object, error) {
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&options)
|
||||
}
|
||||
return client.AddonV1alpha1().AddOnDeploymentConfigs(namespace).List(ctx, options)
|
||||
},
|
||||
WatchFuncWithContext: func(ctx context.Context, options v1.ListOptions) (watch.Interface, error) {
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&options)
|
||||
}
|
||||
return client.AddonV1alpha1().AddOnDeploymentConfigs(namespace).Watch(ctx, options)
|
||||
},
|
||||
},
|
||||
&apiaddonv1alpha1.AddOnDeploymentConfig{},
|
||||
|
||||
@@ -46,13 +46,25 @@ func NewFilteredAddOnTemplateInformer(client versioned.Interface, resyncPeriod t
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&options)
|
||||
}
|
||||
return client.AddonV1alpha1().AddOnTemplates().List(context.TODO(), options)
|
||||
return client.AddonV1alpha1().AddOnTemplates().List(context.Background(), options)
|
||||
},
|
||||
WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&options)
|
||||
}
|
||||
return client.AddonV1alpha1().AddOnTemplates().Watch(context.TODO(), options)
|
||||
return client.AddonV1alpha1().AddOnTemplates().Watch(context.Background(), options)
|
||||
},
|
||||
ListWithContextFunc: func(ctx context.Context, options v1.ListOptions) (runtime.Object, error) {
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&options)
|
||||
}
|
||||
return client.AddonV1alpha1().AddOnTemplates().List(ctx, options)
|
||||
},
|
||||
WatchFuncWithContext: func(ctx context.Context, options v1.ListOptions) (watch.Interface, error) {
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&options)
|
||||
}
|
||||
return client.AddonV1alpha1().AddOnTemplates().Watch(ctx, options)
|
||||
},
|
||||
},
|
||||
&apiaddonv1alpha1.AddOnTemplate{},
|
||||
|
||||
@@ -46,13 +46,25 @@ func NewFilteredClusterManagementAddOnInformer(client versioned.Interface, resyn
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&options)
|
||||
}
|
||||
return client.AddonV1alpha1().ClusterManagementAddOns().List(context.TODO(), options)
|
||||
return client.AddonV1alpha1().ClusterManagementAddOns().List(context.Background(), options)
|
||||
},
|
||||
WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&options)
|
||||
}
|
||||
return client.AddonV1alpha1().ClusterManagementAddOns().Watch(context.TODO(), options)
|
||||
return client.AddonV1alpha1().ClusterManagementAddOns().Watch(context.Background(), options)
|
||||
},
|
||||
ListWithContextFunc: func(ctx context.Context, options v1.ListOptions) (runtime.Object, error) {
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&options)
|
||||
}
|
||||
return client.AddonV1alpha1().ClusterManagementAddOns().List(ctx, options)
|
||||
},
|
||||
WatchFuncWithContext: func(ctx context.Context, options v1.ListOptions) (watch.Interface, error) {
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&options)
|
||||
}
|
||||
return client.AddonV1alpha1().ClusterManagementAddOns().Watch(ctx, options)
|
||||
},
|
||||
},
|
||||
&apiaddonv1alpha1.ClusterManagementAddOn{},
|
||||
|
||||
@@ -47,13 +47,25 @@ func NewFilteredManagedClusterAddOnInformer(client versioned.Interface, namespac
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&options)
|
||||
}
|
||||
return client.AddonV1alpha1().ManagedClusterAddOns(namespace).List(context.TODO(), options)
|
||||
return client.AddonV1alpha1().ManagedClusterAddOns(namespace).List(context.Background(), options)
|
||||
},
|
||||
WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&options)
|
||||
}
|
||||
return client.AddonV1alpha1().ManagedClusterAddOns(namespace).Watch(context.TODO(), options)
|
||||
return client.AddonV1alpha1().ManagedClusterAddOns(namespace).Watch(context.Background(), options)
|
||||
},
|
||||
ListWithContextFunc: func(ctx context.Context, options v1.ListOptions) (runtime.Object, error) {
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&options)
|
||||
}
|
||||
return client.AddonV1alpha1().ManagedClusterAddOns(namespace).List(ctx, options)
|
||||
},
|
||||
WatchFuncWithContext: func(ctx context.Context, options v1.ListOptions) (watch.Interface, error) {
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&options)
|
||||
}
|
||||
return client.AddonV1alpha1().ManagedClusterAddOns(namespace).Watch(ctx, options)
|
||||
},
|
||||
},
|
||||
&apiaddonv1alpha1.ManagedClusterAddOn{},
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
package fake
|
||||
|
||||
import (
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
"k8s.io/apimachinery/pkg/watch"
|
||||
"k8s.io/client-go/discovery"
|
||||
@@ -40,9 +41,13 @@ func NewSimpleClientset(objects ...runtime.Object) *Clientset {
|
||||
cs.discovery = &fakediscovery.FakeDiscovery{Fake: &cs.Fake}
|
||||
cs.AddReactor("*", "*", testing.ObjectReaction(o))
|
||||
cs.AddWatchReactor("*", func(action testing.Action) (handled bool, ret watch.Interface, err error) {
|
||||
var opts metav1.ListOptions
|
||||
if watchActcion, ok := action.(testing.WatchActionImpl); ok {
|
||||
opts = watchActcion.ListOptions
|
||||
}
|
||||
gvr := action.GetResource()
|
||||
ns := action.GetNamespace()
|
||||
watch, err := o.Watch(gvr, ns)
|
||||
watch, err := o.Watch(gvr, ns, opts)
|
||||
if err != nil {
|
||||
return false, nil, err
|
||||
}
|
||||
|
||||
@@ -30,9 +30,7 @@ func (c *ClusterV1Client) ManagedClusters() ManagedClusterInterface {
|
||||
// where httpClient was generated with rest.HTTPClientFor(c).
|
||||
func NewForConfig(c *rest.Config) (*ClusterV1Client, error) {
|
||||
config := *c
|
||||
if err := setConfigDefaults(&config); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
setConfigDefaults(&config)
|
||||
httpClient, err := rest.HTTPClientFor(&config)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -44,9 +42,7 @@ func NewForConfig(c *rest.Config) (*ClusterV1Client, error) {
|
||||
// Note the http client provided takes precedence over the configured transport values.
|
||||
func NewForConfigAndClient(c *rest.Config, h *http.Client) (*ClusterV1Client, error) {
|
||||
config := *c
|
||||
if err := setConfigDefaults(&config); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
setConfigDefaults(&config)
|
||||
client, err := rest.RESTClientForConfigAndClient(&config, h)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -69,7 +65,7 @@ func New(c rest.Interface) *ClusterV1Client {
|
||||
return &ClusterV1Client{c}
|
||||
}
|
||||
|
||||
func setConfigDefaults(config *rest.Config) error {
|
||||
func setConfigDefaults(config *rest.Config) {
|
||||
gv := clusterv1.SchemeGroupVersion
|
||||
config.GroupVersion = &gv
|
||||
config.APIPath = "/apis"
|
||||
@@ -78,8 +74,6 @@ func setConfigDefaults(config *rest.Config) error {
|
||||
if config.UserAgent == "" {
|
||||
config.UserAgent = rest.DefaultKubernetesUserAgent()
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// RESTClient returns a RESTClient that is used to communicate
|
||||
|
||||
@@ -35,9 +35,7 @@ func (c *ClusterV1alpha1Client) ClusterClaims() ClusterClaimInterface {
|
||||
// where httpClient was generated with rest.HTTPClientFor(c).
|
||||
func NewForConfig(c *rest.Config) (*ClusterV1alpha1Client, error) {
|
||||
config := *c
|
||||
if err := setConfigDefaults(&config); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
setConfigDefaults(&config)
|
||||
httpClient, err := rest.HTTPClientFor(&config)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -49,9 +47,7 @@ func NewForConfig(c *rest.Config) (*ClusterV1alpha1Client, error) {
|
||||
// Note the http client provided takes precedence over the configured transport values.
|
||||
func NewForConfigAndClient(c *rest.Config, h *http.Client) (*ClusterV1alpha1Client, error) {
|
||||
config := *c
|
||||
if err := setConfigDefaults(&config); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
setConfigDefaults(&config)
|
||||
client, err := rest.RESTClientForConfigAndClient(&config, h)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -74,7 +70,7 @@ func New(c rest.Interface) *ClusterV1alpha1Client {
|
||||
return &ClusterV1alpha1Client{c}
|
||||
}
|
||||
|
||||
func setConfigDefaults(config *rest.Config) error {
|
||||
func setConfigDefaults(config *rest.Config) {
|
||||
gv := clusterv1alpha1.SchemeGroupVersion
|
||||
config.GroupVersion = &gv
|
||||
config.APIPath = "/apis"
|
||||
@@ -83,8 +79,6 @@ func setConfigDefaults(config *rest.Config) error {
|
||||
if config.UserAgent == "" {
|
||||
config.UserAgent = rest.DefaultKubernetesUserAgent()
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// RESTClient returns a RESTClient that is used to communicate
|
||||
|
||||
@@ -35,9 +35,7 @@ func (c *ClusterV1beta1Client) PlacementDecisions(namespace string) PlacementDec
|
||||
// where httpClient was generated with rest.HTTPClientFor(c).
|
||||
func NewForConfig(c *rest.Config) (*ClusterV1beta1Client, error) {
|
||||
config := *c
|
||||
if err := setConfigDefaults(&config); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
setConfigDefaults(&config)
|
||||
httpClient, err := rest.HTTPClientFor(&config)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -49,9 +47,7 @@ func NewForConfig(c *rest.Config) (*ClusterV1beta1Client, error) {
|
||||
// Note the http client provided takes precedence over the configured transport values.
|
||||
func NewForConfigAndClient(c *rest.Config, h *http.Client) (*ClusterV1beta1Client, error) {
|
||||
config := *c
|
||||
if err := setConfigDefaults(&config); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
setConfigDefaults(&config)
|
||||
client, err := rest.RESTClientForConfigAndClient(&config, h)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -74,7 +70,7 @@ func New(c rest.Interface) *ClusterV1beta1Client {
|
||||
return &ClusterV1beta1Client{c}
|
||||
}
|
||||
|
||||
func setConfigDefaults(config *rest.Config) error {
|
||||
func setConfigDefaults(config *rest.Config) {
|
||||
gv := clusterv1beta1.SchemeGroupVersion
|
||||
config.GroupVersion = &gv
|
||||
config.APIPath = "/apis"
|
||||
@@ -83,8 +79,6 @@ func setConfigDefaults(config *rest.Config) error {
|
||||
if config.UserAgent == "" {
|
||||
config.UserAgent = rest.DefaultKubernetesUserAgent()
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// RESTClient returns a RESTClient that is used to communicate
|
||||
|
||||
@@ -35,9 +35,7 @@ func (c *ClusterV1beta2Client) ManagedClusterSetBindings(namespace string) Manag
|
||||
// where httpClient was generated with rest.HTTPClientFor(c).
|
||||
func NewForConfig(c *rest.Config) (*ClusterV1beta2Client, error) {
|
||||
config := *c
|
||||
if err := setConfigDefaults(&config); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
setConfigDefaults(&config)
|
||||
httpClient, err := rest.HTTPClientFor(&config)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -49,9 +47,7 @@ func NewForConfig(c *rest.Config) (*ClusterV1beta2Client, error) {
|
||||
// Note the http client provided takes precedence over the configured transport values.
|
||||
func NewForConfigAndClient(c *rest.Config, h *http.Client) (*ClusterV1beta2Client, error) {
|
||||
config := *c
|
||||
if err := setConfigDefaults(&config); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
setConfigDefaults(&config)
|
||||
client, err := rest.RESTClientForConfigAndClient(&config, h)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -74,7 +70,7 @@ func New(c rest.Interface) *ClusterV1beta2Client {
|
||||
return &ClusterV1beta2Client{c}
|
||||
}
|
||||
|
||||
func setConfigDefaults(config *rest.Config) error {
|
||||
func setConfigDefaults(config *rest.Config) {
|
||||
gv := clusterv1beta2.SchemeGroupVersion
|
||||
config.GroupVersion = &gv
|
||||
config.APIPath = "/apis"
|
||||
@@ -83,8 +79,6 @@ func setConfigDefaults(config *rest.Config) error {
|
||||
if config.UserAgent == "" {
|
||||
config.UserAgent = rest.DefaultKubernetesUserAgent()
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// RESTClient returns a RESTClient that is used to communicate
|
||||
|
||||
@@ -46,13 +46,25 @@ func NewFilteredManagedClusterInformer(client versioned.Interface, resyncPeriod
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&options)
|
||||
}
|
||||
return client.ClusterV1().ManagedClusters().List(context.TODO(), options)
|
||||
return client.ClusterV1().ManagedClusters().List(context.Background(), options)
|
||||
},
|
||||
WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) {
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&options)
|
||||
}
|
||||
return client.ClusterV1().ManagedClusters().Watch(context.TODO(), options)
|
||||
return client.ClusterV1().ManagedClusters().Watch(context.Background(), options)
|
||||
},
|
||||
ListWithContextFunc: func(ctx context.Context, options metav1.ListOptions) (runtime.Object, error) {
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&options)
|
||||
}
|
||||
return client.ClusterV1().ManagedClusters().List(ctx, options)
|
||||
},
|
||||
WatchFuncWithContext: func(ctx context.Context, options metav1.ListOptions) (watch.Interface, error) {
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&options)
|
||||
}
|
||||
return client.ClusterV1().ManagedClusters().Watch(ctx, options)
|
||||
},
|
||||
},
|
||||
&apiclusterv1.ManagedCluster{},
|
||||
|
||||
@@ -47,13 +47,25 @@ func NewFilteredAddOnPlacementScoreInformer(client versioned.Interface, namespac
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&options)
|
||||
}
|
||||
return client.ClusterV1alpha1().AddOnPlacementScores(namespace).List(context.TODO(), options)
|
||||
return client.ClusterV1alpha1().AddOnPlacementScores(namespace).List(context.Background(), options)
|
||||
},
|
||||
WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&options)
|
||||
}
|
||||
return client.ClusterV1alpha1().AddOnPlacementScores(namespace).Watch(context.TODO(), options)
|
||||
return client.ClusterV1alpha1().AddOnPlacementScores(namespace).Watch(context.Background(), options)
|
||||
},
|
||||
ListWithContextFunc: func(ctx context.Context, options v1.ListOptions) (runtime.Object, error) {
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&options)
|
||||
}
|
||||
return client.ClusterV1alpha1().AddOnPlacementScores(namespace).List(ctx, options)
|
||||
},
|
||||
WatchFuncWithContext: func(ctx context.Context, options v1.ListOptions) (watch.Interface, error) {
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&options)
|
||||
}
|
||||
return client.ClusterV1alpha1().AddOnPlacementScores(namespace).Watch(ctx, options)
|
||||
},
|
||||
},
|
||||
&apiclusterv1alpha1.AddOnPlacementScore{},
|
||||
|
||||
@@ -46,13 +46,25 @@ func NewFilteredClusterClaimInformer(client versioned.Interface, resyncPeriod ti
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&options)
|
||||
}
|
||||
return client.ClusterV1alpha1().ClusterClaims().List(context.TODO(), options)
|
||||
return client.ClusterV1alpha1().ClusterClaims().List(context.Background(), options)
|
||||
},
|
||||
WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&options)
|
||||
}
|
||||
return client.ClusterV1alpha1().ClusterClaims().Watch(context.TODO(), options)
|
||||
return client.ClusterV1alpha1().ClusterClaims().Watch(context.Background(), options)
|
||||
},
|
||||
ListWithContextFunc: func(ctx context.Context, options v1.ListOptions) (runtime.Object, error) {
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&options)
|
||||
}
|
||||
return client.ClusterV1alpha1().ClusterClaims().List(ctx, options)
|
||||
},
|
||||
WatchFuncWithContext: func(ctx context.Context, options v1.ListOptions) (watch.Interface, error) {
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&options)
|
||||
}
|
||||
return client.ClusterV1alpha1().ClusterClaims().Watch(ctx, options)
|
||||
},
|
||||
},
|
||||
&apiclusterv1alpha1.ClusterClaim{},
|
||||
|
||||
@@ -47,13 +47,25 @@ func NewFilteredPlacementInformer(client versioned.Interface, namespace string,
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&options)
|
||||
}
|
||||
return client.ClusterV1beta1().Placements(namespace).List(context.TODO(), options)
|
||||
return client.ClusterV1beta1().Placements(namespace).List(context.Background(), options)
|
||||
},
|
||||
WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&options)
|
||||
}
|
||||
return client.ClusterV1beta1().Placements(namespace).Watch(context.TODO(), options)
|
||||
return client.ClusterV1beta1().Placements(namespace).Watch(context.Background(), options)
|
||||
},
|
||||
ListWithContextFunc: func(ctx context.Context, options v1.ListOptions) (runtime.Object, error) {
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&options)
|
||||
}
|
||||
return client.ClusterV1beta1().Placements(namespace).List(ctx, options)
|
||||
},
|
||||
WatchFuncWithContext: func(ctx context.Context, options v1.ListOptions) (watch.Interface, error) {
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&options)
|
||||
}
|
||||
return client.ClusterV1beta1().Placements(namespace).Watch(ctx, options)
|
||||
},
|
||||
},
|
||||
&apiclusterv1beta1.Placement{},
|
||||
|
||||
@@ -47,13 +47,25 @@ func NewFilteredPlacementDecisionInformer(client versioned.Interface, namespace
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&options)
|
||||
}
|
||||
return client.ClusterV1beta1().PlacementDecisions(namespace).List(context.TODO(), options)
|
||||
return client.ClusterV1beta1().PlacementDecisions(namespace).List(context.Background(), options)
|
||||
},
|
||||
WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&options)
|
||||
}
|
||||
return client.ClusterV1beta1().PlacementDecisions(namespace).Watch(context.TODO(), options)
|
||||
return client.ClusterV1beta1().PlacementDecisions(namespace).Watch(context.Background(), options)
|
||||
},
|
||||
ListWithContextFunc: func(ctx context.Context, options v1.ListOptions) (runtime.Object, error) {
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&options)
|
||||
}
|
||||
return client.ClusterV1beta1().PlacementDecisions(namespace).List(ctx, options)
|
||||
},
|
||||
WatchFuncWithContext: func(ctx context.Context, options v1.ListOptions) (watch.Interface, error) {
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&options)
|
||||
}
|
||||
return client.ClusterV1beta1().PlacementDecisions(namespace).Watch(ctx, options)
|
||||
},
|
||||
},
|
||||
&apiclusterv1beta1.PlacementDecision{},
|
||||
|
||||
@@ -46,13 +46,25 @@ func NewFilteredManagedClusterSetInformer(client versioned.Interface, resyncPeri
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&options)
|
||||
}
|
||||
return client.ClusterV1beta2().ManagedClusterSets().List(context.TODO(), options)
|
||||
return client.ClusterV1beta2().ManagedClusterSets().List(context.Background(), options)
|
||||
},
|
||||
WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&options)
|
||||
}
|
||||
return client.ClusterV1beta2().ManagedClusterSets().Watch(context.TODO(), options)
|
||||
return client.ClusterV1beta2().ManagedClusterSets().Watch(context.Background(), options)
|
||||
},
|
||||
ListWithContextFunc: func(ctx context.Context, options v1.ListOptions) (runtime.Object, error) {
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&options)
|
||||
}
|
||||
return client.ClusterV1beta2().ManagedClusterSets().List(ctx, options)
|
||||
},
|
||||
WatchFuncWithContext: func(ctx context.Context, options v1.ListOptions) (watch.Interface, error) {
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&options)
|
||||
}
|
||||
return client.ClusterV1beta2().ManagedClusterSets().Watch(ctx, options)
|
||||
},
|
||||
},
|
||||
&apiclusterv1beta2.ManagedClusterSet{},
|
||||
|
||||
@@ -47,13 +47,25 @@ func NewFilteredManagedClusterSetBindingInformer(client versioned.Interface, nam
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&options)
|
||||
}
|
||||
return client.ClusterV1beta2().ManagedClusterSetBindings(namespace).List(context.TODO(), options)
|
||||
return client.ClusterV1beta2().ManagedClusterSetBindings(namespace).List(context.Background(), options)
|
||||
},
|
||||
WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&options)
|
||||
}
|
||||
return client.ClusterV1beta2().ManagedClusterSetBindings(namespace).Watch(context.TODO(), options)
|
||||
return client.ClusterV1beta2().ManagedClusterSetBindings(namespace).Watch(context.Background(), options)
|
||||
},
|
||||
ListWithContextFunc: func(ctx context.Context, options v1.ListOptions) (runtime.Object, error) {
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&options)
|
||||
}
|
||||
return client.ClusterV1beta2().ManagedClusterSetBindings(namespace).List(ctx, options)
|
||||
},
|
||||
WatchFuncWithContext: func(ctx context.Context, options v1.ListOptions) (watch.Interface, error) {
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&options)
|
||||
}
|
||||
return client.ClusterV1beta2().ManagedClusterSetBindings(namespace).Watch(ctx, options)
|
||||
},
|
||||
},
|
||||
&apiclusterv1beta2.ManagedClusterSetBinding{},
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
package fake
|
||||
|
||||
import (
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
"k8s.io/apimachinery/pkg/watch"
|
||||
"k8s.io/client-go/discovery"
|
||||
@@ -34,9 +35,13 @@ func NewSimpleClientset(objects ...runtime.Object) *Clientset {
|
||||
cs.discovery = &fakediscovery.FakeDiscovery{Fake: &cs.Fake}
|
||||
cs.AddReactor("*", "*", testing.ObjectReaction(o))
|
||||
cs.AddWatchReactor("*", func(action testing.Action) (handled bool, ret watch.Interface, err error) {
|
||||
var opts metav1.ListOptions
|
||||
if watchActcion, ok := action.(testing.WatchActionImpl); ok {
|
||||
opts = watchActcion.ListOptions
|
||||
}
|
||||
gvr := action.GetResource()
|
||||
ns := action.GetNamespace()
|
||||
watch, err := o.Watch(gvr, ns)
|
||||
watch, err := o.Watch(gvr, ns, opts)
|
||||
if err != nil {
|
||||
return false, nil, err
|
||||
}
|
||||
|
||||
@@ -35,9 +35,7 @@ func (c *OperatorV1Client) Klusterlets() KlusterletInterface {
|
||||
// where httpClient was generated with rest.HTTPClientFor(c).
|
||||
func NewForConfig(c *rest.Config) (*OperatorV1Client, error) {
|
||||
config := *c
|
||||
if err := setConfigDefaults(&config); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
setConfigDefaults(&config)
|
||||
httpClient, err := rest.HTTPClientFor(&config)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -49,9 +47,7 @@ func NewForConfig(c *rest.Config) (*OperatorV1Client, error) {
|
||||
// Note the http client provided takes precedence over the configured transport values.
|
||||
func NewForConfigAndClient(c *rest.Config, h *http.Client) (*OperatorV1Client, error) {
|
||||
config := *c
|
||||
if err := setConfigDefaults(&config); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
setConfigDefaults(&config)
|
||||
client, err := rest.RESTClientForConfigAndClient(&config, h)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -74,7 +70,7 @@ func New(c rest.Interface) *OperatorV1Client {
|
||||
return &OperatorV1Client{c}
|
||||
}
|
||||
|
||||
func setConfigDefaults(config *rest.Config) error {
|
||||
func setConfigDefaults(config *rest.Config) {
|
||||
gv := operatorv1.SchemeGroupVersion
|
||||
config.GroupVersion = &gv
|
||||
config.APIPath = "/apis"
|
||||
@@ -83,8 +79,6 @@ func setConfigDefaults(config *rest.Config) error {
|
||||
if config.UserAgent == "" {
|
||||
config.UserAgent = rest.DefaultKubernetesUserAgent()
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// RESTClient returns a RESTClient that is used to communicate
|
||||
|
||||
@@ -46,13 +46,25 @@ func NewFilteredClusterManagerInformer(client versioned.Interface, resyncPeriod
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&options)
|
||||
}
|
||||
return client.OperatorV1().ClusterManagers().List(context.TODO(), options)
|
||||
return client.OperatorV1().ClusterManagers().List(context.Background(), options)
|
||||
},
|
||||
WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) {
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&options)
|
||||
}
|
||||
return client.OperatorV1().ClusterManagers().Watch(context.TODO(), options)
|
||||
return client.OperatorV1().ClusterManagers().Watch(context.Background(), options)
|
||||
},
|
||||
ListWithContextFunc: func(ctx context.Context, options metav1.ListOptions) (runtime.Object, error) {
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&options)
|
||||
}
|
||||
return client.OperatorV1().ClusterManagers().List(ctx, options)
|
||||
},
|
||||
WatchFuncWithContext: func(ctx context.Context, options metav1.ListOptions) (watch.Interface, error) {
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&options)
|
||||
}
|
||||
return client.OperatorV1().ClusterManagers().Watch(ctx, options)
|
||||
},
|
||||
},
|
||||
&apioperatorv1.ClusterManager{},
|
||||
|
||||
@@ -46,13 +46,25 @@ func NewFilteredKlusterletInformer(client versioned.Interface, resyncPeriod time
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&options)
|
||||
}
|
||||
return client.OperatorV1().Klusterlets().List(context.TODO(), options)
|
||||
return client.OperatorV1().Klusterlets().List(context.Background(), options)
|
||||
},
|
||||
WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) {
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&options)
|
||||
}
|
||||
return client.OperatorV1().Klusterlets().Watch(context.TODO(), options)
|
||||
return client.OperatorV1().Klusterlets().Watch(context.Background(), options)
|
||||
},
|
||||
ListWithContextFunc: func(ctx context.Context, options metav1.ListOptions) (runtime.Object, error) {
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&options)
|
||||
}
|
||||
return client.OperatorV1().Klusterlets().List(ctx, options)
|
||||
},
|
||||
WatchFuncWithContext: func(ctx context.Context, options metav1.ListOptions) (watch.Interface, error) {
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&options)
|
||||
}
|
||||
return client.OperatorV1().Klusterlets().Watch(ctx, options)
|
||||
},
|
||||
},
|
||||
&apioperatorv1.Klusterlet{},
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
package fake
|
||||
|
||||
import (
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
"k8s.io/apimachinery/pkg/watch"
|
||||
"k8s.io/client-go/discovery"
|
||||
@@ -36,9 +37,13 @@ func NewSimpleClientset(objects ...runtime.Object) *Clientset {
|
||||
cs.discovery = &fakediscovery.FakeDiscovery{Fake: &cs.Fake}
|
||||
cs.AddReactor("*", "*", testing.ObjectReaction(o))
|
||||
cs.AddWatchReactor("*", func(action testing.Action) (handled bool, ret watch.Interface, err error) {
|
||||
var opts metav1.ListOptions
|
||||
if watchActcion, ok := action.(testing.WatchActionImpl); ok {
|
||||
opts = watchActcion.ListOptions
|
||||
}
|
||||
gvr := action.GetResource()
|
||||
ns := action.GetNamespace()
|
||||
watch, err := o.Watch(gvr, ns)
|
||||
watch, err := o.Watch(gvr, ns, opts)
|
||||
if err != nil {
|
||||
return false, nil, err
|
||||
}
|
||||
|
||||
@@ -35,9 +35,7 @@ func (c *WorkV1Client) ManifestWorks(namespace string) ManifestWorkInterface {
|
||||
// where httpClient was generated with rest.HTTPClientFor(c).
|
||||
func NewForConfig(c *rest.Config) (*WorkV1Client, error) {
|
||||
config := *c
|
||||
if err := setConfigDefaults(&config); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
setConfigDefaults(&config)
|
||||
httpClient, err := rest.HTTPClientFor(&config)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -49,9 +47,7 @@ func NewForConfig(c *rest.Config) (*WorkV1Client, error) {
|
||||
// Note the http client provided takes precedence over the configured transport values.
|
||||
func NewForConfigAndClient(c *rest.Config, h *http.Client) (*WorkV1Client, error) {
|
||||
config := *c
|
||||
if err := setConfigDefaults(&config); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
setConfigDefaults(&config)
|
||||
client, err := rest.RESTClientForConfigAndClient(&config, h)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -74,7 +70,7 @@ func New(c rest.Interface) *WorkV1Client {
|
||||
return &WorkV1Client{c}
|
||||
}
|
||||
|
||||
func setConfigDefaults(config *rest.Config) error {
|
||||
func setConfigDefaults(config *rest.Config) {
|
||||
gv := workv1.SchemeGroupVersion
|
||||
config.GroupVersion = &gv
|
||||
config.APIPath = "/apis"
|
||||
@@ -83,8 +79,6 @@ func setConfigDefaults(config *rest.Config) error {
|
||||
if config.UserAgent == "" {
|
||||
config.UserAgent = rest.DefaultKubernetesUserAgent()
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// RESTClient returns a RESTClient that is used to communicate
|
||||
|
||||
@@ -30,9 +30,7 @@ func (c *WorkV1alpha1Client) ManifestWorkReplicaSets(namespace string) ManifestW
|
||||
// where httpClient was generated with rest.HTTPClientFor(c).
|
||||
func NewForConfig(c *rest.Config) (*WorkV1alpha1Client, error) {
|
||||
config := *c
|
||||
if err := setConfigDefaults(&config); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
setConfigDefaults(&config)
|
||||
httpClient, err := rest.HTTPClientFor(&config)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -44,9 +42,7 @@ func NewForConfig(c *rest.Config) (*WorkV1alpha1Client, error) {
|
||||
// Note the http client provided takes precedence over the configured transport values.
|
||||
func NewForConfigAndClient(c *rest.Config, h *http.Client) (*WorkV1alpha1Client, error) {
|
||||
config := *c
|
||||
if err := setConfigDefaults(&config); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
setConfigDefaults(&config)
|
||||
client, err := rest.RESTClientForConfigAndClient(&config, h)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -69,7 +65,7 @@ func New(c rest.Interface) *WorkV1alpha1Client {
|
||||
return &WorkV1alpha1Client{c}
|
||||
}
|
||||
|
||||
func setConfigDefaults(config *rest.Config) error {
|
||||
func setConfigDefaults(config *rest.Config) {
|
||||
gv := workv1alpha1.SchemeGroupVersion
|
||||
config.GroupVersion = &gv
|
||||
config.APIPath = "/apis"
|
||||
@@ -78,8 +74,6 @@ func setConfigDefaults(config *rest.Config) error {
|
||||
if config.UserAgent == "" {
|
||||
config.UserAgent = rest.DefaultKubernetesUserAgent()
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// RESTClient returns a RESTClient that is used to communicate
|
||||
|
||||
@@ -46,13 +46,25 @@ func NewFilteredAppliedManifestWorkInformer(client versioned.Interface, resyncPe
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&options)
|
||||
}
|
||||
return client.WorkV1().AppliedManifestWorks().List(context.TODO(), options)
|
||||
return client.WorkV1().AppliedManifestWorks().List(context.Background(), options)
|
||||
},
|
||||
WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) {
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&options)
|
||||
}
|
||||
return client.WorkV1().AppliedManifestWorks().Watch(context.TODO(), options)
|
||||
return client.WorkV1().AppliedManifestWorks().Watch(context.Background(), options)
|
||||
},
|
||||
ListWithContextFunc: func(ctx context.Context, options metav1.ListOptions) (runtime.Object, error) {
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&options)
|
||||
}
|
||||
return client.WorkV1().AppliedManifestWorks().List(ctx, options)
|
||||
},
|
||||
WatchFuncWithContext: func(ctx context.Context, options metav1.ListOptions) (watch.Interface, error) {
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&options)
|
||||
}
|
||||
return client.WorkV1().AppliedManifestWorks().Watch(ctx, options)
|
||||
},
|
||||
},
|
||||
&apiworkv1.AppliedManifestWork{},
|
||||
|
||||
@@ -47,13 +47,25 @@ func NewFilteredManifestWorkInformer(client versioned.Interface, namespace strin
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&options)
|
||||
}
|
||||
return client.WorkV1().ManifestWorks(namespace).List(context.TODO(), options)
|
||||
return client.WorkV1().ManifestWorks(namespace).List(context.Background(), options)
|
||||
},
|
||||
WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) {
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&options)
|
||||
}
|
||||
return client.WorkV1().ManifestWorks(namespace).Watch(context.TODO(), options)
|
||||
return client.WorkV1().ManifestWorks(namespace).Watch(context.Background(), options)
|
||||
},
|
||||
ListWithContextFunc: func(ctx context.Context, options metav1.ListOptions) (runtime.Object, error) {
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&options)
|
||||
}
|
||||
return client.WorkV1().ManifestWorks(namespace).List(ctx, options)
|
||||
},
|
||||
WatchFuncWithContext: func(ctx context.Context, options metav1.ListOptions) (watch.Interface, error) {
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&options)
|
||||
}
|
||||
return client.WorkV1().ManifestWorks(namespace).Watch(ctx, options)
|
||||
},
|
||||
},
|
||||
&apiworkv1.ManifestWork{},
|
||||
|
||||
@@ -47,13 +47,25 @@ func NewFilteredManifestWorkReplicaSetInformer(client versioned.Interface, names
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&options)
|
||||
}
|
||||
return client.WorkV1alpha1().ManifestWorkReplicaSets(namespace).List(context.TODO(), options)
|
||||
return client.WorkV1alpha1().ManifestWorkReplicaSets(namespace).List(context.Background(), options)
|
||||
},
|
||||
WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&options)
|
||||
}
|
||||
return client.WorkV1alpha1().ManifestWorkReplicaSets(namespace).Watch(context.TODO(), options)
|
||||
return client.WorkV1alpha1().ManifestWorkReplicaSets(namespace).Watch(context.Background(), options)
|
||||
},
|
||||
ListWithContextFunc: func(ctx context.Context, options v1.ListOptions) (runtime.Object, error) {
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&options)
|
||||
}
|
||||
return client.WorkV1alpha1().ManifestWorkReplicaSets(namespace).List(ctx, options)
|
||||
},
|
||||
WatchFuncWithContext: func(ctx context.Context, options v1.ListOptions) (watch.Interface, error) {
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&options)
|
||||
}
|
||||
return client.WorkV1alpha1().ManifestWorkReplicaSets(namespace).Watch(ctx, options)
|
||||
},
|
||||
},
|
||||
&apiworkv1alpha1.ManifestWorkReplicaSet{},
|
||||
|
||||
@@ -272,6 +272,12 @@ spec:
|
||||
required:
|
||||
- maxCustomClusterClaims
|
||||
type: object
|
||||
clusterLabels:
|
||||
additionalProperties:
|
||||
type: string
|
||||
description: ClusterLabels is labels set on ManagedCluster when
|
||||
creating only, other actors can update it afterwards.
|
||||
type: object
|
||||
featureGates:
|
||||
description: "FeatureGates represents the list of feature gates
|
||||
for registration\nIf it is set empty, default feature gates
|
||||
|
||||
@@ -91,6 +91,89 @@ spec:
|
||||
DeployOption contains the options of deploying a cluster-manager
|
||||
Default mode is used if DeployOption is not set.
|
||||
properties:
|
||||
default:
|
||||
description: Default includes optional configurations for clustermanager
|
||||
in the Default mode.
|
||||
properties:
|
||||
registrationWebhookConfiguration:
|
||||
description: RegistrationWebhookConfiguration represents the
|
||||
customized webhook-server configuration of registration.
|
||||
properties:
|
||||
bindConfiguration:
|
||||
description: BindConfiguration represents server bind
|
||||
configuration for the webhook server
|
||||
properties:
|
||||
healthProbePort:
|
||||
default: 8000
|
||||
description: |-
|
||||
HealthProbePort represents the bind port of a webhook-server's healthcheck endpoint. The default value is 8000.
|
||||
Healthchecks may be disabled by setting a value less than or equal to 0.
|
||||
format: int32
|
||||
maximum: 65535
|
||||
type: integer
|
||||
hostNetwork:
|
||||
description: |-
|
||||
HostNetwork enables running webhook pods in host networking mode.
|
||||
This may be required in some installations, such as EKS with Calico CNI,
|
||||
to allow the API Server to communicate with the webhook pods.
|
||||
type: boolean
|
||||
metricsPort:
|
||||
default: 8080
|
||||
description: |-
|
||||
MetricsPort represents the bind port for a webhook-server's metric endpoint. The default value is 8080.
|
||||
Metrics may be disabled by setting a value less than or equal to 0.
|
||||
format: int32
|
||||
maximum: 65535
|
||||
type: integer
|
||||
port:
|
||||
default: 9443
|
||||
description: Port represents the primary bind port
|
||||
of a server. The default value is 9443.
|
||||
format: int32
|
||||
maximum: 65535
|
||||
type: integer
|
||||
type: object
|
||||
type: object
|
||||
workWebhookConfiguration:
|
||||
description: WorkWebhookConfiguration represents the customized
|
||||
webhook-server configuration of work.
|
||||
properties:
|
||||
bindConfiguration:
|
||||
description: BindConfiguration represents server bind
|
||||
configuration for the webhook server
|
||||
properties:
|
||||
healthProbePort:
|
||||
default: 8000
|
||||
description: |-
|
||||
HealthProbePort represents the bind port of a webhook-server's healthcheck endpoint. The default value is 8000.
|
||||
Healthchecks may be disabled by setting a value less than or equal to 0.
|
||||
format: int32
|
||||
maximum: 65535
|
||||
type: integer
|
||||
hostNetwork:
|
||||
description: |-
|
||||
HostNetwork enables running webhook pods in host networking mode.
|
||||
This may be required in some installations, such as EKS with Calico CNI,
|
||||
to allow the API Server to communicate with the webhook pods.
|
||||
type: boolean
|
||||
metricsPort:
|
||||
default: 8080
|
||||
description: |-
|
||||
MetricsPort represents the bind port for a webhook-server's metric endpoint. The default value is 8080.
|
||||
Metrics may be disabled by setting a value less than or equal to 0.
|
||||
format: int32
|
||||
maximum: 65535
|
||||
type: integer
|
||||
port:
|
||||
default: 9443
|
||||
description: Port represents the primary bind port
|
||||
of a server. The default value is 9443.
|
||||
format: int32
|
||||
maximum: 65535
|
||||
type: integer
|
||||
type: object
|
||||
type: object
|
||||
type: object
|
||||
hosted:
|
||||
description: Hosted includes configurations we need for clustermanager
|
||||
in the Hosted mode.
|
||||
@@ -106,9 +189,43 @@ spec:
|
||||
The Address must be reachable by apiserver of the hub cluster.
|
||||
pattern: ^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]*[a-zA-Z0-9])\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9\-]*[A-Za-z0-9])$
|
||||
type: string
|
||||
bindConfiguration:
|
||||
description: BindConfiguration represents server bind
|
||||
configuration for the webhook server
|
||||
properties:
|
||||
healthProbePort:
|
||||
default: 8000
|
||||
description: |-
|
||||
HealthProbePort represents the bind port of a webhook-server's healthcheck endpoint. The default value is 8000.
|
||||
Healthchecks may be disabled by setting a value less than or equal to 0.
|
||||
format: int32
|
||||
maximum: 65535
|
||||
type: integer
|
||||
hostNetwork:
|
||||
description: |-
|
||||
HostNetwork enables running webhook pods in host networking mode.
|
||||
This may be required in some installations, such as EKS with Calico CNI,
|
||||
to allow the API Server to communicate with the webhook pods.
|
||||
type: boolean
|
||||
metricsPort:
|
||||
default: 8080
|
||||
description: |-
|
||||
MetricsPort represents the bind port for a webhook-server's metric endpoint. The default value is 8080.
|
||||
Metrics may be disabled by setting a value less than or equal to 0.
|
||||
format: int32
|
||||
maximum: 65535
|
||||
type: integer
|
||||
port:
|
||||
default: 9443
|
||||
description: Port represents the primary bind port
|
||||
of a server. The default value is 9443.
|
||||
format: int32
|
||||
maximum: 65535
|
||||
type: integer
|
||||
type: object
|
||||
port:
|
||||
default: 443
|
||||
description: Port represents the port of a webhook-server.
|
||||
description: Port represents the external port of a webhook-server.
|
||||
The default value of Port is 443.
|
||||
format: int32
|
||||
maximum: 65535
|
||||
@@ -127,9 +244,43 @@ spec:
|
||||
The Address must be reachable by apiserver of the hub cluster.
|
||||
pattern: ^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]*[a-zA-Z0-9])\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9\-]*[A-Za-z0-9])$
|
||||
type: string
|
||||
bindConfiguration:
|
||||
description: BindConfiguration represents server bind
|
||||
configuration for the webhook server
|
||||
properties:
|
||||
healthProbePort:
|
||||
default: 8000
|
||||
description: |-
|
||||
HealthProbePort represents the bind port of a webhook-server's healthcheck endpoint. The default value is 8000.
|
||||
Healthchecks may be disabled by setting a value less than or equal to 0.
|
||||
format: int32
|
||||
maximum: 65535
|
||||
type: integer
|
||||
hostNetwork:
|
||||
description: |-
|
||||
HostNetwork enables running webhook pods in host networking mode.
|
||||
This may be required in some installations, such as EKS with Calico CNI,
|
||||
to allow the API Server to communicate with the webhook pods.
|
||||
type: boolean
|
||||
metricsPort:
|
||||
default: 8080
|
||||
description: |-
|
||||
MetricsPort represents the bind port for a webhook-server's metric endpoint. The default value is 8080.
|
||||
Metrics may be disabled by setting a value less than or equal to 0.
|
||||
format: int32
|
||||
maximum: 65535
|
||||
type: integer
|
||||
port:
|
||||
default: 9443
|
||||
description: Port represents the primary bind port
|
||||
of a server. The default value is 9443.
|
||||
format: int32
|
||||
maximum: 65535
|
||||
type: integer
|
||||
type: object
|
||||
port:
|
||||
default: 443
|
||||
description: Port represents the port of a webhook-server.
|
||||
description: Port represents the external port of a webhook-server.
|
||||
The default value of Port is 443.
|
||||
format: int32
|
||||
maximum: 65535
|
||||
|
||||
82
vendor/open-cluster-management.io/api/operator/v1/types_clustermanager.go
generated
vendored
82
vendor/open-cluster-management.io/api/operator/v1/types_clustermanager.go
generated
vendored
@@ -118,6 +118,25 @@ type RegistrationHubConfiguration struct {
|
||||
RegistrationDrivers []RegistrationDriverHub `json:"registrationDrivers,omitempty"`
|
||||
}
|
||||
|
||||
const (
|
||||
// AwsIrsaAuthType represents the authentication type that uses AWS IRSA
|
||||
AwsIrsaAuthType = "awsirsa"
|
||||
// CSRAuthType represents the authentication type that uses Kubernetes CSR
|
||||
CSRAuthType = "csr"
|
||||
// GRPCAuthType represents the authentication type that uses gRPC.
|
||||
GRPCAuthType = "grpc"
|
||||
)
|
||||
|
||||
// GRPCAuthSigner is the signer name used when creating CSRs for gRPC authentication.
|
||||
const GRPCAuthSigner = "open-cluster-management.io/grpc"
|
||||
|
||||
const (
|
||||
// CSRUsernameAnnotation is added to a CSR to identify the user who requested the CSR.
|
||||
// This should only be honored when registration driver is grpc and the csr user name
|
||||
// is service account of grpc server.
|
||||
CSRUsernameAnnotation = "open-cluster-management.io/csr-user"
|
||||
)
|
||||
|
||||
type RegistrationDriverHub struct {
|
||||
|
||||
// Type of the authentication used by hub to initialize the Hub cluster. Possible values are csr and awsirsa.
|
||||
@@ -281,19 +300,65 @@ const (
|
||||
FeatureGateModeTypeDisable FeatureGateModeType = "Disable"
|
||||
)
|
||||
|
||||
// DefaultClusterManagerConfiguration represents customized configurations for clustermanager in the Default mode.
|
||||
type DefaultClusterManagerConfiguration struct {
|
||||
// RegistrationWebhookConfiguration represents the customized webhook-server configuration of registration.
|
||||
// +optional
|
||||
RegistrationWebhookConfiguration DefaultWebhookConfiguration `json:"registrationWebhookConfiguration,omitempty"`
|
||||
|
||||
// WorkWebhookConfiguration represents the customized webhook-server configuration of work.
|
||||
// +optional
|
||||
WorkWebhookConfiguration DefaultWebhookConfiguration `json:"workWebhookConfiguration,omitempty"`
|
||||
}
|
||||
|
||||
// HostedClusterManagerConfiguration represents customized configurations we need to set for clustermanager in the Hosted mode.
|
||||
type HostedClusterManagerConfiguration struct {
|
||||
// RegistrationWebhookConfiguration represents the customized webhook-server configuration of registration.
|
||||
// +optional
|
||||
RegistrationWebhookConfiguration WebhookConfiguration `json:"registrationWebhookConfiguration,omitempty"`
|
||||
RegistrationWebhookConfiguration HostedWebhookConfiguration `json:"registrationWebhookConfiguration,omitempty"`
|
||||
|
||||
// WorkWebhookConfiguration represents the customized webhook-server configuration of work.
|
||||
// +optional
|
||||
WorkWebhookConfiguration WebhookConfiguration `json:"workWebhookConfiguration,omitempty"`
|
||||
WorkWebhookConfiguration HostedWebhookConfiguration `json:"workWebhookConfiguration,omitempty"`
|
||||
}
|
||||
|
||||
// WebhookConfiguration has two properties: Address and Port.
|
||||
type WebhookConfiguration struct {
|
||||
// BindConfiguration represents customization of server bindings
|
||||
type BindConfiguration struct {
|
||||
// Port represents the primary bind port of a server. The default value is 9443.
|
||||
// +optional
|
||||
// +kubebuilder:default=9443
|
||||
// +kubebuilder:validation:Maximum=65535
|
||||
Port int32 `json:"port,omitempty"`
|
||||
|
||||
// HealthProbePort represents the bind port of a webhook-server's healthcheck endpoint. The default value is 8000.
|
||||
// Healthchecks may be disabled by setting a value less than or equal to 0.
|
||||
// +optional
|
||||
// +kubebuilder:default=8000
|
||||
// +kubebuilder:validation:Maximum=65535
|
||||
HealthProbePort int32 `json:"healthProbePort"`
|
||||
|
||||
// MetricsPort represents the bind port for a webhook-server's metric endpoint. The default value is 8080.
|
||||
// Metrics may be disabled by setting a value less than or equal to 0.
|
||||
// +optional
|
||||
// +kubebuilder:default=8080
|
||||
// +kubebuilder:validation:Maximum=65535
|
||||
MetricsPort int32 `json:"metricsPort"`
|
||||
|
||||
// HostNetwork enables running webhook pods in host networking mode.
|
||||
// This may be required in some installations, such as EKS with Calico CNI,
|
||||
// to allow the API Server to communicate with the webhook pods.
|
||||
// +optional
|
||||
HostNetwork bool `json:"hostNetwork,omitempty"`
|
||||
}
|
||||
|
||||
// DefaultWebhookConfiguration represents customization of webhook servers running in default installation mode
|
||||
type DefaultWebhookConfiguration struct {
|
||||
// BindConfiguration represents server bind configuration for the webhook server
|
||||
BindConfiguration *BindConfiguration `json:"bindConfiguration,omitempty"`
|
||||
}
|
||||
|
||||
// HostedWebhookConfiguration represents customization of webhook servers running in hosted installation mode
|
||||
type HostedWebhookConfiguration struct {
|
||||
// Address represents the address of a webhook-server.
|
||||
// It could be in IP format or fqdn format.
|
||||
// The Address must be reachable by apiserver of the hub cluster.
|
||||
@@ -302,11 +367,14 @@ type WebhookConfiguration struct {
|
||||
// +kubebuilder:validation:Pattern=^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]*[a-zA-Z0-9])\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9\-]*[A-Za-z0-9])$
|
||||
Address string `json:"address"`
|
||||
|
||||
// Port represents the port of a webhook-server. The default value of Port is 443.
|
||||
// Port represents the external port of a webhook-server. The default value of Port is 443.
|
||||
// +optional
|
||||
// +kubebuilder:default=443
|
||||
// +kubebuilder:validation:Maximum=65535
|
||||
Port int32 `json:"port,omitempty"`
|
||||
|
||||
// BindConfiguration represents server bind configuration for the webhook server
|
||||
BindConfiguration *BindConfiguration `json:"bindConfiguration,omitempty"`
|
||||
}
|
||||
|
||||
// ClusterManagerDeployOption describes the deployment options for cluster-manager
|
||||
@@ -323,6 +391,10 @@ type ClusterManagerDeployOption struct {
|
||||
// +kubebuilder:validation:Enum=Default;Hosted
|
||||
Mode InstallMode `json:"mode,omitempty"`
|
||||
|
||||
// Default includes optional configurations for clustermanager in the Default mode.
|
||||
// +optional
|
||||
Default *DefaultClusterManagerConfiguration `json:"default,omitempty"`
|
||||
|
||||
// Hosted includes configurations we need for clustermanager in the Hosted mode.
|
||||
// +optional
|
||||
Hosted *HostedClusterManagerConfiguration `json:"hosted,omitempty"`
|
||||
|
||||
4
vendor/open-cluster-management.io/api/operator/v1/types_klusterlet.go
generated
vendored
4
vendor/open-cluster-management.io/api/operator/v1/types_klusterlet.go
generated
vendored
@@ -152,6 +152,10 @@ type RegistrationConfiguration struct {
|
||||
// +optional
|
||||
ClusterAnnotations map[string]string `json:"clusterAnnotations,omitempty"`
|
||||
|
||||
// ClusterLabels is labels set on ManagedCluster when creating only, other actors can update it afterwards.
|
||||
// +optional
|
||||
ClusterLabels map[string]string `json:"clusterLabels,omitempty"`
|
||||
|
||||
// KubeAPIQPS indicates the maximum QPS while talking with apiserver on the spoke cluster.
|
||||
// If it is set empty, use the default value: 50
|
||||
// +optional
|
||||
|
||||
110
vendor/open-cluster-management.io/api/operator/v1/zz_generated.deepcopy.go
generated
vendored
110
vendor/open-cluster-management.io/api/operator/v1/zz_generated.deepcopy.go
generated
vendored
@@ -75,6 +75,22 @@ func (in *AwsIrsaConfig) DeepCopy() *AwsIrsaConfig {
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *BindConfiguration) DeepCopyInto(out *BindConfiguration) {
|
||||
*out = *in
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BindConfiguration.
|
||||
func (in *BindConfiguration) DeepCopy() *BindConfiguration {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(BindConfiguration)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *BootstrapKubeConfigs) DeepCopyInto(out *BootstrapKubeConfigs) {
|
||||
*out = *in
|
||||
@@ -169,10 +185,15 @@ func (in *ClusterManager) DeepCopyObject() runtime.Object {
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *ClusterManagerDeployOption) DeepCopyInto(out *ClusterManagerDeployOption) {
|
||||
*out = *in
|
||||
if in.Default != nil {
|
||||
in, out := &in.Default, &out.Default
|
||||
*out = new(DefaultClusterManagerConfiguration)
|
||||
(*in).DeepCopyInto(*out)
|
||||
}
|
||||
if in.Hosted != nil {
|
||||
in, out := &in.Hosted, &out.Hosted
|
||||
*out = new(HostedClusterManagerConfiguration)
|
||||
**out = **in
|
||||
(*in).DeepCopyInto(*out)
|
||||
}
|
||||
return
|
||||
}
|
||||
@@ -291,6 +312,45 @@ func (in *ClusterManagerStatus) DeepCopy() *ClusterManagerStatus {
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *DefaultClusterManagerConfiguration) DeepCopyInto(out *DefaultClusterManagerConfiguration) {
|
||||
*out = *in
|
||||
in.RegistrationWebhookConfiguration.DeepCopyInto(&out.RegistrationWebhookConfiguration)
|
||||
in.WorkWebhookConfiguration.DeepCopyInto(&out.WorkWebhookConfiguration)
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DefaultClusterManagerConfiguration.
|
||||
func (in *DefaultClusterManagerConfiguration) DeepCopy() *DefaultClusterManagerConfiguration {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(DefaultClusterManagerConfiguration)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *DefaultWebhookConfiguration) DeepCopyInto(out *DefaultWebhookConfiguration) {
|
||||
*out = *in
|
||||
if in.BindConfiguration != nil {
|
||||
in, out := &in.BindConfiguration, &out.BindConfiguration
|
||||
*out = new(BindConfiguration)
|
||||
**out = **in
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DefaultWebhookConfiguration.
|
||||
func (in *DefaultWebhookConfiguration) DeepCopy() *DefaultWebhookConfiguration {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(DefaultWebhookConfiguration)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *FeatureGate) DeepCopyInto(out *FeatureGate) {
|
||||
*out = *in
|
||||
@@ -373,8 +433,8 @@ func (in *GenerationStatus) DeepCopy() *GenerationStatus {
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *HostedClusterManagerConfiguration) DeepCopyInto(out *HostedClusterManagerConfiguration) {
|
||||
*out = *in
|
||||
out.RegistrationWebhookConfiguration = in.RegistrationWebhookConfiguration
|
||||
out.WorkWebhookConfiguration = in.WorkWebhookConfiguration
|
||||
in.RegistrationWebhookConfiguration.DeepCopyInto(&out.RegistrationWebhookConfiguration)
|
||||
in.WorkWebhookConfiguration.DeepCopyInto(&out.WorkWebhookConfiguration)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -388,6 +448,27 @@ func (in *HostedClusterManagerConfiguration) DeepCopy() *HostedClusterManagerCon
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *HostedWebhookConfiguration) DeepCopyInto(out *HostedWebhookConfiguration) {
|
||||
*out = *in
|
||||
if in.BindConfiguration != nil {
|
||||
in, out := &in.BindConfiguration, &out.BindConfiguration
|
||||
*out = new(BindConfiguration)
|
||||
**out = **in
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HostedWebhookConfiguration.
|
||||
func (in *HostedWebhookConfiguration) DeepCopy() *HostedWebhookConfiguration {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(HostedWebhookConfiguration)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *HostnameConfig) DeepCopyInto(out *HostnameConfig) {
|
||||
*out = *in
|
||||
@@ -657,6 +738,13 @@ func (in *RegistrationConfiguration) DeepCopyInto(out *RegistrationConfiguration
|
||||
(*out)[key] = val
|
||||
}
|
||||
}
|
||||
if in.ClusterLabels != nil {
|
||||
in, out := &in.ClusterLabels, &out.ClusterLabels
|
||||
*out = make(map[string]string, len(*in))
|
||||
for key, val := range *in {
|
||||
(*out)[key] = val
|
||||
}
|
||||
}
|
||||
in.BootstrapKubeConfigs.DeepCopyInto(&out.BootstrapKubeConfigs)
|
||||
in.RegistrationDriver.DeepCopyInto(&out.RegistrationDriver)
|
||||
if in.ClusterClaimConfiguration != nil {
|
||||
@@ -820,22 +908,6 @@ func (in *ServerURL) DeepCopy() *ServerURL {
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *WebhookConfiguration) DeepCopyInto(out *WebhookConfiguration) {
|
||||
*out = *in
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WebhookConfiguration.
|
||||
func (in *WebhookConfiguration) DeepCopy() *WebhookConfiguration {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(WebhookConfiguration)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *WorkAgentConfiguration) DeepCopyInto(out *WorkAgentConfiguration) {
|
||||
*out = *in
|
||||
|
||||
Reference in New Issue
Block a user