// GetNodeLabels returns a consistent set of labels that should be applied to the node
GetNodeLabels returns a consistent set of labels that should be applied to the node
// GetNodeLabels returns a consistent set of labels that should be applied to the node
func (s *Server) GetNodeLabels(profileLabels map[string]string) map[string]string {
	labels := map[string]string{
		defaults.KubernetesAdvertiseIPLabel:            s.AdvertiseIP,
		defaults.KubernetesRoleLabel:                   s.ClusterRole,
		v1.LabelHostname:                               s.KubeNodeID(),
		v1.LabelArchStable:                             "amd64", 
		v1.LabelOSStable:                               "linux", 
		defaults.FormatKubernetesNodeRoleLabel(s.Role): s.Role,
	}
	for k, v := range profileLabels {
		if _, ok := labels[k]; !ok {
			labels[k] = v
		}
	}
	return labels
}
func ( s * Server ) GetNodeLabels ( profileLabels map [ string ] string ) map [ string ] string { labels := map [ string ] string { defaults . KubernetesAdvertiseIPLabel : s . AdvertiseIP , defaults . KubernetesRoleLabel : s . ClusterRole , v1 . LabelHostname : s . KubeNodeID ( ) , v1 . LabelArchStable : " " , v1 . LabelOSStable : " " , defaults . FormatKubernetesNodeRoleLabel ( s . Role ) : s . Role , } for k , v := range profileLabels { if _ , ok := labels [ k ] ; ! ok { labels [ k ] = v } } return labels }
GetNodeLabels returns a consistent set of labels that should be applied to the node
GetNodeLabels returns a consistent set of labels that should be applied to the node
// Only amd64 is currently supported // Only linux is currently supported // Several of the labels applied by default are used internally within gravity or gravity components. // allowing a user to override these labels via the profile creates some risk, that they may overwrite a node // label gravity uses itself. As such, for now, only apply the profile labels if they do not conflict with a // default label.