// Code generated by scripts/release_control/generate_platform_support_backend_module.py. // DO NOT EDIT. // Source: docs/release-control/v6/internal/PLATFORM_SUPPORT_MANIFEST.json // Source SHA256: 16bcaabb45bed31b4bbd414e4e665dac63591ea1ac0e739464808381eb58e004 package platformsupport import "strings" // ManifestSourcePath is the repo-relative path to the canonical manifest used // to produce this projection. const ManifestSourcePath = "docs/release-control/v6/internal/PLATFORM_SUPPORT_MANIFEST.json" // ManifestSourceSHA256 is the sha256 of the manifest bytes used to produce // this projection. const ManifestSourceSHA256 = "16bcaabb45bed31b4bbd414e4e665dac63591ea1ac0e739464808381eb58e004" // ManifestSchemaVersion is the schema_version field of the manifest. const ManifestSchemaVersion = 2 // AgentHostProfileEntry is the generated projection of an agent host profile. type AgentHostProfileEntry struct { ID string Family string GovernanceState string ReadinessStage string HostIdentityTokens []string RuntimePlatform string } // agentHostProfileEntries is the generated agent host profile manifest projection. var agentHostProfileEntries = []AgentHostProfileEntry{ { ID: "unraid", Family: "Unraid", GovernanceState: "supported", ReadinessStage: "supported", HostIdentityTokens: []string{"unraid", "unraid-os", "unraid os"}, RuntimePlatform: "linux", }, } func AgentHostProfiles() []AgentHostProfileEntry { out := make([]AgentHostProfileEntry, len(agentHostProfileEntries)) for index, profile := range agentHostProfileEntries { out[index] = cloneAgentHostProfile(profile) } return out } func AgentHostProfileByID(value string) (AgentHostProfileEntry, bool) { normalized := normalizeIdentityToken(value) if normalized == "" { return AgentHostProfileEntry{}, false } for _, profile := range agentHostProfileEntries { if profile.ID == normalized { return cloneAgentHostProfile(profile), true } } return AgentHostProfileEntry{}, false } func AgentHostProfileForIdentity(values ...string) (AgentHostProfileEntry, bool) { for _, value := range values { for _, profile := range agentHostProfileEntries { if agentHostProfileMatchesIdentity(profile, value) { return cloneAgentHostProfile(profile), true } } } return AgentHostProfileEntry{}, false } func RuntimePlatformForHostIdentityToken(value string) string { profile, ok := AgentHostProfileForIdentity(value) if !ok { return "" } return profile.RuntimePlatform } func NormalizeRuntimePlatformForAgentHostProfile(profileID, platform string) string { reportedPlatform := strings.TrimSpace(platform) profile, ok := AgentHostProfileByID(profileID) if !ok || strings.TrimSpace(profile.RuntimePlatform) == "" { return reportedPlatform } return profile.RuntimePlatform } func (profile AgentHostProfileEntry) MatchesIdentity(value string) bool { return agentHostProfileMatchesIdentity(profile, value) } func agentHostProfileMatchesIdentity(profile AgentHostProfileEntry, value string) bool { normalized := normalizeIdentityToken(value) if normalized == "" { return false } if profile.ID == normalized { return true } for _, token := range profile.HostIdentityTokens { if normalizeIdentityToken(token) == normalized { return true } } return false } func cloneAgentHostProfile(profile AgentHostProfileEntry) AgentHostProfileEntry { profile.HostIdentityTokens = append([]string(nil), profile.HostIdentityTokens...) return profile } func normalizeIdentityToken(value string) string { return strings.ToLower(strings.TrimSpace(value)) }