mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-20 02:11:09 +00:00
squash: reaction to comments
This commit is contained in:
parent
0355f4482b
commit
95ae353f3a
@ -422,7 +422,8 @@ func (d *namespacedResourcesDeleter) deleteEachItem(gvr schema.GroupVersionResou
|
||||
}
|
||||
|
||||
type gvrDeletionMetadata struct {
|
||||
// finalizerEstimateSeconds is an estimate of how much longer to wait
|
||||
// finalizerEstimateSeconds is an estimate of how much longer to wait. zero means that no estimate has made and does not
|
||||
// mean that all content has been removed.
|
||||
finalizerEstimateSeconds int64
|
||||
// numRemaining is how many instances of the gvr remain
|
||||
numRemaining int
|
||||
|
@ -56,14 +56,14 @@ var (
|
||||
v1.NamespaceDeletionGVParsingFailure: "All legacy kube types successfully parsed",
|
||||
v1.NamespaceDeletionContentFailure: "All content successfully deleted, may be waiting on finalization",
|
||||
v1.NamespaceContentRemaining: "All content successfully removed",
|
||||
v1.NamespaceFinalizersRemaining: "All content successfully removed",
|
||||
v1.NamespaceFinalizersRemaining: "All content-preserving finalizers finished",
|
||||
}
|
||||
okReasons = map[v1.NamespaceConditionType]string{
|
||||
v1.NamespaceDeletionDiscoveryFailure: "ResourcesDiscovered",
|
||||
v1.NamespaceDeletionGVParsingFailure: "ParsedGroupVersions",
|
||||
v1.NamespaceDeletionContentFailure: "ContentDeleted",
|
||||
v1.NamespaceContentRemaining: "ContentRemoved",
|
||||
v1.NamespaceFinalizersRemaining: "ContentRemoved",
|
||||
v1.NamespaceFinalizersRemaining: "ContentHasNoFinalizers",
|
||||
}
|
||||
)
|
||||
|
||||
@ -133,8 +133,8 @@ func (u *namespaceConditionUpdater) ProcessContentTotals(contentTotals allGVRDel
|
||||
Type: v1.NamespaceFinalizersRemaining,
|
||||
Status: v1.ConditionTrue,
|
||||
LastTransitionTime: metav1.Now(),
|
||||
Reason: "SomeFinalizerRemain",
|
||||
Message: fmt.Sprintf("Some finalizers are remaining: %s", strings.Join(remainingByFinalizer, ", ")),
|
||||
Reason: "SomeFinalizersRemain",
|
||||
Message: fmt.Sprintf("Some content in the namespace has finalizers remaining: %s", strings.Join(remainingByFinalizer, ", ")),
|
||||
})
|
||||
}
|
||||
}
|
||||
|
@ -188,7 +188,7 @@ func TestProcessContentTotals(t *testing.T) {
|
||||
},
|
||||
},
|
||||
expecteds: []v1.NamespaceCondition{
|
||||
{Type: v1.NamespaceFinalizersRemaining, Status: v1.ConditionTrue, Reason: "SomeFinalizerRemain", Message: `Some finalizers are remaining: kubedb in 5 resource instances, service-catalog in 6 resource instances`},
|
||||
{Type: v1.NamespaceFinalizersRemaining, Status: v1.ConditionTrue, Reason: "SomeFinalizersRemain", Message: `Some content in the namespace has finalizers remaining: kubedb in 5 resource instances, service-catalog in 6 resource instances`},
|
||||
},
|
||||
},
|
||||
{
|
||||
@ -206,7 +206,7 @@ func TestProcessContentTotals(t *testing.T) {
|
||||
},
|
||||
expecteds: []v1.NamespaceCondition{
|
||||
{Type: v1.NamespaceContentRemaining, Status: v1.ConditionTrue, Reason: "SomeResourcesRemain", Message: `Some resources are remaining: daemonsets.apps.k8s.io has 5 resource instances, deployments.apps.k8s.io has 5 resource instances`},
|
||||
{Type: v1.NamespaceFinalizersRemaining, Status: v1.ConditionTrue, Reason: "SomeFinalizerRemain", Message: `Some finalizers are remaining: kubedb in 5 resource instances, service-catalog in 6 resource instances`},
|
||||
{Type: v1.NamespaceFinalizersRemaining, Status: v1.ConditionTrue, Reason: "SomeFinalizersRemain", Message: `Some content in the namespace has finalizers remaining: kubedb in 5 resource instances, service-catalog in 6 resource instances`},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
@ -101,7 +101,7 @@ func TestNamespaceCondition(t *testing.T) {
|
||||
if condition.Type == corev1.NamespaceContentRemaining && condition.Message == `Some resources are remaining: deployments.apps has 1 resource instances` {
|
||||
conditionsFound++
|
||||
}
|
||||
if condition.Type == corev1.NamespaceFinalizersRemaining && condition.Message == `Some finalizers are remaining: custom.io/finalizer in 1 resource instances` {
|
||||
if condition.Type == corev1.NamespaceFinalizersRemaining && condition.Message == `Some content in the namespace has finalizers remaining: custom.io/finalizer in 1 resource instances` {
|
||||
conditionsFound++
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user