Skip to content

Commit

Permalink
Merge pull request #130 from Altinity/dev-vladislav
Browse files Browse the repository at this point in the history
dev: main service template
  • Loading branch information
sunsingerus authored Jun 21, 2019
2 parents 1dbee02 + af394b3 commit 85e06a9
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ spec:
templates:
podTemplate: clickhouse-per-host
volumeClaimTemplate: storage-vc-template
chiServiceTemplate: ch-service
serviceTemplate: ch-service
configuration:
clusters:
- name: zoned
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ spec:
defaults:
templates:
podTemplate: clickhouse-per-host-localstorage
chiServiceTemplate: ch-service
serviceTemplate: ch-service
configuration:
clusters:
- name: ch-localstorage
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/99-clickhouseinstallation-max.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ spec:
templates:
podTemplate: clickhouse-v18.16.1
volumeClaimTemplate: default-volume-claim
chiServiceTemplate: chi-service-template
serviceTemplate: chi-service-template

configuration:
s zookeeper:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ spec:
type: string
volumeClaimTemplate:
type: string
chiServiceTemplate:
serviceTemplate:
type: string
clusterServiceTemplate:
type: string
Expand Down Expand Up @@ -117,7 +117,7 @@ spec:
type: string
volumeClaimTemplate:
type: string
chiServiceTemplate:
serviceTemplate:
type: string
clusterServiceTemplate:
type: string
Expand Down Expand Up @@ -161,7 +161,7 @@ spec:
type: string
volumeClaimTemplate:
type: string
chiServiceTemplate:
serviceTemplate:
type: string
clusterServiceTemplate:
type: string
Expand All @@ -187,7 +187,7 @@ spec:
type: string
volumeClaimTemplate:
type: string
chiServiceTemplate:
serviceTemplate:
type: string
clusterServiceTemplate:
type: string
Expand Down
8 changes: 4 additions & 4 deletions manifests/operator/clickhouse-operator-install.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ spec:
type: string
volumeClaimTemplate:
type: string
chiServiceTemplate:
serviceTemplate:
type: string
clusterServiceTemplate:
type: string
Expand Down Expand Up @@ -117,7 +117,7 @@ spec:
type: string
volumeClaimTemplate:
type: string
chiServiceTemplate:
serviceTemplate:
type: string
clusterServiceTemplate:
type: string
Expand Down Expand Up @@ -161,7 +161,7 @@ spec:
type: string
volumeClaimTemplate:
type: string
chiServiceTemplate:
serviceTemplate:
type: string
clusterServiceTemplate:
type: string
Expand All @@ -187,7 +187,7 @@ spec:
type: string
volumeClaimTemplate:
type: string
chiServiceTemplate:
serviceTemplate:
type: string
clusterServiceTemplate:
type: string
Expand Down
2 changes: 1 addition & 1 deletion pkg/apis/clickhouse.altinity.com/v1/type_chi.go
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ func (chi *ClickHouseInstallation) GetServiceTemplate(name string) (*ChiServiceT

// GetServiceTemplate gets own ChiServiceTemplate
func (chi *ClickHouseInstallation) GetOwnServiceTemplate() (*ChiServiceTemplate, bool) {
name := chi.Spec.Defaults.Templates.ChiServiceTemplate
name := chi.Spec.Defaults.Templates.serviceTemplate
template, ok := chi.GetServiceTemplate(name)
return template, ok
}
6 changes: 3 additions & 3 deletions pkg/apis/clickhouse.altinity.com/v1/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ type ChiDefaults struct {
type ChiTemplateNames struct {
PodTemplate string `json:"podTemplate,omitempty" yaml:"podTemplate"`
VolumeClaimTemplate string `json:"volumeClaimTemplate,omitempty" yaml:"volumeClaimTemplate"`
ChiServiceTemplate string `json:"chiServiceTemplate,omitempty" yaml:"chiServiceTemplate"`
serviceTemplate string `json:"serviceTemplate,omitempty" yaml:"serviceTemplate"`
ClusterServiceTemplate string `json:"clusterServiceTemplate,omitempty" yaml:"clusterServiceTemplate"`
ShardServiceTemplate string `json:"shardServiceTemplate,omitempty" yaml:"shardServiceTemplate"`
ReplicaServiceTemplate string `json:"replicaServiceTemplate,omitempty" yaml:"replicaServiceTemplate"`
Expand All @@ -72,8 +72,8 @@ func (templates *ChiTemplateNames) MergeFrom(from *ChiTemplateNames) {
if templates.VolumeClaimTemplate == "" {
templates.VolumeClaimTemplate = from.VolumeClaimTemplate
}
if templates.ChiServiceTemplate == "" {
templates.ChiServiceTemplate = from.ChiServiceTemplate
if templates.serviceTemplate == "" {
templates.serviceTemplate = from.serviceTemplate
}
if templates.ClusterServiceTemplate == "" {
templates.ClusterServiceTemplate = from.ClusterServiceTemplate
Expand Down

0 comments on commit 85e06a9

Please sign in to comment.