feat: disable network policies generation by default (#1629)

* feat: disable network policies default generation

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

* docs: add the generate-network-policies flag to user guide

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

* test: add unit tests of the network policies generation

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

---------

Signed-off-by: AhmedGrati <ahmedgrati1999@gmail.com>
This commit is contained in:
AhmedGrati
2023-07-05 11:26:37 +01:00
committed by GitHub
parent 485cd2f163
commit f7bee839ce
28 changed files with 112 additions and 423 deletions
+3
View File
@@ -50,6 +50,7 @@ var (
ConvertPushImageRegistry string
ConvertOpt kobject.ConvertOptions
ConvertYAMLIndent int
GenerateNetworkPolicies bool
UpBuild string
@@ -116,6 +117,7 @@ var convertCmd = &cobra.Command{
ServiceGroupMode: ServiceGroupMode,
ServiceGroupName: ServiceGroupName,
SecretsAsFiles: SecretsAsFiles,
GenerateNetworkPolicies: GenerateNetworkPolicies,
}
if ServiceGroupMode == "" && MultipleContainerMode {
@@ -178,6 +180,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().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")