Merge pull request #5418 from gofogo/chore-code-quality-added-linters-v0

chore(codebase): add linters for json/yaml tags
This commit is contained in:
Kubernetes Prow Robot 2025-05-18 23:51:15 -07:00 committed by GitHub
commit f7442dc696
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 25 additions and 23 deletions

View File

@ -14,6 +14,8 @@ linters:
- unconvert
- unused
- whitespace
- decorder # Check declaration order and count of types, constants, variables and functions. https://golangci-lint.run/usage/linters/#decorder
- tagalign # Check that struct tags are well aligned. https://golangci-lint.run/usage/linters/#tagalign
- predeclared # Find code that shadows one of Go's predeclared identifiers
- sloglint # Ensure consistent code style when using log/slog
- asciicheck # Checks that all code identifiers does not have non-ASCII symbols in the name

View File

@ -85,13 +85,13 @@ type AlibabaCloudProvider struct {
}
type alibabaCloudConfig struct {
RegionID string `json:"regionId" yaml:"regionId"`
AccessKeyID string `json:"accessKeyId" yaml:"accessKeyId"`
RegionID string `json:"regionId" yaml:"regionId"`
AccessKeyID string `json:"accessKeyId" yaml:"accessKeyId"`
AccessKeySecret string `json:"accessKeySecret" yaml:"accessKeySecret"`
VPCID string `json:"vpcId" yaml:"vpcId"`
RoleName string `json:"-" yaml:"-"` // For ECS RAM role only
StsToken string `json:"-" yaml:"-"`
ExpireTime time.Time `json:"-" yaml:"-"`
VPCID string `json:"vpcId" yaml:"vpcId"`
RoleName string `json:"-" yaml:"-"` // For ECS RAM role only
StsToken string `json:"-" yaml:"-"`
ExpireTime time.Time `json:"-" yaml:"-"`
}
// NewAlibabaCloudProvider creates a new Alibaba Cloud provider.

View File

@ -35,16 +35,16 @@ import (
// config represents common config items for Azure DNS and Azure Private DNS
type config struct {
Cloud string `json:"cloud" yaml:"cloud"`
TenantID string `json:"tenantId" yaml:"tenantId"`
SubscriptionID string `json:"subscriptionId" yaml:"subscriptionId"`
ResourceGroup string `json:"resourceGroup" yaml:"resourceGroup"`
Location string `json:"location" yaml:"location"`
ClientID string `json:"aadClientId" yaml:"aadClientId"`
ClientSecret string `json:"aadClientSecret" yaml:"aadClientSecret"`
UseManagedIdentityExtension bool `json:"useManagedIdentityExtension" yaml:"useManagedIdentityExtension"`
Cloud string `json:"cloud" yaml:"cloud"`
TenantID string `json:"tenantId" yaml:"tenantId"`
SubscriptionID string `json:"subscriptionId" yaml:"subscriptionId"`
ResourceGroup string `json:"resourceGroup" yaml:"resourceGroup"`
Location string `json:"location" yaml:"location"`
ClientID string `json:"aadClientId" yaml:"aadClientId"`
ClientSecret string `json:"aadClientSecret" yaml:"aadClientSecret"`
UseManagedIdentityExtension bool `json:"useManagedIdentityExtension" yaml:"useManagedIdentityExtension"`
UseWorkloadIdentityExtension bool `json:"useWorkloadIdentityExtension" yaml:"useWorkloadIdentityExtension"`
UserAssignedIdentityID string `json:"userAssignedIdentityID" yaml:"userAssignedIdentityID"`
UserAssignedIdentityID string `json:"userAssignedIdentityID" yaml:"userAssignedIdentityID"`
ActiveDirectoryAuthorityHost string `json:"activeDirectoryAuthorityHost" yaml:"activeDirectoryAuthorityHost"`
}

View File

@ -186,11 +186,11 @@ type IBMCloudProvider struct {
}
type ibmcloudConfig struct {
Endpoint string `json:"endpoint" yaml:"endpoint"`
APIKey string `json:"apiKey" yaml:"apiKey"`
Endpoint string `json:"endpoint" yaml:"endpoint"`
APIKey string `json:"apiKey" yaml:"apiKey"`
CRN string `json:"instanceCrn" yaml:"instanceCrn"`
IAMURL string `json:"iamUrl" yaml:"iamUrl"`
InstanceID string `json:"-" yaml:"-"`
IAMURL string `json:"iamUrl" yaml:"iamUrl"`
InstanceID string `json:"-" yaml:"-"`
}
// ibmcloudChange differentiates between ChangActions

View File

@ -75,10 +75,10 @@ type TencentCloudProvider struct {
}
type tencentCloudConfig struct {
RegionId string `json:"regionId" yaml:"regionId"`
SecretId string `json:"secretId" yaml:"secretId"`
SecretKey string `json:"secretKey" yaml:"secretKey"`
VPCId string `json:"vpcId" yaml:"vpcId"`
RegionId string `json:"regionId" yaml:"regionId"`
SecretId string `json:"secretId" yaml:"secretId"`
SecretKey string `json:"secretKey" yaml:"secretKey"`
VPCId string `json:"vpcId" yaml:"vpcId"`
InternetEndpoint bool `json:"internetEndpoint" yaml:"internetEndpoint"`
}