fix: Resolve cloudns reference error#8293
Conversation
|
Adding the "do-not-merge/release-note-label-needed" label because no release-note block was detected, please follow our release note process to remove it. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
| p, err = cloudns.NewDNSProviderConfig(cloudnsConfig) | ||
| case FreeMyIP: | ||
| freeMyIpConfig := freemyip.NewDefaultConfig() | ||
| freeMyIpConfig.Token = param.Token |
There was a problem hiding this comment.
The changes you made do not appear to introduce any significant errors or irregularities. However, there are a few minor improvements that could be made for clarity and maintainability:
-
Consistency: Ensure consistency between struct fields and variable names. For example, all fields related to authentication should use camelCase.
-
Comment Removal: The comment after the first change set is redundant since it mirrors the preceding line.
-
Variable Naming: While this patch does not directly affect functionality, renaming variables like
APIkeytoapiKeycan improve readability in some contexts.
Here's an updated version of your code with these considerations:
import (
"github.com/go-acme/lego/v4/lego"
"github.com/go-acme/lego/v4/providers/dns/alidns"
"github.com/go-acme/lego/v4/providers/dns/clouddns"
"github.com/go-acme/lego/v4/providers/dns/cloudns"
"github.com/go-acme/lego/v4/providers/dns/cloudflare"
"github.com/go-acme/lego/v4/providers/dns/dnspod"
"github.com/go-acme/lego/v4/providers/dns/godaddy"
"github.com/go-acme/lego/v4/providers/dns/huaweicloud"
)
type DNSParam struct {
ID string `json:"id"`
Token string `json:"token"`
AccessKey string `json:"accessKey"`
SecretKey string `json:"secretKey"`
Email string `json:"email"`
APIkey string `json:"apikey"` // Updated field name for better readability
APIUser string `json:"apiUser"`
APISecret string `json:"apiSecret"`
SecretID string `json:"secretID"`
Region string `json:"region"`
ClientID string `json:"clientID"`
Password string `json:"password"`
AuthID string `json:"authID"`
SubAuthID string `json:"subAuthID"`
AuthPassword string `json:"authPassword"`
}
var (
defaultProviders map[DnsType]DNSProviderFactory = Providers{
HuaweiCloud: &HuaWeiCloudDNS{},
DNSPod: &DNSPODDNS{},
GoodDaddy: &GoodDaddyDNS{},
AliyunDNS: &AlibabaCloudDNS{},
Akamai: &AkamaiDNS{},
}
)
func init() {
initCaching()
for i := range defaultProviders {
factory := defaultProviders[i]
Register(factory.Name(), factory.FactoryFunc())
log.Printf("[INFO] Register %s provider", i)
}
}
// AcmeClient defines methods used for creating ACME challenge solvers.
type AcmeClient struct {
Config Config
}
type Solver interface {
Network(context.Context) error
}
|
|
/approve |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: wanghe-fit2cloud The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |



No description provided.