Fix upcoming gocritic lints

In preparation for a golangci-lint upgrade: Deprecation notices should
be in a dedicated paragraph. Also add some extra blank lines in places
where things were too densely packed.

Signed-off-by: Tom Wieczorek <twieczorek@mirantis.com>
This commit is contained in:
Tom Wieczorek committed 2025-11-18 09:45:59 +01:00
1 parent e28bcdad24
commit ec85b9959c
7 files changed
+20

No files matched your search

+1
View File
@@ -12,6 +12,7 @@ import (
)
// NewFakeClientFactory creates new client factory
//
// Deprecated: Use [k0stestutil.NewFakeClientFactory] instead.
func NewFakeClientFactory() client.FactoryInterface {
return &fakeClientFactory{
@@ -87,9 +87,12 @@ type UpgradeStrategy struct {
// Type defines the type of upgrade strategy
// +kubebuilder:validation:Enum=periodic;cron
Type string `json:"type,omitempty"`
// Cron defines the cron expression for the cron upgrade strategy
//
// Deprecated: Cron is deprecated and will eventually be ignored
Cron string `json:"cron,omitempty"`
// Periodic defines the periodic upgrade strategy
//
// +optional
+11
View File
@@ -10,30 +10,41 @@ type KubeRouter struct {
// Auto-detection of used MTU (default: true)
// +kubebuilder:default=true
AutoMTU *bool `json:"autoMTU,omitempty"`
// Override MTU setting (autoMTU must be set to false)
MTU int `json:"mtu,omitempty"`
// Kube-router metrics server port. Set to 0 to disable metrics (default: 8080)
MetricsPort int `json:"metricsPort,omitempty"`
// Admits three values: "Enabled" enables it globally, "Allowed" allows but services must be annotated explicitly and "Disabled"
// Defaults to "Enabled"
// +kubebuilder:default=Enabled
Hairpin Hairpin `json:"hairpin,omitempty"`
// Deprecated: Use hairpin instead. Activates Hairpin Mode (allow a Pod behind a Service to communicate to its own ClusterIP:Port)
//+kubebuilder:deprecatedversion:warning="Use hairpin instead. Activates Hairpin Mode (allow a Pod behind a Service to communicate to its own ClusterIP:Port)"
HairpinMode bool `json:"hairpinMode,omitempty"`
// IP masquerade for traffic originating from the pod network, and destined outside of it (default: false)
IPMasq bool `json:"ipMasq,omitempty"`
// Comma-separated list of global peer addresses
//
// Deprecated: Use extraArgs with peerRouterASNs instead
//+kubebuilder:deprecatedversion:warning="Use extraArgs with peerRouterASNs instead"
PeerRouterASNs string `json:"peerRouterASNs,omitempty"`
// Comma-separated list of global peer ASNs
//
// Deprecated: Use extraArgs with peerRouterIPs instead
//+kubebuilder:deprecatedversion:warning="Use extraArgs with peerRouterIPs instead"
PeerRouterIPs string `json:"peerRouterIPs,omitempty"`
// ExtraArgs are extra arguments to pass to kube-router
// Can be also used to override the default k0s managed kube-router arguments
ExtraArgs map[string]string `json:"extraArgs,omitempty"`
// Slice of strings with raw arguments to pass to the kube-router process
// These arguments will be appended to the `ExtraArgs` and aren't validated at all.
// ExtraArgs are recommended over RawArgs. If possible use ExtraArgs to set arguments.
+1
View File
@@ -14,6 +14,7 @@ import (
)
// FactoryInterface is a collection of kubernetes clientset interfaces.
//
// Deprecated: Use [kubeutil.ClientFactoryInterface] instead.
type FactoryInterface interface {
GetClient() (kubernetes.Interface, error)
+1
View File
@@ -53,6 +53,7 @@ func (p *provider) InstancesV2() (cloudprovider.InstancesV2, bool) {
}
// Zones returns a zones interface. Also returns true if the interface is supported, false otherwise.
//
// Deprecated: Zones is deprecated in favor of retrieving zone/region information from InstancesV2.
// This interface will not be called if InstancesV2 is enabled.
func (p *provider) Zones() (cloudprovider.Zones, bool) {
@@ -246,6 +246,7 @@ spec:
cron:
description: |-
Cron defines the cron expression for the cron upgrade strategy
Deprecated: Cron is deprecated and will eventually be ignored
type: string
periodic:
@@ -908,11 +908,13 @@ spec:
peerRouterASNs:
description: |-
Comma-separated list of global peer addresses
Deprecated: Use extraArgs with peerRouterASNs instead
type: string
peerRouterIPs:
description: |-
Comma-separated list of global peer ASNs
Deprecated: Use extraArgs with peerRouterIPs instead
type: string
rawArgs: