Skip to content

Commit

Permalink
Removed Fallback
Browse files Browse the repository at this point in the history
  • Loading branch information
edibble21 committed Nov 21, 2024
1 parent 6779006 commit cedacf3
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 10 deletions.
9 changes: 0 additions & 9 deletions pkg/providers/version/suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ package version_test

import (
"context"
"fmt"
"testing"

"sigs.k8s.io/karpenter/pkg/test/v1alpha1"
Expand Down Expand Up @@ -83,14 +82,6 @@ var _ = Describe("Operator", func() {
Expect(err).ToNot(HaveOccurred())
Expect(endpoint).To(Equal("1.29"))
})

It("should handle EKS API errors and fallback to K8s API", func() {
_, _ = awsEnv.VersionProvider.Get(ctx)
awsEnv.EKSAPI.DescribeClusterBehavior.Error.Set(fmt.Errorf("some error"))
endpoint, err := awsEnv.VersionProvider.Get(ctx)
Expect(err).ToNot(HaveOccurred())
Expect(endpoint).To(Equal(testEnv.K8sVersion()))
})
})

Context("with EKS_CONTROL_PLANE=false", func() {
Expand Down
2 changes: 1 addition & 1 deletion pkg/providers/version/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ func (p *DefaultProvider) Get(ctx context.Context) (string, error) {
if options.FromContext(ctx).IsEKSControlPlane {
version, versionSource, err = p.getEKSVersion(ctx)
}
if version == "" && err != nil || !options.FromContext(ctx).IsEKSControlPlane {
if !options.FromContext(ctx).IsEKSControlPlane {
version, versionSource, err = p.getK8sVersion()
}
if version == "" && err != nil {
Expand Down

0 comments on commit cedacf3

Please sign in to comment.