summaryrefslogtreecommitdiff
path: root/pkg/specgen/generate
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2022-04-22 08:26:31 -0400
committerGitHub <noreply@github.com>2022-04-22 08:26:31 -0400
commit22500d797aba09eada894a69ad88f2699a560d02 (patch)
tree009b712a567ee4fd25fb4e8961e47cb0a4c8e684 /pkg/specgen/generate
parent04acbaa4b161b23e93b990321582b1586d86f2a8 (diff)
parent1514d5c933510228dfa8bb9b6c020af3f266060f (diff)
downloadpodman-22500d797aba09eada894a69ad88f2699a560d02.tar.gz
podman-22500d797aba09eada894a69ad88f2699a560d02.tar.bz2
podman-22500d797aba09eada894a69ad88f2699a560d02.zip
Merge pull request #13972 from Luap99/staticcheck
enable staticcheck linter
Diffstat (limited to 'pkg/specgen/generate')
-rw-r--r--pkg/specgen/generate/kube/kube.go6
1 files changed, 2 insertions, 4 deletions
diff --git a/pkg/specgen/generate/kube/kube.go b/pkg/specgen/generate/kube/kube.go
index df751a780..51f9fa535 100644
--- a/pkg/specgen/generate/kube/kube.go
+++ b/pkg/specgen/generate/kube/kube.go
@@ -82,7 +82,7 @@ func ToPodOpt(ctx context.Context, podName string, p entities.PodCreateOptions,
}
// dns options
if options := dnsConfig.Options; len(options) > 0 {
- dnsOptions := make([]string, 0)
+ dnsOptions := make([]string, 0, len(options))
for _, opts := range options {
d := opts.Name
if opts.Value != nil {
@@ -90,6 +90,7 @@ func ToPodOpt(ctx context.Context, podName string, p entities.PodCreateOptions,
}
dnsOptions = append(dnsOptions, d)
}
+ p.Net.DNSOptions = dnsOptions
}
}
return p, nil
@@ -281,9 +282,6 @@ func ToSpecGen(ctx context.Context, opts *CtrSpecGenOptions) (*specgen.SpecGener
annotations = opts.Annotations
}
if opts.PodInfraID != "" {
- if annotations == nil {
-
- }
annotations[ann.SandboxID] = opts.PodInfraID
annotations[ann.ContainerType] = ann.ContainerTypeContainer
}