mirror of
https://github.com/tailscale/tailscale.git
synced 2024-11-25 19:15:34 +00:00
cmd/k8s-operator: don't error out if ProxyClass for ProxyGroup not found. (#13736)
We don't need to error out and continuously reconcile if ProxyClass has not (yet) been created, once it gets created the ProxyGroup reconciler will get triggered. Updates tailscale/tailscale#13406 Signed-off-by: Irbe Krumina <irbe@tailscale.com>
This commit is contained in:
parent
60011e73b8
commit
f6d4d03355
@ -146,7 +146,14 @@ func (r *ProxyGroupReconciler) Reconcile(ctx context.Context, req reconcile.Requ
|
|||||||
var proxyClass *tsapi.ProxyClass
|
var proxyClass *tsapi.ProxyClass
|
||||||
if proxyClassName != "" {
|
if proxyClassName != "" {
|
||||||
proxyClass = new(tsapi.ProxyClass)
|
proxyClass = new(tsapi.ProxyClass)
|
||||||
if err = r.Get(ctx, types.NamespacedName{Name: proxyClassName}, proxyClass); err != nil {
|
err := r.Get(ctx, types.NamespacedName{Name: proxyClassName}, proxyClass)
|
||||||
|
if apierrors.IsNotFound(err) {
|
||||||
|
err = nil
|
||||||
|
message := fmt.Sprintf("the ProxyGroup's ProxyClass %s does not (yet) exist", proxyClassName)
|
||||||
|
logger.Info(message)
|
||||||
|
return setStatusReady(pg, metav1.ConditionFalse, reasonProxyGroupCreating, message)
|
||||||
|
}
|
||||||
|
if err != nil {
|
||||||
err = fmt.Errorf("error getting ProxyGroup's ProxyClass %s: %s", proxyClassName, err)
|
err = fmt.Errorf("error getting ProxyGroup's ProxyClass %s: %s", proxyClassName, err)
|
||||||
r.recorder.Eventf(pg, corev1.EventTypeWarning, reasonProxyGroupCreationFailed, err.Error())
|
r.recorder.Eventf(pg, corev1.EventTypeWarning, reasonProxyGroupCreationFailed, err.Error())
|
||||||
return setStatusReady(pg, metav1.ConditionFalse, reasonProxyGroupCreationFailed, err.Error())
|
return setStatusReady(pg, metav1.ConditionFalse, reasonProxyGroupCreationFailed, err.Error())
|
||||||
|
Loading…
Reference in New Issue
Block a user