forked from LaconicNetwork/kompose
transformers: add Opt variable as object data
This is so you can set Opts on instance creation of kubernetes.Kubernetes and openshift.Openshift. This is useful so that we can pass option information arround without having to do it on the call stack every time.
This commit is contained in:
parent
c5e07f4926
commit
51dea8283a
@ -233,12 +233,12 @@ func Down(c *cli.Context) {
|
||||
func getTransformer(opt kobject.ConvertOptions) transformer.Transformer {
|
||||
var t transformer.Transformer
|
||||
if opt.Provider == "kubernetes" {
|
||||
// Create/Init new Kubernetes object
|
||||
t = &kubernetes.Kubernetes{}
|
||||
// Create/Init new Kubernetes object with CLI opts
|
||||
t = &kubernetes.Kubernetes{Opt: opt}
|
||||
} else {
|
||||
// Create/Init new OpenShift object that is initialized with a newly
|
||||
// created Kubernetes object. Openshift inherits from Kubernetes
|
||||
t = &openshift.OpenShift{kubernetes.Kubernetes{}}
|
||||
t = &openshift.OpenShift{kubernetes.Kubernetes{Opt: opt}}
|
||||
}
|
||||
return t
|
||||
}
|
||||
|
||||
@ -43,6 +43,8 @@ import (
|
||||
)
|
||||
|
||||
type Kubernetes struct {
|
||||
// the user provided options from the command line
|
||||
Opt kobject.ConvertOptions
|
||||
}
|
||||
|
||||
// timeout is how long we'll wait for the termination of kubernetes resource to be successful
|
||||
|
||||
Loading…
Reference in New Issue
Block a user