public override ICommandLineParserResult ParseArgs(string[] args)
 {
     SetFlag <string>("name", "The name used for the deployment and other artifacts in kubernetes", n =>
     {
         KubernetesHelper.ValidateKubernetesName(n);
         Name = n;
     }, isRequired: true);
     SetFlag <string>("image-name", "Image to use for the pod deployment and to read functions from", n => ImageName = n);
     SetFlag <string>("registry", "When set, a docker build is run and the image is pushed to that registry/name. This is mutually exclusive with --image-name. For docker hub, use username.", r => Registry = r);
     SetFlag <string>("namespace", "Kubernetes namespace to deploy to. Default: default", ns => Namespace = ns);
     SetFlag <string>("pull-secret", "The secret holding a private registry credentials", s => PullSecret = s);
     SetFlag <int>("polling-interval", "The polling interval for checking non-http triggers. Default: 30 (seconds)", p => PollingInterval = p);
     SetFlag <int>("cooldown-period", "The cooldown period for the deployment before scaling back to 0 after all triggers are no longer active. Default: 300 (seconds)", p => CooldownPeriod = p);
     SetFlag <int>("min-replicas", "Minimum replica count", m => MinReplicaCount = m);
     SetFlag <int>("max-replicas", "Maximum replica count to scale to by HPA", m => MaxReplicaCount = m);
     SetFlag <string>("keys-secret-name", "The name of a kubernetes secret collection to use for the function app keys (host keys, function keys etc.)", ksn => KeysSecretCollectionName = ksn);
     SetFlag <bool>("mount-funckeys-as-containervolume", "The flag indicating to mount the func app keys as container volume", kmv => MountFuncKeysAsContainerVolume = kmv);
     SetFlag <string>("secret-name", "The name of an existing kubernetes secret collection, containing func app settings, to use in the deployment instead of creating new a new one based upon local.settings.json", sn => SecretsCollectionName = sn);
     SetFlag <string>("config-map-name", "The name of an existing config map with func app settings to use in the deployment", cm => ConfigMapName = cm);
     SetFlag <string>("service-type", "Kubernetes Service Type. Default LoadBalancer  Valid options: " + string.Join(",", ServiceTypes), s =>
     {
         if (!string.IsNullOrEmpty(s) && !ServiceTypes.Contains(s))
         {
             throw new CliArgumentsException($"serviceType {ServiceType} is not supported. Valid options are: {string.Join(",", ServiceTypes)}");
         }
         ServiceType = s;
     });
     SetFlag <bool>("no-docker", "With --image-name, the core-tools will inspect the functions inside the image. This will require mounting the image filesystem. Passing --no-docker uses current directory for functions.", nd => NoDocker = nd);
     SetFlag <bool>("use-config-map", "Use a ConfigMap/V1 instead of a Secret/V1 object for function app settings configurations", c => UseConfigMap = c);
     SetFlag <bool>("dry-run", "Show the deployment template", f => DryRun = f);
     SetFlag <bool>("ignore-errors", "Proceed with the deployment if a resource returns an error. Default: false", f => IgnoreErrors = f);
     return(base.ParseArgs(args));
 }
 public void ValidateKubernetesNames(string name, bool isValid)
 {
     try
     {
         KubernetesHelper.ValidateKubernetesName(name);
     }
     catch
     {
         if (isValid)
         {
             throw;
         }
     }
 }