mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-21 01:50:55 +00:00
more artisanal fixes
Most of these could have been refactored automatically but it wouldn't have been uglier. The unsophisticated tooling left lots of unnecessary struct -> pointer -> struct transitions.
This commit is contained in:
@@ -192,9 +192,9 @@ func (tc *TokenCleaner) evalSecret(o interface{}) {
|
||||
ttl, alreadyExpired := bootstrapsecretutil.GetExpiration(secret, time.Now())
|
||||
if alreadyExpired {
|
||||
klog.V(3).Infof("Deleting expired secret %s/%s", secret.Namespace, secret.Name)
|
||||
var options *metav1.DeleteOptions
|
||||
var options metav1.DeleteOptions
|
||||
if len(secret.UID) > 0 {
|
||||
options = &metav1.DeleteOptions{Preconditions: &metav1.Preconditions{UID: &secret.UID}}
|
||||
options.Preconditions = &metav1.Preconditions{UID: &secret.UID}
|
||||
}
|
||||
err := tc.client.CoreV1().Secrets(secret.Namespace).Delete(context.TODO(), secret.Name, options)
|
||||
// NotFound isn't a real error (it's already been deleted)
|
||||
|
Reference in New Issue
Block a user