Skip to content

Commit 8c301a7

Browse files
authored
Merge pull request #8 from kloeckner-i/METAL-1656_publicip_spec_for_general_instance
include generic instance public ip into instance info
2 parents e7a41e1 + 78e1cdc commit 8c301a7

3 files changed

Lines changed: 5 additions & 2 deletions

File tree

integration/mysql/templates/instance.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ spec:
1010
generic:
1111
host: {{ .Values.mysql.serviceName }}.{{ .Release.Namespace }}
1212
port: 3306
13+
publicIp: "1.2.3.4"
1314
---
1415
apiVersion: v1
1516
kind: Secret

pkg/apis/kci/v1alpha1/dbinstance_types.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,9 @@ type GoogleInstance struct {
4141
// and describes necessary informations to use instance
4242
// generic instance can be any backend, it must be reachable by described address and port
4343
type GenericInstance struct {
44-
Host string `json:"host"`
45-
Port int32 `json:"port"`
44+
Host string `json:"host"`
45+
Port int32 `json:"port"`
46+
PublicIP string `json:"publicIp,omitempty"`
4647
}
4748

4849
// DbInstanceBackup defines name of google bucket to use for storing database dumps for backup when backup is enabled

pkg/controller/dbinstance/reconcileDbInstance.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ func (r *ReconcileDbInstance) create(dbin *kciv1alpha1.DbInstance) error {
4646
instance = &dbinstance.Generic{
4747
Host: dbin.Spec.Generic.Host,
4848
Port: dbin.Spec.Generic.Port,
49+
PublicIP: dbin.Spec.Generic.PublicIP,
4950
Engine: dbin.Spec.Engine,
5051
User: cred.Username,
5152
Password: cred.Password,

0 commit comments

Comments
 (0)