clearml_agent/glue/k8s.py
def _safe_k8s_label_value(value):
        """ Conform string to k8s standards for a label value """
        value = value.lower().strip()
        value = re.sub(r'^[^A-Za-z0-9]+', '', value)  # strip leading non-alphanumeric chars
        value = re.sub(r'[^A-Za-z0-9]+$', '', value)  # strip trailing non-alphanumeric chars
        value = re.sub(r'\W+', '-', value)  # allow only word chars (this removed "." which is supported, but nvm)
        value = re.sub(r'-+', '-', value)  # don't leave messy "--" after replacing previous chars
        return value[:63]
 Conform string to k8s standards for a label value 
Conform string to k8s standards for a label value
Conform string to k8s standards for a label value
def _safe_k8s_label_value(value):
        value = value.lower().strip()
        value = re.sub(r'^[^A-Za-z0-9]+', '', value)  
        value = re.sub(r'[^A-Za-z0-9]+$', '', value)  
        value = re.sub(r'\W+', '-', value)  
        value = re.sub(r'-+', '-', value)  
        return value[:63]
def _safe_k8s_label_value ( value ) : value = value . lower ( ) . strip ( ) value = re . sub ( r'^[^A-Za-z0-9]+' , '' , value ) value = re . sub ( r'[^A-Za-z0-9]+$' , '' , value ) value = re . sub ( r'\W+' , '-' , value ) value = re . sub ( r'-+' , '-' , value ) return value [ : 63 ]
Conform string to k8s standards for a label value
Conform string to k8s standards for a label value
""" Conform string to k8s standards for a label value """ # strip leading non-alphanumeric chars # strip trailing non-alphanumeric chars # allow only word chars (this removed "." which is supported, but nvm) # don't leave messy "--" after replacing previous chars
value