From 2d35a891329764fda863a65ccc10d3fe8ed0aead Mon Sep 17 00:00:00 2001 From: "Alex Ellis (OpenFaaS Ltd)" Date: Wed, 12 Jun 2024 17:24:10 +0100 Subject: [PATCH] Add region for Hetzner for inlets-operator app Signed-off-by: Alex Ellis (OpenFaaS Ltd) --- cmd/apps/inletsoperator_app.go | 10 +++++----- cmd/apps/{kyverno.go => kyverno_app.go} | 0 cmd/apps/openfaas_ingress_app.go | 6 +++--- 3 files changed, 8 insertions(+), 8 deletions(-) rename cmd/apps/{kyverno.go => kyverno_app.go} (100%) diff --git a/cmd/apps/inletsoperator_app.go b/cmd/apps/inletsoperator_app.go index e8e33f684..7b6279b44 100644 --- a/cmd/apps/inletsoperator_app.go +++ b/cmd/apps/inletsoperator_app.go @@ -37,10 +37,10 @@ IngressController`, } inletsOperator.Flags().StringP("namespace", "n", "default", "The namespace used for installation") - inletsOperator.Flags().StringP("license", "l", "", "The license key for inlets PRO") - inletsOperator.Flags().StringP("license-file", "f", "$HOME/.inlets/LICENSE", "Path to license JWT file for inlets PRO") + inletsOperator.Flags().StringP("license", "l", "", "The license key for inlets") + inletsOperator.Flags().StringP("license-file", "f", "$HOME/.inlets/LICENSE", "Path to license JWT file for inlets") - inletsOperator.Flags().StringP("provider", "p", "digitalocean", "Your infrastructure provider - 'equinix-metal', 'digitalocean', 'scaleway', 'linode', 'civo', 'gce', 'ec2', 'azure', 'hetzner'") + inletsOperator.Flags().StringP("provider", "p", "digitalocean", "Your infrastructure provider - 'digitalocean', 'scaleway', 'linode', 'gce', 'ec2', 'azure', 'hetzner'") inletsOperator.Flags().StringP("zone", "z", "us-central1-a", "The zone to provision the exit node (GCE)") inletsOperator.Flags().String("project-id", "", "Project ID to be used (for GCE and Equinix Metal)") inletsOperator.Flags().StringP("region", "r", "lon1", "The default region to provision the exit node (DigitalOcean, Equinix Metal and Scaleway)") @@ -170,7 +170,7 @@ IngressController`, licenseFile, _ := command.Flags().GetString("license-file") fileFlagChanged := command.Flags().Changed("license-file") - noLicenseErr := fmt.Errorf("--license or --license-file is required for inlets PRO") + noLicenseErr := fmt.Errorf("--license or --license-file is required for inlets") if len(license) == 0 { if len(licenseFile) > 0 { licenseFile = os.ExpandEnv(licenseFile) @@ -320,7 +320,7 @@ func getInletsOperatorOverrides(command *cobra.Command) (map[string]string, erro return overrides, fmt.Errorf("region is required for provider %s", provider) } - validHetznerRegions := []string{"fsn1", "nbg1", "hel1"} + validHetznerRegions := []string{"fsn1", "nbg1", "hel1", "eu-central"} foundRegion := false for _, validRegion := range validHetznerRegions { if validRegion == userInputRegion { diff --git a/cmd/apps/kyverno.go b/cmd/apps/kyverno_app.go similarity index 100% rename from cmd/apps/kyverno.go rename to cmd/apps/kyverno_app.go diff --git a/cmd/apps/openfaas_ingress_app.go b/cmd/apps/openfaas_ingress_app.go index de2d06151..507810595 100644 --- a/cmd/apps/openfaas_ingress_app.go +++ b/cmd/apps/openfaas_ingress_app.go @@ -112,7 +112,7 @@ func MakeInstallOpenFaaSIngress() *cobra.Command { } func createIssuer(domain, email, ingressClass, ingressName string, staging bool, clusterIssuer bool, namespace string) error { - yamlBytes, templateErr := buildIssuerYAML(domain, email, ingressClass, ingressName, staging, clusterIssuer, namespace) + yamlBytes, templateErr := buildIssuerYAML(email, ingressClass, staging, clusterIssuer, namespace) if templateErr != nil { log.Print("Unable to install the application. Could not build the templated yaml file for the resources") return templateErr @@ -132,7 +132,7 @@ func createIssuer(domain, email, ingressClass, ingressName string, staging bool, } if res.ExitCode != 0 { - return fmt.Errorf(`Unable to apply YAML files. + return fmt.Errorf(`unable to apply YAML files. Have you got OpenFaaS running in the openfaas namespace and cert-manager 1.0.0 or higher installed in cert-manager namespace? %s`, res.Stderr) } @@ -237,7 +237,7 @@ func buildOpenfaasIngressYAML(domain, email, ingressClass, ingressName string, s return tpl.Bytes(), nil } -func buildIssuerYAML(domain, email, ingressClass, ingressName string, staging, clusterIssuer bool, namespace string) ([]byte, error) { +func buildIssuerYAML(email, ingressClass string, staging, clusterIssuer bool, namespace string) ([]byte, error) { templ, err := template.New("issuer-yaml").Parse(http01IssuerTemplate) if err != nil {