mirror of
https://github.com/tailscale/tailscale.git
synced 2025-08-18 00:47:32 +00:00
make ProxyGroupReady condition for kube-apiserver dependent on Service readiness
Change-Id: I951bcb9035521861bf3ca0ce037800692b23c77d Signed-off-by: Tom Proctor <tomhjp@users.noreply.github.com>
This commit is contained in:
@@ -466,6 +466,12 @@ func (r *ProxyGroupReconciler) maybeUpdateStatus(ctx context.Context, logger *za
|
|||||||
case len(devices) < desiredReplicas:
|
case len(devices) < desiredReplicas:
|
||||||
case len(devices) > desiredReplicas:
|
case len(devices) > desiredReplicas:
|
||||||
message = fmt.Sprintf("waiting for %d ProxyGroup pods to shut down", len(devices)-desiredReplicas)
|
message = fmt.Sprintf("waiting for %d ProxyGroup pods to shut down", len(devices)-desiredReplicas)
|
||||||
|
case pg.Spec.Type == tsapi.ProxyGroupTypeKubernetesAPIServer && !tsoperator.ProxyGroupTailscaleServiceValid(pg):
|
||||||
|
reason = reasonProxyGroupInvalid
|
||||||
|
message = "waiting for configured Tailscale Service to be marked valid"
|
||||||
|
case pg.Spec.Type == tsapi.ProxyGroupTypeKubernetesAPIServer && !tsoperator.ProxyGroupTailscaleServiceConfigured(pg):
|
||||||
|
reason = reasonProxyGroupCreating
|
||||||
|
message = "waiting for proxies to start advertising the configured Tailscale Service"
|
||||||
default:
|
default:
|
||||||
status = metav1.ConditionTrue
|
status = metav1.ConditionTrue
|
||||||
reason = reasonProxyGroupReady
|
reason = reasonProxyGroupReady
|
||||||
|
@@ -146,6 +146,16 @@ func ProxyGroupAvailable(pg *tsapi.ProxyGroup) bool {
|
|||||||
return cond != nil && cond.Status == metav1.ConditionTrue
|
return cond != nil && cond.Status == metav1.ConditionTrue
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func ProxyGroupTailscaleServiceValid(pg *tsapi.ProxyGroup) bool {
|
||||||
|
cond := proxyGroupCondition(pg, tsapi.PGTailscaleServiceValid)
|
||||||
|
return cond != nil && cond.Status == metav1.ConditionTrue && cond.ObservedGeneration == pg.Generation
|
||||||
|
}
|
||||||
|
|
||||||
|
func ProxyGroupTailscaleServiceConfigured(pg *tsapi.ProxyGroup) bool {
|
||||||
|
cond := proxyGroupCondition(pg, tsapi.PGTailscaleServiceConfigured)
|
||||||
|
return cond != nil && cond.Status == metav1.ConditionTrue && cond.ObservedGeneration == pg.Generation
|
||||||
|
}
|
||||||
|
|
||||||
func proxyGroupCondition(pg *tsapi.ProxyGroup, condType tsapi.ConditionType) *metav1.Condition {
|
func proxyGroupCondition(pg *tsapi.ProxyGroup, condType tsapi.ConditionType) *metav1.Condition {
|
||||||
idx := xslices.IndexFunc(pg.Status.Conditions, func(cond metav1.Condition) bool {
|
idx := xslices.IndexFunc(pg.Status.Conditions, func(cond metav1.Condition) bool {
|
||||||
return cond.Type == string(condType)
|
return cond.Type == string(condType)
|
||||||
|
Reference in New Issue
Block a user