Skip to content

Commit d3c5c5d

Browse files
Merge pull request #27473 from lsm5/deprecation-notice-update
golangci-lint bump and deprecation cleanups
2 parents ac2d567 + f47f74c commit d3c5c5d

File tree

16 files changed

+25
-78
lines changed

16 files changed

+25
-78
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ BUILDTAGS += ${EXTRA_BUILDTAGS}
7171
# N/B: This value is managed by Renovate, manual changes are
7272
# possible, as long as they don't disturb the formatting
7373
# (i.e. DO NOT ADD A 'v' prefix!)
74-
GOLANGCI_LINT_VERSION := 2.5.0
74+
GOLANGCI_LINT_VERSION := 2.6.0
7575
PYTHON ?= $(shell command -v python3 python|head -n1)
7676
PKG_MANAGER ?= $(shell command -v dnf yum|head -n1)
7777
# ~/.local/bin is not in PATH on all systems

libpod/container_config.go

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -250,16 +250,6 @@ type ContainerNetworkConfig struct {
250250
// network namespace for the container.
251251
// This cannot be set if NetNsCtr is also set.
252252
CreateNetNS bool `json:"createNetNS"`
253-
// StaticIP is a static IP to request for the container.
254-
// This cannot be set unless CreateNetNS is set.
255-
// If not set, the container will be dynamically assigned an IP by CNI.
256-
// Deprecated: Do no use this anymore, this is only for DB backwards compat.
257-
StaticIP net.IP `json:"staticIP,omitempty"`
258-
// StaticMAC is a static MAC to request for the container.
259-
// This cannot be set unless CreateNetNS is set.
260-
// If not set, the container will be dynamically assigned a MAC by CNI.
261-
// Deprecated: Do no use this anymore, this is only for DB backwards compat.
262-
StaticMAC types.HardwareAddr `json:"staticMAC,omitempty"`
263253
// PortMappings are the ports forwarded to the container's network
264254
// namespace
265255
// These are not used unless CreateNetNS is true
@@ -314,6 +304,7 @@ type ContainerNetworkConfig struct {
314304
// Please note that these can be altered at runtime. The actual list is
315305
// stored in the DB and should be retrieved from there; this is only the
316306
// set of networks the container was *created* with.
307+
//
317308
// Deprecated: Do no use this anymore, this is only for DB backwards compat.
318309
// Also note that we need to keep the old json tag to decode from DB correctly
319310
NetworksDeprecated []string `json:"networks,omitempty"`

libpod/container_internal.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ import (
5050
cutil "go.podman.io/common/pkg/util"
5151
"go.podman.io/storage"
5252
"go.podman.io/storage/pkg/chrootarchive"
53+
"go.podman.io/storage/pkg/directory"
5354
"go.podman.io/storage/pkg/fileutils"
5455
"go.podman.io/storage/pkg/idmap"
5556
"go.podman.io/storage/pkg/idtools"
@@ -100,8 +101,8 @@ func (c *Container) rootFsSize() (int64, error) {
100101
// for a given container.
101102
func (c *Container) rwSize() (int64, error) {
102103
if c.config.Rootfs != "" {
103-
size, err := util.SizeOfPath(c.config.Rootfs)
104-
return int64(size), err
104+
size, err := directory.Size(c.config.Rootfs)
105+
return size, err
105106
}
106107

107108
layerSize, err := c.runtime.store.ContainerSize(c.ID())

libpod/container_validate.go

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -80,16 +80,6 @@ func (c *Container) validate() error {
8080
}
8181
}
8282

83-
// Can only set static IP or MAC is creating a network namespace.
84-
if !c.config.CreateNetNS && (c.config.StaticIP != nil || c.config.StaticMAC != nil) {
85-
return fmt.Errorf("cannot set static IP or MAC address if not creating a network namespace: %w", define.ErrInvalidArg)
86-
}
87-
88-
// Cannot set static IP or MAC if joining >1 network.
89-
if len(c.config.Networks) > 1 && (c.config.StaticIP != nil || c.config.StaticMAC != nil) {
90-
return fmt.Errorf("cannot set static IP or MAC address if joining more than one network: %w", define.ErrInvalidArg)
91-
}
92-
9383
// Using image resolv.conf conflicts with various DNS settings.
9484
if c.config.UseImageResolvConf &&
9585
(len(c.config.DNSSearch) > 0 || len(c.config.DNSServer) > 0 ||

libpod/pod_api.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -667,7 +667,6 @@ func (p *Pod) Inspect() (*define.InspectPodData, error) {
667667
}
668668
infraConfig = new(define.InspectPodInfraConfig)
669669
infraConfig.HostNetwork = p.NetworkMode() == "host"
670-
infraConfig.StaticIP = infra.config.ContainerNetworkConfig.StaticIP
671670
infraConfig.NoManageResolvConf = infra.config.UseImageResolvConf
672671
infraConfig.NoManageHostname = infra.config.UseImageHostname
673672
infraConfig.NoManageHosts = infra.config.UseImageHosts

libpod/runtime_ctr.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -205,11 +205,6 @@ func (r *Runtime) initContainerVariables(rSpec *spec.Spec, config *ContainerConf
205205
}
206206
// Reset the log path to point to the default
207207
ctr.config.LogPath = ""
208-
// Later in validate() the check is for nil. JSONDeepCopy sets it to an empty
209-
// object. Resetting it to nil if it was nil before.
210-
if config.StaticMAC == nil {
211-
ctr.config.StaticMAC = nil
212-
}
213208
}
214209

215210
ctr.config.Spec = rSpec

pkg/bindings/containers/types.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,7 @@ type WaitOptions struct {
238238
// Time interval to wait before polling for completion.
239239
Interval *string
240240
// Container status to wait on.
241+
//
241242
// Deprecated: use Conditions instead.
242243
Condition []define.ContainerStatus
243244
}

pkg/checkpoint/checkpoint_restore.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,8 +139,6 @@ func CRImportCheckpoint(ctx context.Context, runtime *libpod.Runtime, restoreOpt
139139
opts.StaticMAC = nil
140140
ctrConfig.Networks[net] = opts
141141
}
142-
ctrConfig.StaticIP = nil
143-
ctrConfig.StaticMAC = nil
144142
}
145143

146144
if ctrConfig.PIDNsCtr != "" {

pkg/k8s.io/api/core/v1/annotation_key_constants.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,15 +36,18 @@ const (
3636

3737
// SeccompPodAnnotationKey represents the key of a seccomp profile applied
3838
// to all containers of a pod.
39+
//
3940
// Deprecated: set a pod security context `seccompProfile` field.
4041
SeccompPodAnnotationKey string = "seccomp.security.alpha.kubernetes.io/pod"
4142

4243
// SeccompContainerAnnotationKeyPrefix represents the key of a seccomp profile applied
4344
// to one container of a pod.
45+
//
4446
// Deprecated: set a container security context `seccompProfile` field.
4547
SeccompContainerAnnotationKeyPrefix string = "container.seccomp.security.alpha.kubernetes.io/"
4648

4749
// SeccompProfileRuntimeDefault represents the default seccomp profile used by container runtime.
50+
//
4851
// Deprecated: set a pod or container security context `seccompProfile` of type "RuntimeDefault" instead.
4952
SeccompProfileRuntimeDefault string = "runtime/default"
5053

@@ -71,6 +74,7 @@ const (
7174
AppArmorBetaProfileNameUnconfined = "unconfined"
7275

7376
// DeprecatedSeccompProfileDockerDefault represents the default seccomp profile used by docker.
77+
//
7478
// Deprecated: set a pod or container security context `seccompProfile` of type "RuntimeDefault" instead.
7579
DeprecatedSeccompProfileDockerDefault string = "docker/default"
7680

pkg/k8s.io/api/core/v1/types.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1463,6 +1463,7 @@ const (
14631463
PodFailed PodPhase = "Failed"
14641464
// PodUnknown means that for some reason the state of the pod could not be obtained, typically due
14651465
// to an error in communicating with the host of the pod.
1466+
//
14661467
// Deprecated: It isn't being set since 2015 (74da3b14b0c0f658b3bb8d2def5094686d0e9095)
14671468
PodUnknown PodPhase = "Unknown"
14681469
)
@@ -1882,6 +1883,7 @@ type PodSpec struct {
18821883
// +optional
18831884
ServiceAccountName string `json:"serviceAccountName,omitempty"`
18841885
// DeprecatedServiceAccount is a depreciated alias for ServiceAccountName.
1886+
//
18851887
// Deprecated: Use serviceAccountName instead.
18861888
// +k8s:conversion-gen=false
18871889
// +optional
@@ -4272,6 +4274,7 @@ type ComponentCondition struct {
42724274
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
42734275

42744276
// ComponentStatus (and ComponentStatusList) holds the cluster validation info.
4277+
//
42754278
// Deprecated: This API is deprecated in v1.19+
42764279
type ComponentStatus struct {
42774280
metav1.TypeMeta `json:",inline"`
@@ -4290,6 +4293,7 @@ type ComponentStatus struct {
42904293
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
42914294

42924295
// Status of all the conditions for the component as a list of ComponentStatus objects.
4296+
//
42934297
// Deprecated: This API is deprecated in v1.19+
42944298
type ComponentStatusList struct {
42954299
metav1.TypeMeta `json:",inline"`

0 commit comments

Comments
 (0)