-
Notifications
You must be signed in to change notification settings - Fork 99
/
factory.go
37 lines (29 loc) · 1.06 KB
/
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
30
31
32
33
34
35
36
37
// Copyright 2020 VMware, Inc.
// SPDX-License-Identifier: Apache-2.0
package template
import (
"github.com/vmware-tanzu/carvel-kapp-controller/pkg/apis/kappctrl/v1alpha1"
"github.com/vmware-tanzu/carvel-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.coreClient, 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)
}
func (f Factory) NewSops(
opts v1alpha1.AppTemplateSops, genericOpts GenericOpts) *Sops {
return NewSops(opts, genericOpts, f.coreClient)
}