Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 25 additions & 22 deletions cluster/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import (
// +genclient:nonNamespaced
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

// Cluster represents the desire state and status of a member cluster.
// Cluster represents the desired state and status of a member cluster.
type Cluster struct {
metav1.TypeMeta
metav1.ObjectMeta
Expand All @@ -44,8 +44,8 @@ type Cluster struct {
// ClusterSpec defines the desired state of a member cluster.
type ClusterSpec struct {
// ID is the unique identifier for the cluster.
// It is different from the object uid(.metadata.uid) and typically collected automatically
// from member cluster during the progress of registration.
// It is different from the object uid(.metadata.uid) and is typically collected automatically
// from each member cluster during the process of registration.
//
// The value is collected in order:
// 1. If the registering cluster enabled ClusterProperty API and defined the cluster ID by
Expand All @@ -63,7 +63,7 @@ type ClusterSpec struct {
// +kubebuilder:validation:Maxlength=128000
ID string `json:"id,omitempty"`

// SyncMode describes how a cluster sync resources from karmada control plane.
// SyncMode describes how a cluster syncs resources from karmada control plane.
// +required
SyncMode ClusterSyncMode

Expand All @@ -72,14 +72,14 @@ type ClusterSpec struct {
// +optional
APIEndpoint string

// SecretRef represents the secret contains mandatory credentials to access the member cluster.
// SecretRef represents the secret that contains mandatory credentials to access the member cluster.
// The secret should hold credentials as follows:
// - secret.data.token
// - secret.data.caBundle
// +optional
SecretRef *LocalSecretReference

// ImpersonatorSecretRef represents the secret contains the token of impersonator.
// ImpersonatorSecretRef represents the secret that contains the token of impersonator.
// The secret should hold credentials as follows:
// - secret.data.token
// +optional
Expand All @@ -94,12 +94,12 @@ type ClusterSpec struct {

// ProxyURL is the proxy URL for the cluster.
// If not empty, the karmada control plane will use this proxy to talk to the cluster.
// More details please refer to: https://github.com/kubernetes/client-go/issues/351
// For more details please refer to: https://github.com/kubernetes/client-go/issues/351
// +optional
ProxyURL string

// ProxyHeader is the HTTP header required by proxy server.
// The key in the key-value pair is HTTP header key and value is the associated header payloads.
// The key in the key-value pair is HTTP header key and the value is the associated header payloads.
// For the header with multiple values, the values should be separated by comma(e.g. 'k1': 'v1,v2,v3').
// +optional
ProxyHeader map[string]string
Expand All @@ -108,12 +108,12 @@ type ClusterSpec struct {
// +optional
Provider string

// Region represents the region of the member cluster locate in.
// Region represents the region in which the member cluster is located.
// +optional
Region string

// Zone represents the zone of the member cluster locate in.
// Deprecated: This filed was never been used by Karmada, and it will not be
// Zone represents the zone in which the member cluster is located.
// Deprecated: This field was never used by Karmada, and it will not be
// removed from v1alpha1 for backward compatibility, use Zones instead.
// +optional
Zone string
Expand All @@ -126,7 +126,7 @@ type ClusterSpec struct {
// +optional
Zones []string `json:"zones,omitempty"`

// Taints attached to the member cluster.
// Taints are attached to the member cluster.
// Taints on the cluster have the "effect" on
// any resource that does not tolerate the Taint.
// +optional
Expand Down Expand Up @@ -204,8 +204,8 @@ type ResourceModel struct {

// ResourceModelRange describes the detail of each modeling quota that ranges from min to max.
// Please pay attention, by default, the value of min can be inclusive, and the value of max cannot be inclusive.
// E.g. in an interval, min = 2, max =10 is set, which means the interval [2,10).
// This rule ensure that all intervals have the same meaning. If the last interval is infinite,
// E.g. in an interval, min = 2, max = 10 is set, which means the interval [2,10).
// This rule ensures that all intervals have the same meaning. If the last interval is infinite,
// it is definitely unreachable. Therefore, we define the right interval as the open interval.
// For a valid interval, the value on the right is greater than the value on the left,
// in other words, max must be greater than min.
Expand Down Expand Up @@ -242,13 +242,13 @@ const (
type ClusterSyncMode string

const (
// Push means that the controller on the karmada control plane will in charge of synchronization.
// The controller watches resources change on karmada control plane then pushes them to member cluster.
// Push means that the controller on the karmada control plane will be in charge of synchronization.
// The controller watches resources change on karmada control plane and then pushes them to member cluster.
Push ClusterSyncMode = "Push"

// Pull means that the controller running on the member cluster will in charge of synchronization.
// The controller, as well known as 'agent', watches resources change on karmada control plane then fetches them
// and applies locally on the member cluster.
// Pull means that the controller running on the member cluster will be in charge of synchronization.
// The controller, also known as 'agent', watches resources change on karmada control plane, then fetches them
// and applies them locally on the member cluster.
Pull ClusterSyncMode = "Pull"
)

Expand All @@ -258,14 +258,17 @@ type LocalSecretReference struct {
// Namespace is the namespace for the resource being referenced.
Namespace string

// Name is the name of resource being referenced.
// Name is the name of the resource being referenced.
Name string
}

// Define valid conditions of a member cluster.
const (
// ClusterConditionReady means the cluster is healthy and ready to accept workloads.
ClusterConditionReady = "Ready"

// ClusterConditionCompleteAPIEnablements indicates whether the cluster's API enablements(.status.apiEnablements) are complete.
ClusterConditionCompleteAPIEnablements = "CompleteAPIEnablements"
)

// ClusterStatus contains information about the current status of a
Expand All @@ -275,7 +278,7 @@ type ClusterStatus struct {
// +optional
KubernetesVersion string

// APIEnablements represents the list of APIs installed in the member cluster.
// APIEnablements represents the list of APIs installed on the member cluster.
// +optional
APIEnablements []APIEnablement

Expand Down Expand Up @@ -366,7 +369,7 @@ type AllocatableModeling struct {

// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

// ClusterList contains a list of member cluster
// ClusterList contains a list of member clusters
type ClusterList struct {
metav1.TypeMeta
metav1.ListMeta
Expand Down
47 changes: 25 additions & 22 deletions cluster/v1alpha1/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ const (
// +kubebuilder:resource:scope="Cluster"
// +kubebuilder:subresource:status

// Cluster represents the desire state and status of a member cluster.
// Cluster represents the desired state and status of a member cluster.
type Cluster struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Expand All @@ -55,8 +55,8 @@ type Cluster struct {
// ClusterSpec defines the desired state of a member cluster.
type ClusterSpec struct {
// ID is the unique identifier for the cluster.
// It is different from the object uid(.metadata.uid) and typically collected automatically
// from member cluster during the progress of registration.
// It is different from the object uid(.metadata.uid) and is typically collected automatically
// from each member cluster during the process of registration.
//
// The value is collected in order:
// 1. If the registering cluster enabled ClusterProperty API and defined the cluster ID by
Expand All @@ -74,7 +74,7 @@ type ClusterSpec struct {
// +kubebuilder:validation:Maxlength=128000
ID string `json:"id,omitempty"`

// SyncMode describes how a cluster sync resources from karmada control plane.
// SyncMode describes how a cluster syncs resources from karmada control plane.
// +kubebuilder:validation:Enum=Push;Pull
// +required
SyncMode ClusterSyncMode `json:"syncMode"`
Expand All @@ -84,14 +84,14 @@ type ClusterSpec struct {
// +optional
APIEndpoint string `json:"apiEndpoint,omitempty"`

// SecretRef represents the secret contains mandatory credentials to access the member cluster.
// SecretRef represents the secret that contains mandatory credentials to access the member cluster.
// The secret should hold credentials as follows:
// - secret.data.token
// - secret.data.caBundle
// +optional
SecretRef *LocalSecretReference `json:"secretRef,omitempty"`

// ImpersonatorSecretRef represents the secret contains the token of impersonator.
// ImpersonatorSecretRef represents the secret that contains the token of impersonator.
// The secret should hold credentials as follows:
// - secret.data.token
// +optional
Expand All @@ -106,12 +106,12 @@ type ClusterSpec struct {

// ProxyURL is the proxy URL for the cluster.
// If not empty, the karmada control plane will use this proxy to talk to the cluster.
// More details please refer to: https://github.com/kubernetes/client-go/issues/351
// For more details please refer to: https://github.com/kubernetes/client-go/issues/351
// +optional
ProxyURL string `json:"proxyURL,omitempty"`

// ProxyHeader is the HTTP header required by proxy server.
// The key in the key-value pair is HTTP header key and value is the associated header payloads.
// The key in the key-value pair is HTTP header key and the value is the associated header payloads.
// For the header with multiple values, the values should be separated by comma(e.g. 'k1': 'v1,v2,v3').
// +optional
ProxyHeader map[string]string `json:"proxyHeader,omitempty"`
Expand All @@ -120,12 +120,12 @@ type ClusterSpec struct {
// +optional
Provider string `json:"provider,omitempty"`

// Region represents the region of the member cluster locate in.
// Region represents the region in which the member cluster is located.
// +optional
Region string `json:"region,omitempty"`

// Zone represents the zone of the member cluster locate in.
// Deprecated: This filed was never been used by Karmada, and it will not be
// Zone represents the zone in which the member cluster is located.
// Deprecated: This field was never been used by Karmada, and it will not be
// removed from v1alpha1 for backward compatibility, use Zones instead.
// +optional
Zone string `json:"zone,omitempty"`
Expand All @@ -138,7 +138,7 @@ type ClusterSpec struct {
// +optional
Zones []string `json:"zones,omitempty"`

// Taints attached to the member cluster.
// Taints are attached to the member cluster.
// Taints on the cluster have the "effect" on
// any resource that does not tolerate the Taint.
// +optional
Expand Down Expand Up @@ -216,8 +216,8 @@ type ResourceModel struct {

// ResourceModelRange describes the detail of each modeling quota that ranges from min to max.
// Please pay attention, by default, the value of min can be inclusive, and the value of max cannot be inclusive.
// E.g. in an interval, min = 2, max =10 is set, which means the interval [2,10).
// This rule ensure that all intervals have the same meaning. If the last interval is infinite,
// E.g. in an interval, min = 2, max = 10 is set, which means the interval [2,10).
// This rule ensures that all intervals have the same meaning. If the last interval is infinite,
// it is definitely unreachable. Therefore, we define the right interval as the open interval.
// For a valid interval, the value on the right is greater than the value on the left,
// in other words, max must be greater than min.
Expand Down Expand Up @@ -254,13 +254,13 @@ const (
type ClusterSyncMode string

const (
// Push means that the controller on the karmada control plane will in charge of synchronization.
// The controller watches resources change on karmada control plane then pushes them to member cluster.
// Push means that the controller on the karmada control plane will be in charge of synchronization.
// The controller watches resources change on karmada control plane and then pushes them to member cluster.
Push ClusterSyncMode = "Push"

// Pull means that the controller running on the member cluster will in charge of synchronization.
// The controller, as well known as 'agent', watches resources change on karmada control plane then fetches them
// and applies locally on the member cluster.
// Pull means that the controller running on the member cluster will be in charge of synchronization.
// The controller, also known as 'agent', watches resources change on karmada control plane, then fetches them
// and applies them locally on the member cluster.
Pull ClusterSyncMode = "Pull"
)

Expand All @@ -270,14 +270,17 @@ type LocalSecretReference struct {
// Namespace is the namespace for the resource being referenced.
Namespace string `json:"namespace"`

// Name is the name of resource being referenced.
// Name is the name of the resource being referenced.
Name string `json:"name"`
}

// Define valid conditions of a member cluster.
const (
// ClusterConditionReady means the cluster is healthy and ready to accept workloads.
ClusterConditionReady = "Ready"

// ClusterConditionCompleteAPIEnablements indicates whether the cluster's API enablements(.status.apiEnablements) are complete.
ClusterConditionCompleteAPIEnablements = "CompleteAPIEnablements"
)

// ClusterStatus contains information about the current status of a
Expand All @@ -287,7 +290,7 @@ type ClusterStatus struct {
// +optional
KubernetesVersion string `json:"kubernetesVersion,omitempty"`

// APIEnablements represents the list of APIs installed in the member cluster.
// APIEnablements represents the list of APIs installed on the member cluster.
// +optional
APIEnablements []APIEnablement `json:"apiEnablements,omitempty"`

Expand Down Expand Up @@ -375,7 +378,7 @@ type AllocatableModeling struct {

// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

// ClusterList contains a list of member cluster
// ClusterList contains a list of member clusters
type ClusterList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Expand Down
2 changes: 1 addition & 1 deletion config/v1alpha1/resourceinterpreterwebhook_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ type RuleWithOperations struct {
type InterpreterOperation string

const (
// InterpreterOperationAll indicates math all InterpreterOperation.
// InterpreterOperationAll indicates matching all InterpreterOperation.
InterpreterOperationAll InterpreterOperation = "*"

// InterpreterOperationInterpretReplica indicates that karmada want to figure out the replica declaration of a specific object.
Expand Down
24 changes: 12 additions & 12 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
module github.com/karmada-io/api

go 1.22.0

toolchain go1.22.4
go 1.22.9

require (
k8s.io/api v0.30.2
k8s.io/apiextensions-apiserver v0.30.2
k8s.io/apimachinery v0.30.2
k8s.io/utils v0.0.0-20230726121419-3b25d923346b
sigs.k8s.io/controller-runtime v0.18.4
k8s.io/api v0.31.2
k8s.io/apiextensions-apiserver v0.31.2
k8s.io/apimachinery v0.31.2
k8s.io/utils v0.0.0-20240711033017-18e509b52bc8
sigs.k8s.io/controller-runtime v0.19.1
)

require (
github.com/go-logr/logr v1.4.1 // indirect
github.com/fxamacker/cbor/v2 v2.7.0 // indirect
github.com/go-logr/logr v1.4.2 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/google/gofuzz v1.2.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
golang.org/x/net v0.23.0 // indirect
golang.org/x/text v0.14.0 // indirect
github.com/x448/float16 v0.8.4 // indirect
golang.org/x/net v0.26.0 // indirect
golang.org/x/text v0.16.0 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
k8s.io/klog/v2 v2.120.1 // indirect
k8s.io/klog/v2 v2.130.1 // indirect
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect
sigs.k8s.io/yaml v1.4.0 // indirect
Expand Down
Loading