Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
09051940
Unverified
Commit
09051940
authored
Sep 19, 2018
by
k8s-ci-robot
Committed by
GitHub
Sep 19, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #68830 from rosti/kill-getgenericarchimage
kubeadm: Use GetGenericImage for kube-dns
parents
fd0a7a4a
68ed2bdd
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
8 additions
and
33 deletions
+8
-33
images.go
cmd/kubeadm/app/images/images.go
+3
-9
images_test.go
cmd/kubeadm/app/images/images_test.go
+0
-14
dns.go
cmd/kubeadm/app/phases/addons/dns/dns.go
+1
-3
dns_test.go
cmd/kubeadm/app/phases/addons/dns/dns_test.go
+1
-2
manifests.go
cmd/kubeadm/app/phases/addons/dns/manifests.go
+3
-5
No files found.
cmd/kubeadm/app/images/images.go
View file @
09051940
...
...
@@ -18,7 +18,6 @@ package images
import
(
"fmt"
"runtime"
kubeadmapi
"k8s.io/kubernetes/cmd/kubeadm/app/apis/kubeadm"
"k8s.io/kubernetes/cmd/kubeadm/app/constants"
...
...
@@ -31,11 +30,6 @@ func GetGenericImage(prefix, image, tag string) string {
return
fmt
.
Sprintf
(
"%s/%s:%s"
,
prefix
,
image
,
tag
)
}
// GetGenericArchImage generates and returns an image based on the current runtime arch
func
GetGenericArchImage
(
prefix
,
image
,
tag
string
)
string
{
return
fmt
.
Sprintf
(
"%s/%s-%s:%s"
,
prefix
,
image
,
runtime
.
GOARCH
,
tag
)
}
// GetKubeControlPlaneImage generates and returns the image for the core Kubernetes components or returns the unified control plane image if specified
func
GetKubeControlPlaneImage
(
image
string
,
cfg
*
kubeadmapi
.
ClusterConfiguration
)
string
{
if
cfg
.
UnifiedControlPlaneImage
!=
""
{
...
...
@@ -79,9 +73,9 @@ func GetAllImages(cfg *kubeadmapi.ClusterConfiguration) []string {
if
features
.
Enabled
(
cfg
.
FeatureGates
,
features
.
CoreDNS
)
{
imgs
=
append
(
imgs
,
GetGenericImage
(
cfg
.
ImageRepository
,
constants
.
CoreDNS
,
constants
.
CoreDNSVersion
))
}
else
{
imgs
=
append
(
imgs
,
GetGeneric
Arch
Image
(
cfg
.
ImageRepository
,
"k8s-dns-kube-dns"
,
constants
.
KubeDNSVersion
))
imgs
=
append
(
imgs
,
GetGeneric
Arch
Image
(
cfg
.
ImageRepository
,
"k8s-dns-sidecar"
,
constants
.
KubeDNSVersion
))
imgs
=
append
(
imgs
,
GetGeneric
Arch
Image
(
cfg
.
ImageRepository
,
"k8s-dns-dnsmasq-nanny"
,
constants
.
KubeDNSVersion
))
imgs
=
append
(
imgs
,
GetGenericImage
(
cfg
.
ImageRepository
,
"k8s-dns-kube-dns"
,
constants
.
KubeDNSVersion
))
imgs
=
append
(
imgs
,
GetGenericImage
(
cfg
.
ImageRepository
,
"k8s-dns-sidecar"
,
constants
.
KubeDNSVersion
))
imgs
=
append
(
imgs
,
GetGenericImage
(
cfg
.
ImageRepository
,
"k8s-dns-dnsmasq-nanny"
,
constants
.
KubeDNSVersion
))
}
return
imgs
...
...
cmd/kubeadm/app/images/images_test.go
View file @
09051940
...
...
@@ -18,7 +18,6 @@ package images
import
(
"fmt"
"runtime"
"strings"
"testing"
...
...
@@ -45,19 +44,6 @@ func TestGetGenericImage(t *testing.T) {
}
}
func
TestGetGenericArchImage
(
t
*
testing
.
T
)
{
const
(
prefix
=
"foo"
image
=
"bar"
tag
=
"baz"
)
expected
:=
fmt
.
Sprintf
(
"%s/%s-%s:%s"
,
prefix
,
image
,
runtime
.
GOARCH
,
tag
)
actual
:=
GetGenericArchImage
(
prefix
,
image
,
tag
)
if
actual
!=
expected
{
t
.
Errorf
(
"failed GetGenericArchImage:
\n\t
expected: %s
\n\t
actual: %s"
,
expected
,
actual
)
}
}
func
TestGetKubeControlPlaneImage
(
t
*
testing
.
T
)
{
var
tests
=
[]
struct
{
image
string
...
...
cmd/kubeadm/app/phases/addons/dns/dns.go
View file @
09051940
...
...
@@ -19,7 +19,6 @@ package dns
import
(
"encoding/json"
"fmt"
"runtime"
"strings"
"github.com/mholt/caddy/caddyfile"
...
...
@@ -97,9 +96,8 @@ func kubeDNSAddon(cfg *kubeadmapi.InitConfiguration, client clientset.Interface)
}
dnsDeploymentBytes
,
err
:=
kubeadmutil
.
ParseTemplate
(
KubeDNSDeployment
,
struct
{
ImageRepository
,
Arch
,
Version
,
DNSBindAddr
,
DNSProbeAddr
,
DNSDomain
,
MasterTaintKey
string
}{
struct
{
ImageRepository
,
Version
,
DNSBindAddr
,
DNSProbeAddr
,
DNSDomain
,
MasterTaintKey
string
}{
ImageRepository
:
cfg
.
ImageRepository
,
Arch
:
runtime
.
GOARCH
,
Version
:
kubeadmconstants
.
KubeDNSVersion
,
DNSBindAddr
:
dnsBindAddr
,
DNSProbeAddr
:
dnsProbeAddr
,
...
...
cmd/kubeadm/app/phases/addons/dns/dns_test.go
View file @
09051940
...
...
@@ -95,9 +95,8 @@ func TestCompileManifests(t *testing.T) {
}{
{
manifest
:
KubeDNSDeployment
,
data
:
struct
{
ImageRepository
,
Arch
,
Version
,
DNSBindAddr
,
DNSProbeAddr
,
DNSDomain
,
MasterTaintKey
string
}{
data
:
struct
{
ImageRepository
,
Version
,
DNSBindAddr
,
DNSProbeAddr
,
DNSDomain
,
MasterTaintKey
string
}{
ImageRepository
:
"foo"
,
Arch
:
"foo"
,
Version
:
"foo"
,
DNSBindAddr
:
"foo"
,
DNSProbeAddr
:
"foo"
,
...
...
cmd/kubeadm/app/phases/addons/dns/manifests.go
View file @
09051940
...
...
@@ -50,7 +50,7 @@ spec:
optional: true
containers:
- name: kubedns
image: {{ .ImageRepository }}/k8s-dns-kube-dns
-{{ .Arch }}
:{{ .Version }}
image: {{ .ImageRepository }}/k8s-dns-kube-dns:{{ .Version }}
imagePullPolicy: IfNotPresent
resources:
# TODO: Set memory limits when we've profiled the container for large
...
...
@@ -102,7 +102,7 @@ spec:
- name: kube-dns-config
mountPath: /kube-dns-config
- name: dnsmasq
image: {{ .ImageRepository }}/k8s-dns-dnsmasq-nanny
-{{ .Arch }}
:{{ .Version }}
image: {{ .ImageRepository }}/k8s-dns-dnsmasq-nanny:{{ .Version }}
imagePullPolicy: IfNotPresent
livenessProbe:
httpGet:
...
...
@@ -143,7 +143,7 @@ spec:
- name: kube-dns-config
mountPath: /etc/k8s/dns/dnsmasq-nanny
- name: sidecar
image: {{ .ImageRepository }}/k8s-dns-sidecar
-{{ .Arch }}
:{{ .Version }}
image: {{ .ImageRepository }}/k8s-dns-sidecar:{{ .Version }}
imagePullPolicy: IfNotPresent
livenessProbe:
httpGet:
...
...
@@ -174,8 +174,6 @@ spec:
operator: Exists
- key: {{ .MasterTaintKey }}
effect: NoSchedule
nodeSelector:
beta.kubernetes.io/arch: {{ .Arch }}
`
// KubeDNSService is the kube-dns Service manifest
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment