Skip to content

Commit

Permalink
Merge pull request #2021 from hidalgopl/update-coredns-image-to-v1.11.3
Browse files Browse the repository at this point in the history
bump default coredns image to v1.11.3 (because previous ones had CVEs)
  • Loading branch information
FabianKramm authored Aug 5, 2024
2 parents f19403c + 9b23c74 commit ec2c9af
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/coredns/coredns.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import (
)

const (
DefaultImage = "coredns/coredns:1.11.1"
DefaultImage = "coredns/coredns:1.11.3"
ManifestRelativePath = "coredns/coredns.yaml"
ManifestsOutputFolder = "/tmp/manifests-to-apply"
VarImage = "IMAGE"
Expand Down
11 changes: 11 additions & 0 deletions test/e2e/coredns/coredns.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package coredns
import (
"fmt"

"github.com/loft-sh/vcluster/pkg/coredns"
"github.com/loft-sh/vcluster/pkg/util/podhelper"
"github.com/loft-sh/vcluster/pkg/util/random"
"github.com/loft-sh/vcluster/test/framework"
Expand Down Expand Up @@ -74,4 +75,14 @@ var _ = ginkgo.Describe("CoreDNS resolves host names correctly", func() {
framework.ExpectEqual(string(stdoutBuffer), "ok")
}
})
ginkgo.It("Test coredns uses pinned image version", func() {
coreDNSName, coreDNSNamespace := "coredns", "kube-system"
coreDNSDeployment, err := f.VClusterClient.AppsV1().Deployments(coreDNSNamespace).Get(f.Context, coreDNSName, metav1.GetOptions{})
framework.ExpectNoError(err)
framework.ExpectEqual(len(coreDNSDeployment.Spec.Template.Spec.Containers), 1)
framework.ExpectEqual(coreDNSDeployment.Spec.Template.Spec.Containers[0].Image, coredns.DefaultImage)
// these are images with known security vulnerabilities.
framework.ExpectNotEqual(coreDNSDeployment.Spec.Template.Spec.Containers[0].Image, "1.11.1")
framework.ExpectNotEqual(coreDNSDeployment.Spec.Template.Spec.Containers[0].Image, "1.11.0")
})
})

0 comments on commit ec2c9af

Please sign in to comment.