Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ require (
github.com/aws/aws-sdk-go-v2 v1.36.3
github.com/aws/aws-sdk-go-v2/config v1.29.12
github.com/aws/aws-sdk-go-v2/credentials v1.17.65
github.com/aws/aws-sdk-go-v2/service/autoscaling v1.52.3
github.com/aws/aws-sdk-go-v2/service/autoscaling v1.52.4
github.com/aws/aws-sdk-go-v2/service/cloudformation v1.59.2
github.com/aws/aws-sdk-go-v2/service/cloudtrail v1.48.4
github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs v1.47.3
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,8 @@ github.com/aws/aws-sdk-go-v2/internal/ini v1.8.3 h1:bIqFDwgGXXN1Kpp99pDOdKMTTb5d
github.com/aws/aws-sdk-go-v2/internal/ini v1.8.3/go.mod h1:H5O/EsxDWyU+LP/V8i5sm8cxoZgc2fdNR9bxlOFrQTo=
github.com/aws/aws-sdk-go-v2/internal/v4a v1.3.33 h1:/frG8aV09yhCVSOEC2pzktflJJO48NwY3xntHBwxHiA=
github.com/aws/aws-sdk-go-v2/internal/v4a v1.3.33/go.mod h1:8vwASlAcV366M+qxZnjNzCjeastk1Rt1bpSRaGZanGU=
github.com/aws/aws-sdk-go-v2/service/autoscaling v1.52.3 h1:QsKdBxtC8csnKt5BbV7D1op4Nf13p2YkTJIkppaCakw=
github.com/aws/aws-sdk-go-v2/service/autoscaling v1.52.3/go.mod h1:CDqMoc3KRdZJ8qziW96J35lKH01Wq3B2aihtHj2JbRs=
github.com/aws/aws-sdk-go-v2/service/autoscaling v1.52.4 h1:vzLD0FyNU4uxf2QE5UDG0jSEitiJXbVEUwf2Sk3usF4=
github.com/aws/aws-sdk-go-v2/service/autoscaling v1.52.4/go.mod h1:CDqMoc3KRdZJ8qziW96J35lKH01Wq3B2aihtHj2JbRs=
github.com/aws/aws-sdk-go-v2/service/cloudformation v1.59.2 h1:o9cuZdZlI9VWMqsNa2mnf2IRsFAROHnaYA1BW3lHGuY=
github.com/aws/aws-sdk-go-v2/service/cloudformation v1.59.2/go.mod h1:penaZKzGmqHGZId4EUCBIW/f9l4Y7hQ5NKd45yoCYuI=
github.com/aws/aws-sdk-go-v2/service/cloudtrail v1.48.4 h1:pQpinmWv9jEisDR6/DccOf2cXdAf/CAwQ39nfJfJDlE=
Expand Down
2 changes: 1 addition & 1 deletion pkg/fargate/coredns/coredns.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ func IsSchedulableOnFargate(profiles []*api.FargateProfile) bool {
}

func selectsCoreDNS(selector api.FargateProfileSelector) bool {
return selector.Namespace == Namespace && len(selector.Labels) == 0
return selector.Namespace == Namespace && (len(selector.Labels) == 0 || selector.Labels["eks.amazonaws.com/component"] == Name)
}

// IsScheduledOnFargate checks if EKS' coredns is scheduled onto Fargate.
Expand Down
18 changes: 18 additions & 0 deletions pkg/fargate/coredns/coredns_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,20 @@ var (
},
}

profileSelectingCoreDNSWithComponentLabel = []*api.FargateProfile{
{
Name: "selecting-coredns-with-label",
Selectors: []api.FargateProfileSelector{
{
Namespace: "kube-system",
Labels: map[string]string{
"eks.amazonaws.com/component": "coredns",
},
},
},
},
}

profileNotSelectingCoreDNSBecauseOfNamespace = []*api.FargateProfile{
{
Name: "not-selecting-coredns-because-of-namespace",
Expand All @@ -97,6 +111,10 @@ var _ = Describe("coredns", func() {
Expect(coredns.IsSchedulableOnFargate(multipleProfilesWithOneSelectingCoreDNS)).To(BeTrue())
})

It("should return true when a Fargate profile matches kube-system and has the CoreDNS component label", func() {
Expect(coredns.IsSchedulableOnFargate(profileSelectingCoreDNSWithComponentLabel)).To(BeTrue())
})

It("should return true when provided the default Fargate profile", func() {
cfg := api.NewClusterConfig()
cfg.SetDefaultFargateProfile()
Expand Down
Loading