зеркало из
1
0
Форкнуть 0
node-label-operator/labelsync/patch.go

28 строки
692 B
Go
Исходник Обычный вид История

package labelsync
import (
"encoding/json"
"github.com/Azure/node-label-operator/labelsync/options"
)
func LabelPatch(labels map[string]string) ([]byte, error) {
return json.Marshal(map[string]interface{}{
"metadata": map[string]interface{}{
"labels": labels,
},
})
}
func LabelPatchWithDelete(labels map[string]*string) ([]byte, error) {
return json.Marshal(map[string]interface{}{
"metadata": map[string]interface{}{
"labels": labels,
},
})
}
func labelDeletionAllowed(configOptions *options.ConfigOptions) bool {
return configOptions.LabelPrefix != "" && (configOptions.ConflictPolicy == options.ARMPrecedence || configOptions.ConflictPolicy == options.Ignore)
}