9
9
10
10
api "github.com/weaveworks/eksctl/pkg/apis/eksctl.io/v1alpha5"
11
11
"github.com/weaveworks/eksctl/pkg/karpenter/providers"
12
+ "github.com/weaveworks/eksctl/pkg/utils"
12
13
)
13
14
14
15
const (
@@ -78,16 +79,22 @@ func (k *Installer) Install(ctx context.Context, serviceAccountRoleARN string, i
78
79
defaultInstanceProfile : instanceProfileName ,
79
80
},
80
81
settings : map [string ]interface {}{
81
- aws : map [string ]interface {}{
82
- defaultInstanceProfile : instanceProfileName ,
83
- clusterName : k .ClusterConfig .Metadata .Name ,
84
- clusterEndpoint : k .ClusterConfig .Status .Endpoint ,
85
- interruptionQueueName : k .ClusterConfig .Metadata .Name ,
86
- },
82
+ defaultInstanceProfile : instanceProfileName ,
83
+ clusterName : k .ClusterConfig .Metadata .Name ,
84
+ clusterEndpoint : k .ClusterConfig .Status .Endpoint ,
85
+ interruptionQueueName : k .ClusterConfig .Metadata .Name ,
87
86
},
88
87
serviceAccount : serviceAccountMap ,
89
88
}
90
89
90
+ version := k .ClusterConfig .Karpenter .Version
91
+ compareVersions , err := utils .CompareVersions (version , "0.33.0" )
92
+ if err == nil && compareVersions < 0 {
93
+ values ["settings" ] = map [string ]interface {}{
94
+ aws : values ["settings" ],
95
+ }
96
+ }
97
+
91
98
registryClient , err := registry .NewClient (
92
99
registry .ClientOptEnableCache (true ),
93
100
)
@@ -101,7 +108,7 @@ func (k *Installer) Install(ctx context.Context, serviceAccountRoleARN string, i
101
108
Namespace : DefaultNamespace ,
102
109
ReleaseName : releaseName ,
103
110
Values : values ,
104
- Version : k . ClusterConfig . Karpenter . Version ,
111
+ Version : version ,
105
112
RegistryClient : registryClient ,
106
113
}
107
114
0 commit comments