-
Notifications
You must be signed in to change notification settings - Fork 89
/
render.go
36 lines (31 loc) · 1000 Bytes
/
render.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
package base
import (
"github.com/pkg/errors"
"github.com/replicatedhq/kots/pkg/logger"
upstreamtypes "github.com/replicatedhq/kots/pkg/upstream/types"
)
type RenderOptions struct {
SplitMultiDocYAML bool
Namespace string
HelmVersion string
HelmOptions []string
LocalRegistryHost string
LocalRegistryNamespace string
LocalRegistryUsername string
LocalRegistryPassword string
ExcludeKotsKinds bool
Sequence int64
IsAirgap bool
Log *logger.Logger
}
// RenderUpstream is responsible for any conversions or transpilation steps are required
// to take an upstream and make it a valid kubernetes base
func RenderUpstream(u *upstreamtypes.Upstream, renderOptions *RenderOptions) (*Base, error) {
if u.Type == "helm" {
return RenderHelm(u, renderOptions)
}
if u.Type == "replicated" {
return renderReplicated(u, renderOptions)
}
return nil, errors.New("unknown upstream type")
}