Skip to content

Commit

Permalink
Re-use mqlK8s resource
Browse files Browse the repository at this point in the history
Signed-off-by: Christian Zunker <[email protected]>
  • Loading branch information
czunker committed Sep 27, 2023
1 parent 7bd275c commit bff0ff3
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions providers/k8s/resources/ingress.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,9 @@ import (
)

type mqlK8sIngressInternal struct {
lock sync.Mutex
obj *networkingv1.Ingress
objId string
mqlK8s *mqlK8s
lock sync.Mutex
obj *networkingv1.Ingress
objId string
}

func (k *mqlK8s) ingresses() ([]interface{}, error) {
Expand Down Expand Up @@ -63,15 +62,20 @@ func (k *mqlK8s) ingresses() ([]interface{}, error) {
}
r.(*mqlK8sIngress).obj = ingress
r.(*mqlK8sIngress).objId = objId
r.(*mqlK8sIngress).mqlK8s = k
return r, nil
})
}

func (k *mqlK8sIngress) tls() ([]interface{}, error) {
o, err := CreateResource(k.MqlRuntime, "k8s", map[string]*llx.RawData{})
if err != nil {
return nil, err
}
k8s := o.(*mqlK8s)

ingress := k.obj
objId := k.objId
tls, err := getTLS(ingress, objId, k.MqlRuntime, k.mqlK8s.GetSecrets)
tls, err := getTLS(ingress, objId, k.MqlRuntime, k8s.GetSecrets)
if err != nil {
return nil, err
}
Expand Down

0 comments on commit bff0ff3

Please sign in to comment.