Skip to content

Commit

Permalink
Use map[string][]byte instead of map[string]string
Browse files Browse the repository at this point in the history
  • Loading branch information
martin-helmich committed Jul 8, 2019
1 parent fb328c1 commit 95bff8b
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions replicate/configmaps.go
Expand Up @@ -7,7 +7,7 @@ import (
"strings"
"time"

"k8s.io/api/core/v1"
v1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/types"
Expand Down Expand Up @@ -130,15 +130,14 @@ func (r *configMapReplicator) replicateConfigMap(configMap *v1.ConfigMap, source
for key, value := range sourceConfigMap.Data {
configMapCopy.Data[key] = value
}

if sourceConfigMap.BinaryData != nil {
configMapCopy.BinaryData = make(map[string]string)
configMapCopy.BinaryData = make(map[string][]byte)
for key, value := range sourceConfigMap.BinaryData {
configMapCopy.BinaryData[key] = value
}
}


log.Printf("updating config map %s/%s", configMap.Namespace, configMap.Name)

configMapCopy.Annotations[ReplicatedAtAnnotation] = time.Now().Format(time.RFC3339)
Expand Down

0 comments on commit 95bff8b

Please sign in to comment.