INNER CODE UNIT · Go
configIsDisabled
fluxcd/flagger · pkg/canary/config_tracker.go:72
func configIsDisabled(annotations map[string]string) bool {
return strings.HasPrefix(annotations[configTrackingDisabledAnnotationKey], "disable")
}
// getRefFromConfigMap transforms a Kubernetes ConfigMap into a ConfigRef
// and computes the checksum of the ConfigMap data
func (ct *ConfigTracker) getRefFromConfigMap(name string, namespace string) (*ConfigRef, error) {
config, err := ct.KubeClient.CoreV1().ConfigMaps(namespace).Get(context.TODO(), name, metav1.GetOptions{})
if err != nil {
return nil, fmt.Errorf("configmap %s.%s get query error: %w", name, namespace, err)
}
if configIsDisabled(config.GetAnnotations()) {
return nil, nil
}
return &ConfigRef{
Name: config.Name,