feat: add details demo
ci-api / test (push) Has been cancelled

This commit is contained in:
Nuxgrid
2026-07-28 14:44:48 +02:00
parent 65ca24b6eb
commit 4b3a5720a3
8 changed files with 143 additions and 38 deletions
@@ -335,3 +335,39 @@ func (h *HelmProvisioner) waitForRollout(namespace string) error {
}
}
}
func (h *HelmProvisioner) GetResourceState(
ctx context.Context,
namespace string,
) (ResourceState, error) {
pods, err := h.k8sClient.
CoreV1().
Pods(namespace).
List(ctx, metav1.ListOptions{})
if err != nil {
return ResourceState{}, err
}
var state ResourceState
for _, pod := range pods.Items {
status := string(pod.Status.Phase)
switch {
case strings.Contains(pod.Name, "backend"):
state.APIState = status
case strings.Contains(pod.Name, "frontend"):
state.WebState = status
case strings.Contains(pod.Name, "postgresql"):
state.DBState = status
case strings.Contains(pod.Name, "redis"):
state.DBMemoryState = status
}
}
return state, nil
}