forked from LaconicNetwork/kompose
Add flag to support store manifest when kompose up (#1208)
This commit is contained in:
parent
bc28ffc675
commit
e0c8f6d23d
@ -29,6 +29,7 @@ import (
|
||||
var (
|
||||
UpReplicas int
|
||||
UpEmptyVols bool
|
||||
StoreManifest bool
|
||||
UpVolumes string
|
||||
UpInsecureRepo bool
|
||||
UpNamespace string
|
||||
@ -56,6 +57,7 @@ var upCmd = &cobra.Command{
|
||||
UpOpt = kobject.ConvertOptions{
|
||||
Build: UpBuild,
|
||||
PushImage: UpPushImage,
|
||||
StoreManifest: StoreManifest,
|
||||
Replicas: UpReplicas,
|
||||
InputFiles: GlobalFiles,
|
||||
Provider: GlobalProvider,
|
||||
@ -86,6 +88,7 @@ func init() {
|
||||
upCmd.Flags().StringVar(&UpBuildRepo, "build-repo", "", "Specify source repository for buildconfig (default remote origin)")
|
||||
upCmd.Flags().StringVar(&UpBuildBranch, "build-branch", "", "Specify repository branch to use for buildconfig (default master)")
|
||||
upCmd.Flags().BoolVar(&UpPushImage, "push-image", true, "If we should push the docker image we built")
|
||||
upCmd.Flags().BoolVar(&StoreManifest, "store-manifest", false, "Store the generated manifest (default false)")
|
||||
upCmd.Flags().StringVar(&UpController, "controller", "", `Set the output controller ("deployment"|"daemonSet"|"replicationController")`)
|
||||
upCmd.Flags().MarkHidden("insecure-repository")
|
||||
upCmd.Flags().MarkHidden("build-repo")
|
||||
|
||||
@ -47,6 +47,7 @@ type ConvertOptions struct {
|
||||
CreateChart bool
|
||||
GenerateYaml bool
|
||||
GenerateJSON bool
|
||||
StoreManifest bool
|
||||
EmptyVols bool
|
||||
Volumes string
|
||||
InsecureRepository bool
|
||||
|
||||
@ -1210,6 +1210,13 @@ func (k *Kubernetes) Deploy(komposeObject kobject.KomposeObject, opt kobject.Con
|
||||
return errors.Wrap(err, "k.Transform failed")
|
||||
}
|
||||
|
||||
if opt.StoreManifest {
|
||||
log.Info("Store manifest to disk")
|
||||
if err := PrintList(objects, opt); err != nil {
|
||||
return errors.Wrap(err, "Store manifest failed")
|
||||
}
|
||||
}
|
||||
|
||||
pvcStr := " "
|
||||
if !opt.EmptyVols || opt.Volumes != "emptyDir" {
|
||||
pvcStr = " and PersistentVolumeClaims "
|
||||
|
||||
Loading…
Reference in New Issue
Block a user