mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-27 05:27:21 +00:00
Replace the hostname in the fluentd config file even if the file exists
This commit is contained in:
parent
19ee1ea9fa
commit
a70a534736
@ -1528,13 +1528,12 @@ function Configure-LoggingAgent {
|
|||||||
if (-not (ShouldWrite-File $fluentd_config_file)) {
|
if (-not (ShouldWrite-File $fluentd_config_file)) {
|
||||||
Log-Output ("Skip: fluentd logging config $fluentd_config_file already " +
|
Log-Output ("Skip: fluentd logging config $fluentd_config_file already " +
|
||||||
"exists")
|
"exists")
|
||||||
return
|
} else {
|
||||||
|
# Create a configuration file for kubernetes containers.
|
||||||
|
# The config.d directory should have already been created automatically, but
|
||||||
|
# try creating again just in case.
|
||||||
|
New-Item $fluentd_config_dir -ItemType 'directory' -Force | Out-Null
|
||||||
}
|
}
|
||||||
|
|
||||||
# Create a configuration file for kubernetes containers.
|
|
||||||
# The config.d directory should have already been created automatically, but
|
|
||||||
# try creating again just in case.
|
|
||||||
New-Item $fluentd_config_dir -ItemType 'directory' -Force | Out-Null
|
|
||||||
$config = $FLUENTD_CONFIG.replace('NODE_NAME', (hostname))
|
$config = $FLUENTD_CONFIG.replace('NODE_NAME', (hostname))
|
||||||
$config | Out-File -FilePath $fluentd_config_file -Encoding ASCII
|
$config | Out-File -FilePath $fluentd_config_file -Encoding ASCII
|
||||||
Log-Output "Wrote fluentd logging config to $fluentd_config_file"
|
Log-Output "Wrote fluentd logging config to $fluentd_config_file"
|
||||||
|
Loading…
Reference in New Issue
Block a user