forked from LaconicNetwork/kompose
Added support for different namespaces
Now we can deploy application in different namespaces using the "--namespace=<value>" flag with kompose up and kompose down. The --namepace flag will deploy the application in that particular "namespace" if exist."
This commit is contained in:
+7
-3
@@ -26,7 +26,8 @@ import (
|
||||
|
||||
// TODO: comment
|
||||
var (
|
||||
DownOpt kobject.ConvertOptions
|
||||
DownNamespace string
|
||||
DownOpt kobject.ConvertOptions
|
||||
)
|
||||
|
||||
var downCmd = &cobra.Command{
|
||||
@@ -37,8 +38,10 @@ var downCmd = &cobra.Command{
|
||||
|
||||
// Create the Convert options.
|
||||
DownOpt = kobject.ConvertOptions{
|
||||
InputFiles: GlobalFiles,
|
||||
Provider: strings.ToLower(GlobalProvider),
|
||||
InputFiles: GlobalFiles,
|
||||
Provider: strings.ToLower(GlobalProvider),
|
||||
Namespace: DownNamespace,
|
||||
IsNamespaceFlag: cmd.Flags().Lookup("namespace").Changed,
|
||||
}
|
||||
|
||||
// Validate before doing anything else.
|
||||
@@ -50,5 +53,6 @@ var downCmd = &cobra.Command{
|
||||
}
|
||||
|
||||
func init() {
|
||||
downCmd.Flags().StringVar(&DownNamespace, "namespace", "default", " Specify Namespace to deploy your application")
|
||||
RootCmd.AddCommand(downCmd)
|
||||
}
|
||||
|
||||
@@ -29,6 +29,7 @@ var (
|
||||
UpReplicas int
|
||||
UpEmptyVols bool
|
||||
UpInsecureRepo bool
|
||||
UpNamespace string
|
||||
UpOpt kobject.ConvertOptions
|
||||
)
|
||||
|
||||
@@ -44,7 +45,9 @@ var upCmd = &cobra.Command{
|
||||
InputFiles: GlobalFiles,
|
||||
Provider: strings.ToLower(GlobalProvider),
|
||||
EmptyVols: UpEmptyVols,
|
||||
Namespace: UpNamespace,
|
||||
InsecureRepository: UpInsecureRepo,
|
||||
IsNamespaceFlag: cmd.Flags().Lookup("namespace").Changed,
|
||||
}
|
||||
|
||||
// Validate before doing anything else.
|
||||
@@ -59,5 +62,6 @@ func init() {
|
||||
upCmd.Flags().BoolVar(&UpEmptyVols, "emptyvols", false, "Use empty volumes. Do not generate PersistentVolumeClaim")
|
||||
upCmd.Flags().IntVar(&UpReplicas, "replicas", 1, "Specify the number of replicas generated")
|
||||
upCmd.Flags().BoolVar(&UpInsecureRepo, "insecure-repository", false, "Use an insecure Docker repository for OpenShift ImageStream")
|
||||
upCmd.Flags().StringVar(&UpNamespace, "namespace", "default", "Specify Namespace to deploy your application")
|
||||
RootCmd.AddCommand(upCmd)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user