mirror of
https://github.com/psviderski/uncloud.git
synced 2026-08-26 11:03:34 +00:00
fix(pre-deploy): exclude hook containers from caddy and dns controllers
This commit is contained in:
@@ -94,13 +94,16 @@ func (c *Controller) Run(ctx context.Context) error {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// filterHealthyContainers filters out containers that are not healthy.
|
// filterHealthyContainers filters out unhealthy and hook containers.
|
||||||
// TODO: Filters out containers from this machine that are likely unavailable. The availability can be determined
|
// TODO: Filters out containers from this machine that are likely unavailable. The availability can be determined
|
||||||
// by the cluster membership state of the machine that the container is running on. Implement machine membership
|
// by the cluster membership state of the machine that the container is running on. Implement machine membership
|
||||||
// check using Corrossion Admin client.
|
// check using Corrossion Admin client.
|
||||||
func filterHealthyContainers(containers []store.ContainerRecord) []store.ContainerRecord {
|
func filterHealthyContainers(containers []store.ContainerRecord) []store.ContainerRecord {
|
||||||
healthy := make([]store.ContainerRecord, 0, len(containers))
|
healthy := make([]store.ContainerRecord, 0, len(containers))
|
||||||
for _, cr := range containers {
|
for _, cr := range containers {
|
||||||
|
if cr.Container.IsHook() {
|
||||||
|
continue
|
||||||
|
}
|
||||||
if cr.Container.Healthy() {
|
if cr.Container.Healthy() {
|
||||||
healthy = append(healthy, cr)
|
healthy = append(healthy, cr)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -72,6 +72,9 @@ func (r *ClusterResolver) updateServiceIPs(containers []store.ContainerRecord) {
|
|||||||
|
|
||||||
containersCount := 0
|
containersCount := 0
|
||||||
for _, record := range containers {
|
for _, record := range containers {
|
||||||
|
if record.Container.IsHook() {
|
||||||
|
continue
|
||||||
|
}
|
||||||
if !record.Container.Healthy() {
|
if !record.Container.Healthy() {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user