Skip to content

Commit

Permalink
resolve change requests
Browse files Browse the repository at this point in the history
Signed-off-by: Arnob kumar saha <arnob@appscode.com>
  • Loading branch information
ArnobKumarSaha committed Sep 14, 2022
1 parent 0c2dee6 commit f844c61
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 45 deletions.
4 changes: 2 additions & 2 deletions apis/kubedb/v1alpha2/mongodb_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@ func (m MongoDB) Hosts() []string {
hosts = append(hosts, s)
}
if m.Spec.Hidden != nil {
for i := int32(0); i < *m.Spec.Hidden.Replicas; i++ {
for i := int32(0); i < m.Spec.Hidden.Replicas; i++ {
s := fmt.Sprintf("%v-%v.%v.%v.svc:%v", m.HiddenNodeName(), i, m.GoverningServiceName(m.OffshootName()), m.Namespace, MongoDBDatabasePort)
hosts = append(hosts, s)
}
Expand Down Expand Up @@ -446,7 +446,7 @@ func (m MongoDB) ShardHosts(nodeNum int32) []string {
hosts = append(hosts, s)
}
if m.Spec.Hidden != nil {
for i := int32(0); i < *m.Spec.Hidden.Replicas; i++ {
for i := int32(0); i < m.Spec.Hidden.Replicas; i++ {
s := fmt.Sprintf("%v-%v.%v.%v.svc:%v", m.HiddenShardNodeName(nodeNum), i, m.GoverningServiceName(m.ShardNodeName(nodeNum)), m.Namespace, MongoDBDatabasePort)
hosts = append(hosts, s)
}
Expand Down
7 changes: 2 additions & 5 deletions apis/kubedb/v1alpha2/mongodb_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -292,13 +292,10 @@ type MongoHiddenNode struct {

// Replicas represents number of replicas of this specific node.
// If current node has replicaset enabled, then replicas is the amount of replicaset nodes.
Replicas *int32 `json:"replicas,omitempty"`
Replicas int32 `json:"replicas"`

// Storage to specify how storage shall be used.
Storage *core.PersistentVolumeClaimSpec `json:"storage,omitempty"`

// EphemeralStorage spec to specify the configuration of ephemeral storage type.
EphemeralStorage *core.EmptyDirVolumeSource `json:"ephemeralStorage,omitempty"`
Storage core.PersistentVolumeClaimSpec `json:"storage"`
}

type MongoDBNode struct {
Expand Down
11 changes: 4 additions & 7 deletions apis/kubedb/v1alpha2/openapi_generated.go

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

16 changes: 1 addition & 15 deletions apis/kubedb/v1alpha2/zz_generated.deepcopy.go

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

14 changes: 3 additions & 11 deletions crds/kubedb.com_mongodbs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2536,17 +2536,6 @@ spec:
name:
type: string
type: object
ephemeralStorage:
properties:
medium:
type: string
sizeLimit:
anyOf:
- type: integer
- type: string
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
x-kubernetes-int-or-string: true
type: object
podTemplate:
properties:
controller:
Expand Down Expand Up @@ -4897,6 +4886,9 @@ spec:
volumeName:
type: string
type: object
required:
- replicas
- storage
type: object
init:
properties:
Expand Down
12 changes: 7 additions & 5 deletions openapi/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -30949,15 +30949,15 @@
},
"dev.kubedb.apimachinery.apis.kubedb.v1alpha2.MongoHiddenNode": {
"type": "object",
"required": [
"replicas",
"storage"
],
"properties": {
"configSecret": {
"description": "ConfigSecret is an optional field to provide custom configuration file for database (i.e mongod.cnf). If specified, this file will be used as configuration file otherwise default configuration file will be used.",
"$ref": "#/definitions/io.k8s.api.core.v1.LocalObjectReference"
},
"ephemeralStorage": {
"description": "EphemeralStorage spec to specify the configuration of ephemeral storage type.",
"$ref": "#/definitions/io.k8s.api.core.v1.EmptyDirVolumeSource"
},
"podTemplate": {
"description": "PodTemplate is an optional configuration for pods used to expose database",
"default": {},
Expand All @@ -30966,10 +30966,12 @@
"replicas": {
"description": "Replicas represents number of replicas of this specific node. If current node has replicaset enabled, then replicas is the amount of replicaset nodes.",
"type": "integer",
"format": "int32"
"format": "int32",
"default": 0
},
"storage": {
"description": "Storage to specify how storage shall be used.",
"default": {},
"$ref": "#/definitions/io.k8s.api.core.v1.PersistentVolumeClaimSpec"
}
}
Expand Down

0 comments on commit f844c61

Please sign in to comment.