Skip to content

Commit

Permalink
Update coredns (eksctl-io#7179)
Browse files Browse the repository at this point in the history
* Update coredns

* fix unit test

---------

Co-authored-by: Tibi <110664232+TiberiuGC@users.noreply.github.com>
  • Loading branch information
eksctl-bot and TiberiuGC authored Oct 18, 2023
1 parent 0d454a3 commit a60c425
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 11 deletions.
2 changes: 1 addition & 1 deletion pkg/addons/default/assets/coredns-1.23.json
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@
"-conf",
"/etc/coredns/Corefile"
],
"image": "%s.dkr.ecr.%s.%s/eks/coredns:v1.8.7-eksbuild.2",
"image": "%s.dkr.ecr.%s.%s/eks/coredns:v1.8.7-eksbuild.7",
"imagePullPolicy": "IfNotPresent",
"livenessProbe": {
"failureThreshold": 5,
Expand Down
2 changes: 1 addition & 1 deletion pkg/addons/default/assets/coredns-1.24.json
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@
"-conf",
"/etc/coredns/Corefile"
],
"image": "%s.dkr.ecr.%s.%s/eks/coredns:v1.8.7-eksbuild.3",
"image": "%s.dkr.ecr.%s.%s/eks/coredns:v1.9.3-eksbuild.7",
"imagePullPolicy": "IfNotPresent",
"livenessProbe": {
"failureThreshold": 5,
Expand Down
2 changes: 1 addition & 1 deletion pkg/addons/default/assets/coredns-1.25.json
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@
"-conf",
"/etc/coredns/Corefile"
],
"image": "%s.dkr.ecr.%s.%s/eks/coredns:v1.9.3-eksbuild.2",
"image": "%s.dkr.ecr.%s.%s/eks/coredns:v1.9.3-eksbuild.7",
"imagePullPolicy": "IfNotPresent",
"livenessProbe": {
"failureThreshold": 5,
Expand Down
2 changes: 1 addition & 1 deletion pkg/addons/default/assets/coredns-1.26.json
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@
"-conf",
"/etc/coredns/Corefile"
],
"image": "%s.dkr.ecr.%s.%s/eks/coredns:v1.9.3-eksbuild.2",
"image": "%s.dkr.ecr.%s.%s/eks/coredns:v1.9.3-eksbuild.7",
"imagePullPolicy": "IfNotPresent",
"livenessProbe": {
"failureThreshold": 5,
Expand Down
2 changes: 1 addition & 1 deletion pkg/addons/default/assets/coredns-1.27.json
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@
"-conf",
"/etc/coredns/Corefile"
],
"image": "%s.dkr.ecr.%s.%s/eks/coredns:v1.10.1-eksbuild.1",
"image": "%s.dkr.ecr.%s.%s/eks/coredns:v1.10.1-eksbuild.4",
"imagePullPolicy": "IfNotPresent",
"livenessProbe": {
"failureThreshold": 5,
Expand Down
2 changes: 1 addition & 1 deletion pkg/addons/default/assets/coredns-1.28.json
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@
"-conf",
"/etc/coredns/Corefile"
],
"image": "%s.dkr.ecr.%s.%s/eks/coredns:v1.10.1-eksbuild.3",
"image": "%s.dkr.ecr.%s.%s/eks/coredns:v1.10.1-eksbuild.4",
"imagePullPolicy": "IfNotPresent",
"livenessProbe": {
"failureThreshold": 5,
Expand Down
18 changes: 13 additions & 5 deletions pkg/addons/default/coredns_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,16 @@ package defaultaddons_test

import (
"context"
"fmt"
"os"
"path/filepath"
"regexp"

. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"

da "github.com/weaveworks/eksctl/pkg/addons/default"

"github.com/weaveworks/eksctl/pkg/testutils"
)

Expand All @@ -25,12 +28,12 @@ var _ = Describe("default addons - coredns", func() {
rawClient = testutils.NewFakeRawClient()
rawClient.UseUnionTracker = true
region = "eu-west-2"
controlPlaneVersion = "1.24.x"
kubernetesVersion = "1.23"
kubernetesVersion = "1.25"
controlPlaneVersion = "1.26"

input = da.AddonInput{
RawClient: rawClient,
ControlPlaneVersion: controlPlaneVersion,
ControlPlaneVersion: controlPlaneVersion + ".x",
Region: region,
}
})
Expand All @@ -42,7 +45,12 @@ var _ = Describe("default addons - coredns", func() {

BeforeEach(func() {
createCoreDNSFromTestSample(rawClient, kubernetesVersion)
expectedImageTag = "v1.8.7-eksbuild.3"

coreFile, err := os.ReadFile(filepath.Join("assets", fmt.Sprintf("coredns-%s.json", controlPlaneVersion)))
Expect(err).NotTo(HaveOccurred())

expectedImageTag = regexp.MustCompile(`v\d+\.\d+\.\d+-eksbuild\.\d+`).FindString(string(coreFile))
Expect(expectedImageTag).NotTo(BeEmpty())
})

It("updates coredns to the correct version", func() {
Expand Down

0 comments on commit a60c425

Please sign in to comment.