forked from LaconicNetwork/kompose
cli: add --emptyvols option
This commit is contained in:
parent
df09fd5193
commit
9ce3f0cf15
@ -139,6 +139,7 @@ func Convert(c *cli.Context) {
|
||||
CreateDS: c.BoolT("daemonset"),
|
||||
CreateRC: c.BoolT("replicationcontroller"),
|
||||
CreateDeploymentConfig: c.BoolT("deploymentconfig"),
|
||||
EmptyVols: c.BoolT("emptyvols"),
|
||||
}
|
||||
|
||||
validateFlags(c, &opt)
|
||||
|
||||
@ -88,6 +88,10 @@ func ConvertKubernetesCommand() cli.Command {
|
||||
Name: "chart,c",
|
||||
Usage: "Create a Helm chart for converted objects",
|
||||
},
|
||||
cli.BoolFlag{
|
||||
Name: "emptyvols",
|
||||
Usage: "Use Empty Volumes. Don't generate PVCs",
|
||||
},
|
||||
cli.BoolFlag{
|
||||
Name: "deployment,d",
|
||||
Usage: "Generate a Kubernetes deployment object (default on)",
|
||||
@ -119,6 +123,10 @@ func ConvertOpenShiftCommand() cli.Command {
|
||||
Name: "deploymentconfig,dc",
|
||||
Usage: "Generate a OpenShift DeploymentConfig object",
|
||||
},
|
||||
cli.BoolFlag{
|
||||
Name: "emptyvols",
|
||||
Usage: "Use Empty Volumes. Don't generate PVCs",
|
||||
},
|
||||
},
|
||||
}
|
||||
command.Flags = append(command.Flags, commonConvertFlags()...)
|
||||
|
||||
@ -113,6 +113,7 @@ type ConvertOptions struct {
|
||||
CreateDeploymentConfig bool
|
||||
CreateChart bool
|
||||
GenerateYaml bool
|
||||
EmptyVols bool
|
||||
Replicas int
|
||||
InputFile string
|
||||
OutFile string
|
||||
|
||||
@ -223,7 +223,9 @@ func (k *Kubernetes) ConfigVolumes(name string, service kobject.ServiceConfig) (
|
||||
volumes := []api.Volume{}
|
||||
var PVCs []*api.PersistentVolumeClaim
|
||||
|
||||
useEmptyVolumes := true
|
||||
// Set a var based on if the user wants to use emtpy volumes
|
||||
// as opposed to persistent volumes and volume claims
|
||||
useEmptyVolumes := k.Opt.EmptyVols
|
||||
|
||||
var count int
|
||||
for _, volume := range service.Volumes {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user