Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
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
197 changes: 121 additions & 76 deletions pkg/apis/v1alpha2/aksnodeclass_hash_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ limitations under the License.
package v1alpha2_test

import (
"testing"
"time"

"dario.cat/mergo"
Expand All @@ -25,105 +26,149 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
karpv1 "sigs.k8s.io/karpenter/pkg/apis/v1"
"sigs.k8s.io/karpenter/pkg/test"

. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
)

var _ = Describe("Hash", func() {
func newHashTestNodeClassV1Alpha2() *v1alpha2.AKSNodeClass {
return &v1alpha2.AKSNodeClass{
ObjectMeta: test.ObjectMeta(metav1.ObjectMeta{}),
Spec: v1alpha2.AKSNodeClassSpec{
VNETSubnetID: lo.ToPtr("subnet-id"),
OSDiskSizeGB: lo.ToPtr(int32(30)),
ImageFamily: lo.ToPtr("Ubuntu2204"),
Tags: map[string]string{
"keyTag-1": "valueTag-1",
"keyTag-2": "valueTag-2",
},
Kubelet: &v1alpha2.KubeletConfiguration{
CPUManagerPolicy: lo.ToPtr("static"),
CPUCFSQuota: lo.ToPtr(true),
CPUCFSQuotaPeriod: metav1.Duration{Duration: lo.Must(time.ParseDuration("100ms"))},
ImageGCHighThresholdPercent: lo.ToPtr(int32(85)),
ImageGCLowThresholdPercent: lo.ToPtr(int32(80)),
TopologyManagerPolicy: lo.ToPtr("none"),
AllowedUnsafeSysctls: []string{"net.core.somaxconn"},
ContainerLogMaxSize: lo.ToPtr("10Mi"),
ContainerLogMaxFiles: lo.ToPtr(int32(10)),
},
MaxPods: lo.ToPtr(int32(100)),
},
}
}

//nolint:gocyclo
func TestHash(t *testing.T) {
// NOTE: When the hashing algorithm is updated, these tests are expected to fail; test hash constants here would have to be updated, and currentHashVersion would have to be updated to the new version matching v1alpha2.AKSNodeClassHashVersion
const staticHash = "4108492229247269128"
var nodeClass *v1alpha2.AKSNodeClass
BeforeEach(func() {
nodeClass = &v1alpha2.AKSNodeClass{
ObjectMeta: test.ObjectMeta(metav1.ObjectMeta{}),
Spec: v1alpha2.AKSNodeClassSpec{
VNETSubnetID: lo.ToPtr("subnet-id"),
OSDiskSizeGB: lo.ToPtr(int32(30)),
ImageFamily: lo.ToPtr("Ubuntu2204"),
Tags: map[string]string{
"keyTag-1": "valueTag-1",
"keyTag-2": "valueTag-2",
},
Kubelet: &v1alpha2.KubeletConfiguration{
CPUManagerPolicy: lo.ToPtr("static"),
CPUCFSQuota: lo.ToPtr(true),
CPUCFSQuotaPeriod: metav1.Duration{Duration: lo.Must(time.ParseDuration("100ms"))},
ImageGCHighThresholdPercent: lo.ToPtr(int32(85)),
ImageGCLowThresholdPercent: lo.ToPtr(int32(80)),
TopologyManagerPolicy: lo.ToPtr("none"),
AllowedUnsafeSysctls: []string{"net.core.somaxconn"},
ContainerLogMaxSize: lo.ToPtr("10Mi"),
ContainerLogMaxFiles: lo.ToPtr(int32(10)),
},
MaxPods: lo.ToPtr(int32(100)),
},

t.Run("should match static hash on field value change", func(t *testing.T) {
tests := []struct {
name string
hash string
changes v1alpha2.AKSNodeClass
}{
{"Base AKSNodeClass", staticHash, v1alpha2.AKSNodeClass{}},
// Static fields, expect changed hash from base
{"VNETSubnetID", "13971920214979852468", v1alpha2.AKSNodeClass{Spec: v1alpha2.AKSNodeClassSpec{VNETSubnetID: lo.ToPtr("subnet-id-2")}}},
{"OSDiskSizeGB", "7816855636861645563", v1alpha2.AKSNodeClass{Spec: v1alpha2.AKSNodeClassSpec{OSDiskSizeGB: lo.ToPtr(int32(40))}}},
{"ImageFamily", "15616969746300892810", v1alpha2.AKSNodeClass{Spec: v1alpha2.AKSNodeClassSpec{ImageFamily: lo.ToPtr("AzureLinux")}}},
{"Kubelet", "33638514539106194", v1alpha2.AKSNodeClass{Spec: v1alpha2.AKSNodeClassSpec{Kubelet: &v1alpha2.KubeletConfiguration{CPUManagerPolicy: lo.ToPtr("none")}}}},
{"MaxPods", "15508761509963240710", v1alpha2.AKSNodeClass{Spec: v1alpha2.AKSNodeClassSpec{MaxPods: lo.ToPtr(int32(200))}}},
{"LocalDNS.Mode", "17805442572569734619", v1alpha2.AKSNodeClass{Spec: v1alpha2.AKSNodeClassSpec{LocalDNS: &v1alpha2.LocalDNS{Mode: v1alpha2.LocalDNSModeRequired}}}},
{"LocalDNS.VnetDNSOverrides", "14608914734386108436", v1alpha2.AKSNodeClass{Spec: v1alpha2.AKSNodeClassSpec{LocalDNS: &v1alpha2.LocalDNS{VnetDNSOverrides: []v1alpha2.LocalDNSZoneOverride{{Zone: "example.com", QueryLogging: v1alpha2.LocalDNSQueryLoggingLog}}}}}},
{"LocalDNS.KubeDNSOverrides", "4529827108104295737", v1alpha2.AKSNodeClass{Spec: v1alpha2.AKSNodeClassSpec{LocalDNS: &v1alpha2.LocalDNS{KubeDNSOverrides: []v1alpha2.LocalDNSZoneOverride{{Zone: "example.com", Protocol: v1alpha2.LocalDNSProtocolForceTCP}}}}}},
{"LocalDNS.VnetDNSOverrides.CacheDuration", "11008649797056761238", v1alpha2.AKSNodeClass{Spec: v1alpha2.AKSNodeClassSpec{LocalDNS: &v1alpha2.LocalDNS{VnetDNSOverrides: []v1alpha2.LocalDNSZoneOverride{{Zone: "example.com", CacheDuration: karpv1.MustParseNillableDuration("1h")}}}}}},
{"LocalDNS.VnetDNSOverrides.ServeStaleDuration", "4895720480850206885", v1alpha2.AKSNodeClass{Spec: v1alpha2.AKSNodeClassSpec{LocalDNS: &v1alpha2.LocalDNS{VnetDNSOverrides: []v1alpha2.LocalDNSZoneOverride{{Zone: "example.com", ServeStaleDuration: karpv1.MustParseNillableDuration("30m")}}}}}},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
nodeClass := newHashTestNodeClassV1Alpha2()
if err := mergo.Merge(nodeClass, tt.changes, mergo.WithOverride, mergo.WithSliceDeepCopy); err != nil {
t.Fatalf("mergo.Merge failed: %v", err)
}
if got := nodeClass.Hash(); got != tt.hash {
t.Errorf("Hash() = %s, want %s", got, tt.hash)
}
})
}
})
DescribeTable(
"should match static hash on field value change",
func(hash string, changes v1alpha2.AKSNodeClass) {
Expect(mergo.Merge(nodeClass, changes, mergo.WithOverride, mergo.WithSliceDeepCopy)).To(Succeed())
Expect(nodeClass.Hash()).To(Equal(hash))
},
Entry("Base AKSNodeClass", staticHash, v1alpha2.AKSNodeClass{}),

// Static fields, expect changed hash from base
Entry("VNETSubnetID", "13971920214979852468", v1alpha2.AKSNodeClass{Spec: v1alpha2.AKSNodeClassSpec{VNETSubnetID: lo.ToPtr("subnet-id-2")}}),
Entry("OSDiskSizeGB", "7816855636861645563", v1alpha2.AKSNodeClass{Spec: v1alpha2.AKSNodeClassSpec{OSDiskSizeGB: lo.ToPtr(int32(40))}}),
Entry("ImageFamily", "15616969746300892810", v1alpha2.AKSNodeClass{Spec: v1alpha2.AKSNodeClassSpec{ImageFamily: lo.ToPtr("AzureLinux")}}),
Entry("Kubelet", "33638514539106194", v1alpha2.AKSNodeClass{Spec: v1alpha2.AKSNodeClassSpec{Kubelet: &v1alpha2.KubeletConfiguration{CPUManagerPolicy: lo.ToPtr("none")}}}),
Entry("MaxPods", "15508761509963240710", v1alpha2.AKSNodeClass{Spec: v1alpha2.AKSNodeClassSpec{MaxPods: lo.ToPtr(int32(200))}}),
Entry("LocalDNS.Mode", "17805442572569734619", v1alpha2.AKSNodeClass{Spec: v1alpha2.AKSNodeClassSpec{LocalDNS: &v1alpha2.LocalDNS{Mode: v1alpha2.LocalDNSModeRequired}}}),
Entry("LocalDNS.VnetDNSOverrides", "14608914734386108436", v1alpha2.AKSNodeClass{Spec: v1alpha2.AKSNodeClassSpec{LocalDNS: &v1alpha2.LocalDNS{VnetDNSOverrides: []v1alpha2.LocalDNSZoneOverride{{Zone: "example.com", QueryLogging: v1alpha2.LocalDNSQueryLoggingLog}}}}}),
Entry("LocalDNS.KubeDNSOverrides", "4529827108104295737", v1alpha2.AKSNodeClass{Spec: v1alpha2.AKSNodeClassSpec{LocalDNS: &v1alpha2.LocalDNS{KubeDNSOverrides: []v1alpha2.LocalDNSZoneOverride{{Zone: "example.com", Protocol: v1alpha2.LocalDNSProtocolForceTCP}}}}}),
Entry("LocalDNS.VnetDNSOverrides.CacheDuration", "11008649797056761238", v1alpha2.AKSNodeClass{Spec: v1alpha2.AKSNodeClassSpec{LocalDNS: &v1alpha2.LocalDNS{VnetDNSOverrides: []v1alpha2.LocalDNSZoneOverride{{Zone: "example.com", CacheDuration: karpv1.MustParseNillableDuration("1h")}}}}}),
Entry("LocalDNS.VnetDNSOverrides.ServeStaleDuration", "4895720480850206885", v1alpha2.AKSNodeClass{Spec: v1alpha2.AKSNodeClassSpec{LocalDNS: &v1alpha2.LocalDNS{VnetDNSOverrides: []v1alpha2.LocalDNSZoneOverride{{Zone: "example.com", ServeStaleDuration: karpv1.MustParseNillableDuration("30m")}}}}}),
)
It("should match static hash when reordering tags", func() {
t.Run("should match static hash when reordering tags", func(t *testing.T) {
nodeClass := newHashTestNodeClassV1Alpha2()
nodeClass.Spec.Tags = map[string]string{"keyTag-2": "valueTag-2", "keyTag-1": "valueTag-1"}
Expect(nodeClass.Hash()).To(Equal(staticHash))
if got := nodeClass.Hash(); got != staticHash {
t.Errorf("Hash() = %s, want %s after tag reorder", got, staticHash)
}
})
DescribeTable("should change hash when static fields are updated", func(changes v1alpha2.AKSNodeClass) {
hash := nodeClass.Hash()
Expect(mergo.Merge(nodeClass, changes, mergo.WithOverride, mergo.WithSliceDeepCopy)).To(Succeed())
updatedHash := nodeClass.Hash()
Expect(hash).ToNot(Equal(updatedHash))
},
Entry("VNETSubnetID", v1alpha2.AKSNodeClass{Spec: v1alpha2.AKSNodeClassSpec{VNETSubnetID: lo.ToPtr("subnet-id-2")}}),
Entry("OSDiskSizeGB", v1alpha2.AKSNodeClass{Spec: v1alpha2.AKSNodeClassSpec{OSDiskSizeGB: lo.ToPtr(int32(40))}}),
Entry("ImageFamily", v1alpha2.AKSNodeClass{Spec: v1alpha2.AKSNodeClassSpec{ImageFamily: lo.ToPtr("AzureLinux")}}),
Entry("Kubelet", v1alpha2.AKSNodeClass{Spec: v1alpha2.AKSNodeClassSpec{Kubelet: &v1alpha2.KubeletConfiguration{CPUManagerPolicy: lo.ToPtr("none")}}}),
Entry("MaxPods", v1alpha2.AKSNodeClass{Spec: v1alpha2.AKSNodeClassSpec{MaxPods: lo.ToPtr(int32(200))}}),
Entry("LocalDNS.Mode", v1alpha2.AKSNodeClass{Spec: v1alpha2.AKSNodeClassSpec{LocalDNS: &v1alpha2.LocalDNS{Mode: v1alpha2.LocalDNSModeRequired}}}),
Entry("LocalDNS.VnetDNSOverrides", v1alpha2.AKSNodeClass{Spec: v1alpha2.AKSNodeClassSpec{LocalDNS: &v1alpha2.LocalDNS{VnetDNSOverrides: []v1alpha2.LocalDNSZoneOverride{{Zone: "example.com", QueryLogging: v1alpha2.LocalDNSQueryLoggingLog}}}}}),
Entry("LocalDNS.KubeDNSOverrides", v1alpha2.AKSNodeClass{Spec: v1alpha2.AKSNodeClassSpec{LocalDNS: &v1alpha2.LocalDNS{KubeDNSOverrides: []v1alpha2.LocalDNSZoneOverride{{Zone: "example.com", Protocol: v1alpha2.LocalDNSProtocolForceTCP}}}}}),
Entry("LocalDNS.VnetDNSOverrides.CacheDuration", v1alpha2.AKSNodeClass{Spec: v1alpha2.AKSNodeClassSpec{LocalDNS: &v1alpha2.LocalDNS{VnetDNSOverrides: []v1alpha2.LocalDNSZoneOverride{{Zone: "example.com", CacheDuration: karpv1.MustParseNillableDuration("2h")}}}}}),
Entry("LocalDNS.VnetDNSOverrides.ServeStaleDuration", v1alpha2.AKSNodeClass{Spec: v1alpha2.AKSNodeClassSpec{LocalDNS: &v1alpha2.LocalDNS{VnetDNSOverrides: []v1alpha2.LocalDNSZoneOverride{{Zone: "example.com", ServeStaleDuration: karpv1.MustParseNillableDuration("1h")}}}}}),
)
It("should not change hash when tags are changed", func() {

t.Run("should change hash when static fields are updated", func(t *testing.T) {
tests := []struct {
name string
changes v1alpha2.AKSNodeClass
}{
{"VNETSubnetID", v1alpha2.AKSNodeClass{Spec: v1alpha2.AKSNodeClassSpec{VNETSubnetID: lo.ToPtr("subnet-id-2")}}},
{"OSDiskSizeGB", v1alpha2.AKSNodeClass{Spec: v1alpha2.AKSNodeClassSpec{OSDiskSizeGB: lo.ToPtr(int32(40))}}},
{"ImageFamily", v1alpha2.AKSNodeClass{Spec: v1alpha2.AKSNodeClassSpec{ImageFamily: lo.ToPtr("AzureLinux")}}},
{"Kubelet", v1alpha2.AKSNodeClass{Spec: v1alpha2.AKSNodeClassSpec{Kubelet: &v1alpha2.KubeletConfiguration{CPUManagerPolicy: lo.ToPtr("none")}}}},
{"MaxPods", v1alpha2.AKSNodeClass{Spec: v1alpha2.AKSNodeClassSpec{MaxPods: lo.ToPtr(int32(200))}}},
{"LocalDNS.Mode", v1alpha2.AKSNodeClass{Spec: v1alpha2.AKSNodeClassSpec{LocalDNS: &v1alpha2.LocalDNS{Mode: v1alpha2.LocalDNSModeRequired}}}},
{"LocalDNS.VnetDNSOverrides", v1alpha2.AKSNodeClass{Spec: v1alpha2.AKSNodeClassSpec{LocalDNS: &v1alpha2.LocalDNS{VnetDNSOverrides: []v1alpha2.LocalDNSZoneOverride{{Zone: "example.com", QueryLogging: v1alpha2.LocalDNSQueryLoggingLog}}}}}},
{"LocalDNS.KubeDNSOverrides", v1alpha2.AKSNodeClass{Spec: v1alpha2.AKSNodeClassSpec{LocalDNS: &v1alpha2.LocalDNS{KubeDNSOverrides: []v1alpha2.LocalDNSZoneOverride{{Zone: "example.com", Protocol: v1alpha2.LocalDNSProtocolForceTCP}}}}}},
{"LocalDNS.VnetDNSOverrides.CacheDuration", v1alpha2.AKSNodeClass{Spec: v1alpha2.AKSNodeClassSpec{LocalDNS: &v1alpha2.LocalDNS{VnetDNSOverrides: []v1alpha2.LocalDNSZoneOverride{{Zone: "example.com", CacheDuration: karpv1.MustParseNillableDuration("2h")}}}}}},
{"LocalDNS.VnetDNSOverrides.ServeStaleDuration", v1alpha2.AKSNodeClass{Spec: v1alpha2.AKSNodeClassSpec{LocalDNS: &v1alpha2.LocalDNS{VnetDNSOverrides: []v1alpha2.LocalDNSZoneOverride{{Zone: "example.com", ServeStaleDuration: karpv1.MustParseNillableDuration("1h")}}}}}},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
nodeClass := newHashTestNodeClassV1Alpha2()
hash := nodeClass.Hash()
if err := mergo.Merge(nodeClass, tt.changes, mergo.WithOverride, mergo.WithSliceDeepCopy); err != nil {
t.Fatalf("mergo.Merge failed: %v", err)
}
updatedHash := nodeClass.Hash()
if hash == updatedHash {
t.Errorf("expected hash to change after updating %s, but got same hash %s", tt.name, hash)
}
})
}
})

t.Run("should not change hash when tags are changed", func(t *testing.T) {
nodeClass := newHashTestNodeClassV1Alpha2()
hash := nodeClass.Hash()
nodeClass.Spec.Tags = map[string]string{"keyTag-3": "valueTag-3"}
updatedHash := nodeClass.Hash()
Expect(hash).To(Equal(updatedHash))
if hash != updatedHash {
t.Errorf("expected hash to remain %s after tag change, got %s", hash, updatedHash)
}
})
It("should expect two AKSNodeClasses with the same spec to have the same hash", func() {

t.Run("should expect two AKSNodeClasses with the same spec to have the same hash", func(t *testing.T) {
nodeClass := newHashTestNodeClassV1Alpha2()
otherNodeClass := &v1alpha2.AKSNodeClass{
Spec: nodeClass.Spec,
}
Expect(nodeClass.Hash()).To(Equal(otherNodeClass.Hash()))
if nodeClass.Hash() != otherNodeClass.Hash() {
t.Errorf("expected same hash for identical specs, got %s and %s", nodeClass.Hash(), otherNodeClass.Hash())
}
})

// This test is a sanity check to update the hashing version if the algorithm has been updated.
// Note: this will only catch a missing version update, if the staticHash hasn't been updated yet.
It("when hashing algorithm updates, we should update the hash version", func() {
t.Run("when hashing algorithm updates, we should update the hash version", func(t *testing.T) {
nodeClass := newHashTestNodeClassV1Alpha2()
currentHashVersion := "v3"
if nodeClass.Hash() != staticHash {
Expect(v1alpha2.AKSNodeClassHashVersion).ToNot(Equal(currentHashVersion))
if v1alpha2.AKSNodeClassHashVersion == currentHashVersion {
t.Errorf("hash changed from static hash, expected AKSNodeClassHashVersion to differ from %s", currentHashVersion)
}
} else {
// Note: this failure case is to ensure you have updated currentHashVersion, not AKSNodeClassHashVersion
Expect(currentHashVersion).To(Equal(v1alpha2.AKSNodeClassHashVersion))
if currentHashVersion != v1alpha2.AKSNodeClassHashVersion {
t.Errorf("expected currentHashVersion %s to equal AKSNodeClassHashVersion %s", currentHashVersion, v1alpha2.AKSNodeClassHashVersion)
}
}
// Note: this failure case is to ensure you have updated staticHash value
Expect(staticHash).To(Equal(nodeClass.Hash()))
if staticHash != nodeClass.Hash() {
t.Errorf("expected staticHash %s to equal computed hash %s", staticHash, nodeClass.Hash())
}
})
})
}
78 changes: 41 additions & 37 deletions pkg/apis/v1alpha2/aksnodeclass_localdns_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,48 +17,52 @@ limitations under the License.
package v1alpha2_test

import (
"testing"

"github.com/Azure/karpenter-provider-azure/pkg/apis/v1alpha2"
"github.com/awslabs/operatorpkg/status"
"github.com/samber/lo"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"

. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
)

var _ = Describe("IsLocalDNSEnabled", func() {
var nodeClass *v1alpha2.AKSNodeClass

BeforeEach(func() {
nodeClass = &v1alpha2.AKSNodeClass{}
nodeClass.Status = v1alpha2.AKSNodeClassStatus{
Conditions: []status.Condition{{
Type: v1alpha2.ConditionTypeKubernetesVersionReady,
Status: metav1.ConditionTrue,
ObservedGeneration: nodeClass.Generation,
}},
}
})

DescribeTable("should return correct value based on LocalDNS mode and Kubernetes version",
func(mode v1alpha2.LocalDNSMode, kubernetesVersion string, expected bool) {
if mode != "" {
nodeClass.Spec.LocalDNS = &v1alpha2.LocalDNS{Mode: mode}
func TestIsLocalDNSEnabled(t *testing.T) {
tests := []struct {
name string
mode v1alpha2.LocalDNSMode
kubernetesVersion string
expected bool
}{
{"LocalDNS is nil", v1alpha2.LocalDNSMode(""), "", false},
{"Mode is Required", v1alpha2.LocalDNSModeRequired, "", true},
{"Mode is Disabled", v1alpha2.LocalDNSModeDisabled, "", false},
{"Mode is Preferred, no k8s version", v1alpha2.LocalDNSModePreferred, "", false},
{"Mode is Preferred, k8s 1.34.0", v1alpha2.LocalDNSModePreferred, "1.34.0", false},
{"Mode is Preferred, k8s 1.35.0", v1alpha2.LocalDNSModePreferred, "1.35.0", true},
{"Mode is Preferred, k8s v1.35.0", v1alpha2.LocalDNSModePreferred, "v1.35.0", true},
{"Mode is Preferred, k8s 1.36.0", v1alpha2.LocalDNSModePreferred, "1.36.0", true},
{"Mode is Preferred, k8s 1.35.5", v1alpha2.LocalDNSModePreferred, "1.35.5", true},
{"Mode is Preferred, k8s 1.34.99", v1alpha2.LocalDNSModePreferred, "1.34.99", false},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
nodeClass := &v1alpha2.AKSNodeClass{}
nodeClass.Status = v1alpha2.AKSNodeClassStatus{
Conditions: []status.Condition{{
Type: v1alpha2.ConditionTypeKubernetesVersionReady,
Status: metav1.ConditionTrue,
ObservedGeneration: nodeClass.Generation,
}},
}
if tt.mode != "" {
nodeClass.Spec.LocalDNS = &v1alpha2.LocalDNS{Mode: tt.mode}
}
if tt.kubernetesVersion != "" {
nodeClass.Status.KubernetesVersion = lo.ToPtr(tt.kubernetesVersion)
}
if kubernetesVersion != "" {
nodeClass.Status.KubernetesVersion = lo.ToPtr(kubernetesVersion)
got := nodeClass.IsLocalDNSEnabled()
if got != tt.expected {
t.Errorf("IsLocalDNSEnabled() = %v, want %v", got, tt.expected)
}
Expect(nodeClass.IsLocalDNSEnabled()).To(Equal(expected))
},
Entry("LocalDNS is nil", v1alpha2.LocalDNSMode(""), "", false),
Entry("Mode is Required", v1alpha2.LocalDNSModeRequired, "", true),
Entry("Mode is Disabled", v1alpha2.LocalDNSModeDisabled, "", false),
Entry("Mode is Preferred, no k8s version", v1alpha2.LocalDNSModePreferred, "", false),
Entry("Mode is Preferred, k8s 1.34.0", v1alpha2.LocalDNSModePreferred, "1.34.0", false),
Entry("Mode is Preferred, k8s 1.35.0", v1alpha2.LocalDNSModePreferred, "1.35.0", true),
Entry("Mode is Preferred, k8s v1.35.0", v1alpha2.LocalDNSModePreferred, "v1.35.0", true),
Entry("Mode is Preferred, k8s 1.36.0", v1alpha2.LocalDNSModePreferred, "1.36.0", true),
Entry("Mode is Preferred, k8s 1.35.5", v1alpha2.LocalDNSModePreferred, "1.35.5", true),
Entry("Mode is Preferred, k8s 1.34.99", v1alpha2.LocalDNSModePreferred, "1.34.99", false),
)
})
})
}
}
Loading
Loading