INNER CODE UNIT · Go

isMatchingLabel

updatecli/updatecli · pkg/core/config/main.go:559

func isMatchingLabel(specLabels map[string]string, filterLabels map[string]string) bool {
	if len(filterLabels) == 0 {
		return true
	}

	for key, value := range filterLabels {
		if _, ok := specLabels[key]; !ok {
			return false
		}

		if value != "" && specLabels[key] != value {
			// Label key exists but value does not match
			return false
		}
	}
	// All filter labels matched
	return true
}

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…