-
Notifications
You must be signed in to change notification settings - Fork 10
Conversation
appLabel := "app=" + deployName | ||
replicaSets, err := k8sClient.AppsV1().ReplicaSets(namespace).List(k8smeta.ListOptions{LabelSelector: appLabel}) | ||
if err != nil { | ||
return filterNotFound(fmt.Sprintf("could not delete replicaset: %s in namespace: %s: %s", deployName, namespace, err), err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
kunne feilmeldingen heller vært at den ikke fant et replicaset? Siden den ikke prøver å slette den enda.
|
||
for _, replicaSet := range replicaSets.Items { | ||
if err := k8sClient.AppsV1().ReplicaSets(namespace).Delete(replicaSet.Name, &k8smeta.DeleteOptions{}); err != nil { | ||
return filterNotFound(fmt.Sprintf("could not delete replicaset: %s in namespace: %s: %s", deployName, namespace, err), err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Skulle den prøvd å slette de andre i listen, eller bare fastFail?
replicaSetDef := &k8sapps.ReplicaSet{ | ||
TypeMeta: k8smeta.TypeMeta{ | ||
Kind: "ReplicaSet", | ||
APIVersion: "v1", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Kunne vi hentet APIVersion
fra k8sapps
?
Why is this necessary? Does a delete of a deployment not trigger a cascading delete of rs? |
@gtcno It should, but it does not. I have not found out why. |
Cannot reproduce the problem right now. Perhaps the bug was somewhere else... 🤔 |
This is a wormhole. But i thought this was fixed here I do think we should be careful with deleting resources that we dont explicitly create. |
No description provided.