Skip to content

Commit a70a534

Browse files
committed
Replace the hostname in the fluentd config file even if the file exists
1 parent 19ee1ea commit a70a534

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

cluster/gce/windows/k8s-node-setup.psm1

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1528,13 +1528,12 @@ function Configure-LoggingAgent {
15281528
if (-not (ShouldWrite-File $fluentd_config_file)) {
15291529
Log-Output ("Skip: fluentd logging config $fluentd_config_file already " +
15301530
"exists")
1531-
return
1531+
} else {
1532+
# Create a configuration file for kubernetes containers.
1533+
# The config.d directory should have already been created automatically, but
1534+
# try creating again just in case.
1535+
New-Item $fluentd_config_dir -ItemType 'directory' -Force | Out-Null
15321536
}
1533-
1534-
# Create a configuration file for kubernetes containers.
1535-
# The config.d directory should have already been created automatically, but
1536-
# try creating again just in case.
1537-
New-Item $fluentd_config_dir -ItemType 'directory' -Force | Out-Null
15381537
$config = $FLUENTD_CONFIG.replace('NODE_NAME', (hostname))
15391538
$config | Out-File -FilePath $fluentd_config_file -Encoding ASCII
15401539
Log-Output "Wrote fluentd logging config to $fluentd_config_file"

0 commit comments

Comments
 (0)