feat(alerting): Add built-in alert for Kubernetes nodes in NotReady state [R8S-990] (#2485)

This commit is contained in:
RHCowan
2026-04-29 15:44:09 +12:00
committed by GitHub
parent 6a30138b3c
commit 49011d4d03
2 changed files with 5 additions and 3 deletions
+3 -3
View File
@@ -100,7 +100,7 @@ func TestValidateHelmRepositoryURL(t *testing.T) {
func Test_ValidateSeedsCacheAndSearchUsesCache(t *testing.T) {
const indexYAML = "apiVersion: v1\nentries: {}\ngenerated: \"2020-01-01T00:00:00Z\"\n"
var requestCount int32
var requestCount atomic.Int32
var fail bool
srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
@@ -109,7 +109,7 @@ func Test_ValidateSeedsCacheAndSearchUsesCache(t *testing.T) {
w.WriteHeader(http.StatusNotFound)
return
}
atomic.AddInt32(&requestCount, 1)
requestCount.Add(1)
w.WriteHeader(http.StatusOK)
_, _ = w.Write([]byte(indexYAML))
return
@@ -128,5 +128,5 @@ func Test_ValidateSeedsCacheAndSearchUsesCache(t *testing.T) {
// validate cache is used
err := ValidateHelmRepositoryURL(srv.URL, nil)
require.NoError(t, err)
require.Equal(t, int32(1), atomic.LoadInt32(&requestCount))
require.Equal(t, int32(1), requestCount.Load())
}
+2
View File
@@ -13,6 +13,8 @@ const (
ClusterFilesystemCapacityBytesMetric = "portainer_edge_agent_cluster_filesystem_capacity_bytes"
ClusterNetworkReceiveBytesMetric = "portainer_edge_agent_cluster_network_receive_bytes_total"
ClusterNetworkTransmitBytesMetric = "portainer_edge_agent_cluster_network_transmit_bytes_total"
ClusterNodeReadyMetric = "portainer_edge_agent_node_ready"
ClusterNodeUnschedulableMetric = "portainer_edge_agent_node_unschedulable"
)
// EdgeAlertBatch is the generic envelope pushed by edge agents.