github.com/operator-framework/operator-lifecycle-manager@v0.30.0/pkg/package-server/provider/labels.go (about)

     1  package provider
     2  
     3  import "strings"
     4  
     5  const (
     6  	OsLabelPrefix    = "operatorframework.io/os"
     7  	ArchLabelPrefix  = "operatorframework.io/arch"
     8  	DefaultOsLabel   = "operatorframework.io/os.linux"
     9  	DefaultArchLabel = "operatorframework.io/arch.amd64"
    10  	Supported        = "supported"
    11  )
    12  
    13  func setDefaultOsArchLabels(labels map[string]string) {
    14  	needsOsLabel := true
    15  	needsArchLabel := true
    16  	for k := range labels {
    17  		if strings.HasPrefix(k, OsLabelPrefix) {
    18  			needsOsLabel = false
    19  		}
    20  		if strings.HasPrefix(k, ArchLabelPrefix) {
    21  			needsArchLabel = false
    22  		}
    23  	}
    24  	if needsOsLabel {
    25  		labels[DefaultOsLabel] = Supported
    26  	}
    27  	if needsArchLabel {
    28  		labels[DefaultArchLabel] = Supported
    29  	}
    30  }