Feat add ns generation (#1667)

* feat: add ns generation for k8s

Signed-off-by: AhmedGrati <ahmedgrati1999@gmail.com>

* feat: add ns generation for openshift

Signed-off-by: AhmedGrati <ahmedgrati1999@gmail.com>

* test: add functional tests

Signed-off-by: AhmedGrati <ahmedgrati1999@gmail.com>

* fix: remove some code nits

Signed-off-by: AhmedGrati <ahmedgrati1999@gmail.com>

---------

Signed-off-by: AhmedGrati <ahmedgrati1999@gmail.com>
This commit is contained in:
AhmedGrati
2023-07-16 22:59:16 +01:00
committed by GitHub
parent 071451dfdf
commit b6b708b637
14 changed files with 291 additions and 1 deletions
+3
View File
@@ -47,6 +47,7 @@ var (
ConvertReplicas int
ConvertController string
ConvertPushImage bool
ConvertNamespace string
ConvertPushImageRegistry string
ConvertOpt kobject.ConvertOptions
ConvertYAMLIndent int
@@ -122,6 +123,7 @@ var convertCmd = &cobra.Command{
GenerateNetworkPolicies: GenerateNetworkPolicies,
BuildCommand: BuildCommand,
PushCommand: PushCommand,
Namespace: ConvertNamespace,
}
if ServiceGroupMode == "" && MultipleContainerMode {
@@ -186,6 +188,7 @@ func init() {
convertCmd.Flags().IntVar(&ConvertReplicas, "replicas", 1, "Specify the number of replicas in the generated resource spec")
convertCmd.Flags().StringVar(&ConvertVolumes, "volumes", "persistentVolumeClaim", `Volumes to be generated ("persistentVolumeClaim"|"emptyDir"|"hostPath" | "configMap")`)
convertCmd.Flags().StringVar(&ConvertPVCRequestSize, "pvc-request-size", "", `Specify the size of pvc storage requests in the generated resource spec`)
convertCmd.Flags().StringVarP(&ConvertNamespace, "namespace", "n", "", `Specify the namespace of the generated resources`)
convertCmd.Flags().BoolVar(&GenerateNetworkPolicies, "generate-network-policies", false, "Specify whether to generate network policies or not.")
convertCmd.Flags().BoolVar(&WithKomposeAnnotation, "with-kompose-annotation", true, "Add kompose annotations to generated resource")