func complianceInRelevantClusters(status []*policyv1.CompliancePerClusterStatus, relevantClusters []string) string {
	complianceFound := false
	compliance := "Compliant"

	for i := range status {
		if clusterInList(relevantClusters, status[i].ClusterName) {
			if string(status[i].ComplianceState) == "NonCompliant" {
				compliance = "NonCompliant"
				complianceFound = true
			} else if string(status[i].ComplianceState) != "" {
				complianceFound = true
			}
		}
	}

	if complianceFound {
		return compliance
	}

	return ""
}
// Helper function to filter out compliance statuses that are not in scope
Helper function to filter out compliance statuses that are not in scope
// Helper function to filter out compliance statuses that are not in scope
func complianceInRelevantClusters(status []*policyv1.CompliancePerClusterStatus, relevantClusters []string) string {
	complianceFound := false
	compliance := "Compliant"
	for i := range status {
		if clusterInList(relevantClusters, status[i].ClusterName) {
			if string(status[i].ComplianceState) == "NonCompliant" {
				compliance = "NonCompliant"
				complianceFound = true
			} else if string(status[i].ComplianceState) != "" {
				complianceFound = true
			}
		}
	}
	if complianceFound {
		return compliance
	}
	return ""
}
func complianceInRelevantClusters ( status [ ] * policyv1 . CompliancePerClusterStatus , relevantClusters [ ] string ) string { complianceFound := false compliance := " " for i := range status { if clusterInList ( relevantClusters , status [ i ] . ClusterName ) { if string ( status [ i ] . ComplianceState ) == " " { compliance = " " complianceFound = true } else if string ( status [ i ] . ComplianceState ) != " " { complianceFound = true } } } if complianceFound { return compliance } return " " }
Helper function to filter out compliance statuses that are not in scope
Helper function to filter out compliance statuses that are not in scope