Skip to content

Commit e1d60aa

Browse files
committed
Use the proper template generation field
Signed-off-by: Mikkel Oscar Lyderik Larsen <[email protected]>
1 parent 02fc8c3 commit e1d60aa

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

test/e2e/daemonset-updated/main.go

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,11 +192,19 @@ func onDeleteDaemonsets(ctx context.Context, client kubernetes.Interface) (map[d
192192

193193
for _, ds := range daemonsets.Items {
194194
if ds.Spec.UpdateStrategy.Type == appsv1.OnDeleteDaemonSetStrategyType {
195+
var templateGeneration int64
196+
if genStr, ok := ds.Annotations["deprecated.daemonset.template.generation"]; ok {
197+
templateGeneration, err = strconv.ParseInt(genStr, 10, 64)
198+
if err != nil {
199+
templateGeneration = 0
200+
}
201+
202+
}
195203
onDeleteDaemonsets[dsID{
196204
Name: ds.Name,
197205
Namespace: ds.Namespace,
198206
UID: ds.UID,
199-
}] = ds.Generation
207+
}] = templateGeneration
200208
}
201209
}
202210

0 commit comments

Comments
 (0)