Skip to content

Commit

Permalink
Merge pull request #8 from kloeckner-i/METAL-1656_publicip_spec_for_g…
Browse files Browse the repository at this point in the history
…eneral_instance

include generic instance public ip into instance info
  • Loading branch information
hyunysmile committed Mar 20, 2020
2 parents e7a41e1 + 78e1cdc commit 8c301a7
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions integration/mysql/templates/instance.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ spec:
generic:
host: {{ .Values.mysql.serviceName }}.{{ .Release.Namespace }}
port: 3306
publicIp: "1.2.3.4"
---
apiVersion: v1
kind: Secret
Expand Down
5 changes: 3 additions & 2 deletions pkg/apis/kci/v1alpha1/dbinstance_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,9 @@ type GoogleInstance struct {
// and describes necessary informations to use instance
// generic instance can be any backend, it must be reachable by described address and port
type GenericInstance struct {
Host string `json:"host"`
Port int32 `json:"port"`
Host string `json:"host"`
Port int32 `json:"port"`
PublicIP string `json:"publicIp,omitempty"`
}

// DbInstanceBackup defines name of google bucket to use for storing database dumps for backup when backup is enabled
Expand Down
1 change: 1 addition & 0 deletions pkg/controller/dbinstance/reconcileDbInstance.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ func (r *ReconcileDbInstance) create(dbin *kciv1alpha1.DbInstance) error {
instance = &dbinstance.Generic{
Host: dbin.Spec.Generic.Host,
Port: dbin.Spec.Generic.Port,
PublicIP: dbin.Spec.Generic.PublicIP,
Engine: dbin.Spec.Engine,
User: cred.Username,
Password: cred.Password,
Expand Down

0 comments on commit 8c301a7

Please sign in to comment.