@@ -205,7 +205,7 @@ func updateTaints(client kubernetes.Interface, taints []corev1.Taint, nodeName s
205
205
return nil
206
206
}
207
207
208
- func createNode (ctx context.Context , clientset kubernetes.Interface , clusterName , nodeName , gitVersion string , listenPort int32 ) (* corev1.Node , error ) {
208
+ func createNode (ctx context.Context , clientset kubernetes.Interface , clusterName , nodeName , gitVersion string , listenPort int32 , leafModel LeafMode ) (* corev1.Node , error ) {
209
209
nodeInRoot , err := clientset .CoreV1 ().Nodes ().Get (ctx , nodeName , metav1.GetOptions {})
210
210
if err != nil {
211
211
if ! errors .IsNotFound (err ) {
@@ -217,6 +217,9 @@ func createNode(ctx context.Context, clientset kubernetes.Interface, clusterName
217
217
if nodeAnnotations == nil {
218
218
nodeAnnotations = make (map [string ]string , 1 )
219
219
}
220
+ if leafModel == ALL {
221
+ nodeAnnotations [nodeMode ] = "one2cluster"
222
+ }
220
223
nodeAnnotations [utils .KosmosNodeOwnedByClusterAnnotations ] = clusterName
221
224
nodeInRoot .SetAnnotations (nodeAnnotations )
222
225
@@ -243,8 +246,7 @@ func (h ClassificationHandler) CreateRootNode(ctx context.Context, listenPort in
243
246
244
247
if h .leafMode == ALL {
245
248
nodeNameInRoot := fmt .Sprintf ("%s%s" , utils .KosmosNodePrefix , cluster .Name )
246
- nodeInRoot , err := createNode (ctx , h .RootClientset , cluster .Name , nodeNameInRoot , gitVersion , listenPort )
247
- nodeInRoot .Annotations [nodeMode ] = "one2cluster"
249
+ nodeInRoot , err := createNode (ctx , h .RootClientset , cluster .Name , nodeNameInRoot , gitVersion , listenPort , h .leafMode )
248
250
if err != nil {
249
251
return nil , nil , err
250
252
}
@@ -262,7 +264,7 @@ func (h ClassificationHandler) CreateRootNode(ctx context.Context, listenPort in
262
264
nodeNameInRoot = nodeNameInRoot [:63 ]
263
265
}
264
266
265
- nodeInRoot , err := createNode (ctx , h .RootClientset , cluster .Name , nodeNameInRoot , gitVersion , listenPort )
267
+ nodeInRoot , err := createNode (ctx , h .RootClientset , cluster .Name , nodeNameInRoot , gitVersion , listenPort , h . leafMode )
266
268
if err != nil {
267
269
return nil , nil , err
268
270
}
0 commit comments