Skip to content

fix: Resolve cloudns reference error#8293

Merged
f2c-ci-robot[bot] merged 1 commit intodevfrom
pr@dev@fix_cloudns
Apr 2, 2025
Merged

fix: Resolve cloudns reference error#8293
f2c-ci-robot[bot] merged 1 commit intodevfrom
pr@dev@fix_cloudns

Conversation

@ssongliu
Copy link
Copy Markdown
Member

@ssongliu ssongliu commented Apr 2, 2025

No description provided.

@f2c-ci-robot
Copy link
Copy Markdown

f2c-ci-robot Bot commented Apr 2, 2025

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.

Details

Instructions 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
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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:

  1. Consistency: Ensure consistency between struct fields and variable names. For example, all fields related to authentication should use camelCase.

  2. Comment Removal: The comment after the first change set is redundant since it mirrors the preceding line.

  3. Variable Naming: While this patch does not directly affect functionality, renaming variables like APIkey to apiKey can 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
}

@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented Apr 2, 2025

Copy link
Copy Markdown
Member

@wanghe-fit2cloud wanghe-fit2cloud left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@wanghe-fit2cloud
Copy link
Copy Markdown
Member

/approve

@f2c-ci-robot
Copy link
Copy Markdown

f2c-ci-robot Bot commented Apr 2, 2025

[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

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@f2c-ci-robot f2c-ci-robot Bot added the approved label Apr 2, 2025
@f2c-ci-robot f2c-ci-robot Bot merged commit d96fe49 into dev Apr 2, 2025
6 checks passed
@f2c-ci-robot f2c-ci-robot Bot deleted the pr@dev@fix_cloudns branch April 2, 2025 03:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants