forked from carvel-dev/kapp-controller
-
Notifications
You must be signed in to change notification settings - Fork 0
/
factory.go
29 lines (23 loc) · 828 Bytes
/
factory.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
package template
import (
"github.com/k14s/kapp-controller/pkg/apis/kappctrl/v1alpha1"
"github.com/k14s/kapp-controller/pkg/fetch"
"k8s.io/client-go/kubernetes"
)
type Factory struct {
coreClient kubernetes.Interface
fetchFactory fetch.Factory
}
func NewFactory(coreClient kubernetes.Interface, fetchFactory fetch.Factory) Factory {
return Factory{coreClient, fetchFactory}
}
func (f Factory) NewYtt(opts v1alpha1.AppTemplateYtt, genericOpts GenericOpts) *Ytt {
return NewYtt(opts, genericOpts, f.fetchFactory)
}
func (f Factory) NewKbld(opts v1alpha1.AppTemplateKbld, genericOpts GenericOpts) *Kbld {
return NewKbld(opts, genericOpts)
}
func (f Factory) NewHelmTemplate(
opts v1alpha1.AppTemplateHelmTemplate, genericOpts GenericOpts) *HelmTemplate {
return NewHelmTemplate(opts, genericOpts, f.coreClient)
}