diff --git a/cmd/zz_gen_cmd_dnshelp.go b/cmd/zz_gen_cmd_dnshelp.go index f2628205..48a3721d 100644 --- a/cmd/zz_gen_cmd_dnshelp.go +++ b/cmd/zz_gen_cmd_dnshelp.go @@ -461,7 +461,6 @@ func displayDNSHelp(name string) error { ew.writeln(` - "OS_PASSWORD": Password`) ew.writeln(` - "OS_PROJECT_NAME": Project name`) ew.writeln(` - "OS_REGION_NAME": Region name`) - ew.writeln(` - "OS_TENANT_NAME": Tenant name (deprecated see OS_PROJECT_NAME and OS_PROJECT_ID)`) ew.writeln(` - "OS_USERNAME": Username`) ew.writeln() @@ -470,6 +469,7 @@ func displayDNSHelp(name string) error { ew.writeln(` - "DESIGNATE_PROPAGATION_TIMEOUT": Maximum waiting time for DNS propagation`) ew.writeln(` - "DESIGNATE_TTL": The TTL of the TXT record used for the DNS challenge`) ew.writeln(` - "OS_PROJECT_ID": Project ID`) + ew.writeln(` - "OS_TENANT_NAME": Tenant name (deprecated see OS_PROJECT_NAME and OS_PROJECT_ID)`) ew.writeln() ew.writeln(`More information: https://go-acme.github.io/lego/dns/designate`) diff --git a/docs/content/dns/zz_gen_designate.md b/docs/content/dns/zz_gen_designate.md index 5f3815ca..d2e1aab6 100644 --- a/docs/content/dns/zz_gen_designate.md +++ b/docs/content/dns/zz_gen_designate.md @@ -33,7 +33,6 @@ _Please contribute by adding a CLI example._ | `OS_PASSWORD` | Password | | `OS_PROJECT_NAME` | Project name | | `OS_REGION_NAME` | Region name | -| `OS_TENANT_NAME` | Tenant name (deprecated see OS_PROJECT_NAME and OS_PROJECT_ID) | | `OS_USERNAME` | Username | The environment variable names can be suffixed by `_FILE` to reference a file instead of a value. @@ -48,6 +47,7 @@ More information [here](/lego/dns/#configuration-and-credentials). | `DESIGNATE_PROPAGATION_TIMEOUT` | Maximum waiting time for DNS propagation | | `DESIGNATE_TTL` | The TTL of the TXT record used for the DNS challenge | | `OS_PROJECT_ID` | Project ID | +| `OS_TENANT_NAME` | Tenant name (deprecated see OS_PROJECT_NAME and OS_PROJECT_ID) | The environment variable names can be suffixed by `_FILE` to reference a file instead of a value. More information [here](/lego/dns/#configuration-and-credentials). diff --git a/providers/dns/designate/designate.go b/providers/dns/designate/designate.go index 99785fb4..c007932b 100644 --- a/providers/dns/designate/designate.go +++ b/providers/dns/designate/designate.go @@ -63,7 +63,7 @@ type DNSProvider struct { // NewDNSProvider returns a DNSProvider instance configured for Designate. // Credentials must be passed in the environment variables: -// OS_AUTH_URL, OS_USERNAME, OS_PASSWORD, OS_TENANT_NAME, OS_REGION_NAME. +// OS_AUTH_URL, OS_USERNAME, OS_PASSWORD, OS_REGION_NAME. // Or you can specify OS_CLOUD to read the credentials from the according cloud entry. func NewDNSProvider() (*DNSProvider, error) { config := NewDefaultConfig() @@ -80,7 +80,7 @@ func NewDNSProvider() (*DNSProvider, error) { config.opts = *opts } else { - _, err = env.Get(EnvAuthURL, EnvUsername, EnvPassword, EnvTenantName, EnvRegionName) + _, err = env.Get(EnvAuthURL, EnvUsername, EnvPassword, EnvRegionName) if err != nil { return nil, fmt.Errorf("designate: %w", err) } diff --git a/providers/dns/designate/designate.toml b/providers/dns/designate/designate.toml index 697a8f77..396a5b58 100644 --- a/providers/dns/designate/designate.toml +++ b/providers/dns/designate/designate.toml @@ -12,10 +12,10 @@ Example = '''''' OS_USERNAME = "Username" OS_PASSWORD = "Password" OS_PROJECT_NAME = "Project name" - OS_TENANT_NAME = "Tenant name (deprecated see OS_PROJECT_NAME and OS_PROJECT_ID)" OS_REGION_NAME = "Region name" [Configuration.Additional] OS_PROJECT_ID = "Project ID" + OS_TENANT_NAME = "Tenant name (deprecated see OS_PROJECT_NAME and OS_PROJECT_ID)" DESIGNATE_POLLING_INTERVAL = "Time between DNS propagation check" DESIGNATE_PROPAGATION_TIMEOUT = "Maximum waiting time for DNS propagation" DESIGNATE_TTL = "The TTL of the TXT record used for the DNS challenge" diff --git a/providers/dns/designate/designate_test.go b/providers/dns/designate/designate_test.go index ce4c49c4..5cf276b3 100644 --- a/providers/dns/designate/designate_test.go +++ b/providers/dns/designate/designate_test.go @@ -45,8 +45,7 @@ func TestNewDNSProvider_fromEnv(t *testing.T) { EnvUsername: "B", EnvPassword: "C", EnvRegionName: "D", - EnvTenantName: "E", - EnvProjectID: "F", + EnvProjectID: "E", }, }, { @@ -56,9 +55,8 @@ func TestNewDNSProvider_fromEnv(t *testing.T) { EnvUsername: "", EnvPassword: "", EnvRegionName: "", - EnvTenantName: "", }, - expected: "designate: some credentials information are missing: OS_AUTH_URL,OS_USERNAME,OS_PASSWORD,OS_TENANT_NAME,OS_REGION_NAME", + expected: "designate: some credentials information are missing: OS_AUTH_URL,OS_USERNAME,OS_PASSWORD,OS_REGION_NAME", }, { desc: "missing auth url", @@ -67,7 +65,6 @@ func TestNewDNSProvider_fromEnv(t *testing.T) { EnvUsername: "B", EnvPassword: "C", EnvRegionName: "D", - EnvTenantName: "E", }, expected: "designate: some credentials information are missing: OS_AUTH_URL", }, @@ -78,7 +75,6 @@ func TestNewDNSProvider_fromEnv(t *testing.T) { EnvUsername: "", EnvPassword: "C", EnvRegionName: "D", - EnvTenantName: "E", }, expected: "designate: some credentials information are missing: OS_USERNAME", }, @@ -89,7 +85,6 @@ func TestNewDNSProvider_fromEnv(t *testing.T) { EnvUsername: "B", EnvPassword: "", EnvRegionName: "D", - EnvTenantName: "E", }, expected: "designate: some credentials information are missing: OS_PASSWORD", }, @@ -100,21 +95,9 @@ func TestNewDNSProvider_fromEnv(t *testing.T) { EnvUsername: "B", EnvPassword: "C", EnvRegionName: "", - EnvTenantName: "E", }, expected: "designate: some credentials information are missing: OS_REGION_NAME", }, - { - desc: "missing tenant name", - envVars: map[string]string{ - EnvAuthURL: server.URL + "/v2.0/", - EnvUsername: "B", - EnvPassword: "C", - EnvRegionName: "D", - EnvTenantName: "", - }, - expected: "designate: some credentials information are missing: OS_TENANT_NAME", - }, } for _, test := range testCases { @@ -307,7 +290,7 @@ func getServer(t *testing.T) *httptest.Server { "user": { "name": "a", "roles": [ ], - "role_links": [ ] + "role_links": [ ] }, "serviceCatalog": [ {