Skip to content

Commit

Permalink
Remove quotation from configmap results (#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
anvari1313 committed Apr 12, 2022
1 parent 33db321 commit 75e6744
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion cmd/yaml.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package cmd
import (
"os"
"reflect"
"strings"

"github.com/iancoleman/strcase"
log "github.com/sirupsen/logrus"
Expand Down Expand Up @@ -46,7 +47,10 @@ func yamlFunc(_ *cobra.Command, _ []string) {
log.WithError(err).Fatal("error in marshalling the configmap file with YAML format")
}

err = os.WriteFile(configMapPath, rawConfigMap, 0644)
// Remove any quotation mark from the result
rawConfigMapWithoutQuotation := strings.Replace(string(rawConfigMap), "'", "", -1)

err = os.WriteFile(configMapPath, []byte(rawConfigMapWithoutQuotation), 0644)
if err != nil {
log.WithError(err).WithField("path", configMapPath).Fatal("error in storing the configmap file")
}
Expand Down

0 comments on commit 75e6744

Please sign in to comment.