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
58 changes: 58 additions & 0 deletions feature/feature.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
package feature

import (
"k8s.io/component-base/featuregate"
)

const (
// Every feature gate should add method here following this template:
//
// // owner: @username
// // alpha: v1.X
// MyFeature featuregate.Feature = "MyFeature"

// ClusterClaim will start a new controller in the spoke-agent to manage the cluster-claim
// resources in the managed cluster.
//
// The cluster-claim controller is majorly for collecting claims and updating claims field
// in managedcluster status. When it exceeds the limit specified by "--max-custom-cluster-claims",
// the extra claims will be truncated.
//
// If it is disabled, the user will see empty claims field in managedcluster status. The
// deployer who disable the feature may need to update claim field in managed cluster status
// itself to avoid impact to users.
ClusterClaim featuregate.Feature = "ClusterClaim"

// AddonManagement will start new controllers in the spoke-agent to manage the managed cluster addons
// registration and maintains the status of managed cluster addons through watching their leases.
AddonManagement featuregate.Feature = "AddonManagement"

// DefaultClusterSet will make registration hub controller to maintain a default cluster set. All clusters
// without clusterset label will be automatically added into the default cluster set by adding a label
// "cluster.open-cluster-management.io/clusterset=default" to the clusters.
DefaultClusterSet featuregate.Feature = "DefaultClusterSet"

// V1beta1CSRAPICompatibility will make the spoke registration agent to issue CSR requests
// via V1beta1 api, so that registration agent can still manage the certificate rotation for the
// ManagedCluster and ManagedClusterAddon.
// Note that kubernetes release [1.12, 1.18)'s beta CSR api doesn't have the "signerName" field which
// means that all the approved CSR objects will be signed by the built-in CSR controller in
// kube-controller-manager.
V1beta1CSRAPICompatibility featuregate.Feature = "V1beta1CSRAPICompatibility"
)

// DefaultSpokeRegistrationFeatureGates consists of all known ocm-registration
// feature keys for registration agent. To add a new feature, define a key for it above and
// add it here.
var DefaultSpokeRegistrationFeatureGates = map[featuregate.Feature]featuregate.FeatureSpec{
ClusterClaim: {Default: true, PreRelease: featuregate.Beta},
AddonManagement: {Default: false, PreRelease: featuregate.Alpha},
V1beta1CSRAPICompatibility: {Default: false, PreRelease: featuregate.Alpha},
}

// DefaultHubRegistrationFeatureGates consists of all known ocm-registration
// feature keys for registration hub controller. To add a new feature, define a key for it above and
// add it here.
var DefaultHubRegistrationFeatureGates = map[featuregate.Feature]featuregate.FeatureSpec{
DefaultClusterSet: {Default: false, PreRelease: featuregate.Alpha},
}
1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ require (
k8s.io/apimachinery v0.23.0
k8s.io/client-go v0.23.0
k8s.io/code-generator v0.23.0
k8s.io/component-base v0.23.0
k8s.io/klog/v2 v2.30.0
sigs.k8s.io/controller-runtime v0.11.1
)
Expand Down
202 changes: 202 additions & 0 deletions vendor/k8s.io/component-base/LICENSE

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 17 additions & 0 deletions vendor/k8s.io/component-base/featuregate/OWNERS

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading