Skip to content

Commit

Permalink
dev: introduce explicit api group
Browse files Browse the repository at this point in the history
  • Loading branch information
sunsingerus committed Nov 17, 2023
1 parent 7101f8a commit ac27759
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 30 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@
package clickhousealtinitycom

const (
// GroupName is the group name of the ClickHouse Operator API.
GroupName = "clickhouse.altinity.com"
// APIGroupName is the group name of the ClickHouse Operator API.
APIGroupName = "clickhouse.altinity.com"
)
9 changes: 7 additions & 2 deletions pkg/apis/clickhouse.altinity.com/v1/register.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,15 @@ import (
clickhousealtinitycom "github.com/altinity/clickhouse-operator/pkg/apis/clickhouse.altinity.com"
)

const (
// APIVersion is the version of the Clickhouse Operator API.
APIVersion = "v1"
)

// SchemeGroupVersion is group version used to register these objects
var SchemeGroupVersion = schema.GroupVersion{
Group: clickhousealtinitycom.GroupName,
Version: "v1",
Group: clickhousealtinitycom.APIGroupName,
Version: APIVersion,
}

// Resource returns schema.GroupResource
Expand Down
52 changes: 26 additions & 26 deletions pkg/model/labeler.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,48 +31,48 @@ import (
const (
// Main labels

LabelReadyName = clickhousealtinitycom.GroupName + "/" + "ready"
LabelReadyName = clickhousealtinitycom.APIGroupName + "/" + "ready"
LabelReadyValueReady = "yes"
LabelReadyValueNotReady = "no"
LabelAppName = clickhousealtinitycom.GroupName + "/" + "app"
LabelAppName = clickhousealtinitycom.APIGroupName + "/" + "app"
LabelAppValue = "chop"
LabelCHOP = clickhousealtinitycom.GroupName + "/" + "chop"
LabelCHOPCommit = clickhousealtinitycom.GroupName + "/" + "chop-commit"
LabelCHOPDate = clickhousealtinitycom.GroupName + "/" + "chop-date"
LabelNamespace = clickhousealtinitycom.GroupName + "/" + "namespace"
LabelCHIName = clickhousealtinitycom.GroupName + "/" + "chi"
LabelClusterName = clickhousealtinitycom.GroupName + "/" + "cluster"
LabelShardName = clickhousealtinitycom.GroupName + "/" + "shard"
LabelReplicaName = clickhousealtinitycom.GroupName + "/" + "replica"
LabelConfigMap = clickhousealtinitycom.GroupName + "/" + "ConfigMap"
LabelCHOP = clickhousealtinitycom.APIGroupName + "/" + "chop"
LabelCHOPCommit = clickhousealtinitycom.APIGroupName + "/" + "chop-commit"
LabelCHOPDate = clickhousealtinitycom.APIGroupName + "/" + "chop-date"
LabelNamespace = clickhousealtinitycom.APIGroupName + "/" + "namespace"
LabelCHIName = clickhousealtinitycom.APIGroupName + "/" + "chi"
LabelClusterName = clickhousealtinitycom.APIGroupName + "/" + "cluster"
LabelShardName = clickhousealtinitycom.APIGroupName + "/" + "shard"
LabelReplicaName = clickhousealtinitycom.APIGroupName + "/" + "replica"
LabelConfigMap = clickhousealtinitycom.APIGroupName + "/" + "ConfigMap"
labelConfigMapValueCHICommon = "ChiCommon"
labelConfigMapValueCHICommonUsers = "ChiCommonUsers"
labelConfigMapValueHost = "Host"
LabelService = clickhousealtinitycom.GroupName + "/" + "Service"
LabelService = clickhousealtinitycom.APIGroupName + "/" + "Service"
labelServiceValueCHI = "chi"
labelServiceValueCluster = "cluster"
labelServiceValueShard = "shard"
labelServiceValueHost = "host"
LabelPVCReclaimPolicyName = clickhousealtinitycom.GroupName + "/" + "reclaimPolicy"
LabelPVCReclaimPolicyName = clickhousealtinitycom.APIGroupName + "/" + "reclaimPolicy"

// Supplementary service labels - used to cooperate with k8s

LabelZookeeperConfigVersion = clickhousealtinitycom.GroupName + "/" + "zookeeper-version"
LabelSettingsConfigVersion = clickhousealtinitycom.GroupName + "/" + "settings-version"
LabelObjectVersion = clickhousealtinitycom.GroupName + "/" + "object-version"
LabelZookeeperConfigVersion = clickhousealtinitycom.APIGroupName + "/" + "zookeeper-version"
LabelSettingsConfigVersion = clickhousealtinitycom.APIGroupName + "/" + "settings-version"
LabelObjectVersion = clickhousealtinitycom.APIGroupName + "/" + "object-version"

// Optional labels

LabelShardScopeIndex = clickhousealtinitycom.GroupName + "/" + "shardScopeIndex"
LabelReplicaScopeIndex = clickhousealtinitycom.GroupName + "/" + "replicaScopeIndex"
LabelCHIScopeIndex = clickhousealtinitycom.GroupName + "/" + "chiScopeIndex"
LabelCHIScopeCycleSize = clickhousealtinitycom.GroupName + "/" + "chiScopeCycleSize"
LabelCHIScopeCycleIndex = clickhousealtinitycom.GroupName + "/" + "chiScopeCycleIndex"
LabelCHIScopeCycleOffset = clickhousealtinitycom.GroupName + "/" + "chiScopeCycleOffset"
LabelClusterScopeIndex = clickhousealtinitycom.GroupName + "/" + "clusterScopeIndex"
LabelClusterScopeCycleSize = clickhousealtinitycom.GroupName + "/" + "clusterScopeCycleSize"
LabelClusterScopeCycleIndex = clickhousealtinitycom.GroupName + "/" + "clusterScopeCycleIndex"
LabelClusterScopeCycleOffset = clickhousealtinitycom.GroupName + "/" + "clusterScopeCycleOffset"
LabelShardScopeIndex = clickhousealtinitycom.APIGroupName + "/" + "shardScopeIndex"
LabelReplicaScopeIndex = clickhousealtinitycom.APIGroupName + "/" + "replicaScopeIndex"
LabelCHIScopeIndex = clickhousealtinitycom.APIGroupName + "/" + "chiScopeIndex"
LabelCHIScopeCycleSize = clickhousealtinitycom.APIGroupName + "/" + "chiScopeCycleSize"
LabelCHIScopeCycleIndex = clickhousealtinitycom.APIGroupName + "/" + "chiScopeCycleIndex"
LabelCHIScopeCycleOffset = clickhousealtinitycom.APIGroupName + "/" + "chiScopeCycleOffset"
LabelClusterScopeIndex = clickhousealtinitycom.APIGroupName + "/" + "clusterScopeIndex"
LabelClusterScopeCycleSize = clickhousealtinitycom.APIGroupName + "/" + "clusterScopeCycleSize"
LabelClusterScopeCycleIndex = clickhousealtinitycom.APIGroupName + "/" + "clusterScopeCycleIndex"
LabelClusterScopeCycleOffset = clickhousealtinitycom.APIGroupName + "/" + "clusterScopeCycleOffset"
)

// Labeler is an entity which can label CHI artifacts
Expand Down

0 comments on commit ac27759

Please sign in to comment.