Cluster: Rename RoleInstance to RoleApp in service/cluster/roles.go #98

Signed-off-by: Michael Mayer <michael@photoprism.app>
This commit is contained in:
Michael Mayer
2025-10-31 16:46:42 +01:00
parent ef1f0f3bb2
commit 755ebe0aee
34 changed files with 165 additions and 157 deletions

View File

@@ -105,7 +105,7 @@ func TestGetMetrics(t *testing.T) {
name string
role string
}{
{"metrics-instance-1", string(cluster.RoleInstance)},
{"metrics-instance-1", string(cluster.RoleApp)},
{"metrics-service-1", string(cluster.RoleService)},
}
@@ -131,7 +131,7 @@ func TestGetMetrics(t *testing.T) {
body := resp.Body.String()
floatPattern := `[-+]?\d+(?:\.\d+)?(?:e[-+]?\d+)?`
assert.Regexp(t, regexp.MustCompile(`photoprism_cluster_nodes{role="total"} `+floatPattern), body)
assert.Regexp(t, regexp.MustCompile(`photoprism_cluster_nodes{role="instance"} `+floatPattern), body)
assert.Regexp(t, regexp.MustCompile(`photoprism_cluster_nodes{role="app"} `+floatPattern), body)
assert.Regexp(t, regexp.MustCompile(`photoprism_cluster_nodes{role="service"} `+floatPattern), body)
infoPattern := `photoprism_cluster_info\{(?:cidr="[^"]*",[^}]*uuid="[^"]*"|uuid="[^"]*",[^}]*cidr="[^"]*")\} 1`
assert.Regexp(t, regexp.MustCompile(infoPattern), body)