Skip to content

Commit

Permalink
Add quotes to windows cni plugin template so that it's valid JSON even
Browse files Browse the repository at this point in the history
before substitution (this helps with operator testing).
  • Loading branch information
coutinhop committed Jul 25, 2023
1 parent bca37df commit 1a45192
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions cni-plugin/pkg/install/install_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ func defaultNetConf() string {
},
"log_level": "__LOG_LEVEL__",
"log_file_path": "__LOG_FILE_PATH__",
"windows_loopback_DSR": __DSR_SUPPORT__,
"windows_loopback_DSR": "__DSR_SUPPORT__",
"capabilities": {"dns": true},
"DNS": {
"Nameservers": [__KUBERNETES_DNS_SERVERS__],
Expand Down Expand Up @@ -154,9 +154,9 @@ func replacePlatformSpecificVars(c config, netconf string) string {
}
supportsDSR := (winVerInt == 1809 && buildNumInt >= 17763 && halVerInt >= 1432) || (winVerInt >= 1903 && buildNumInt >= 18317)
if supportsDSR {
netconf = strings.Replace(netconf, "__DSR_SUPPORT__", "true", -1)
netconf = strings.Replace(netconf, `"__DSR_SUPPORT__"`, "true", -1)
} else {
netconf = strings.Replace(netconf, "__DSR_SUPPORT__", "false", -1)
netconf = strings.Replace(netconf, `"__DSR_SUPPORT__"`, "false", -1)
}

return netconf
Expand Down

0 comments on commit 1a45192

Please sign in to comment.