Skip to content

Commit f247495

Browse files
committed
Adding ENABLE_STACKDRIVER_WINDOWS
1 parent 53a2559 commit f247495

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

cluster/gce/windows/configure.ps1

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,14 +84,19 @@ function FetchAndImport-ModuleFromMetadata {
8484
Import-Module -Force C:\$Filename
8585
}
8686

87-
# Returns true if the ENABLE_NODE_LOGGING field in kube_env is true.
87+
# Returns true if the ENABLE_STACKDRIVER_WINDOWS or ENABLE_NODE_LOGGING field in kube_env is true.
8888
# $KubeEnv is a hash table containing the kube-env metadata keys+values.
89+
# ENABLE_NODE_LOGGING is used for legacy Stackdriver Logging, and will be deprecated (always set to False)
90+
# soon. ENABLE_STACKDRIVER_WINDOWS is added to indicate whether logging is enabled for windows nodes.
8991
function IsLoggingEnabled {
9092
param (
9193
[parameter(Mandatory=$true)] [hashtable]$KubeEnv
9294
)
9395

94-
if ($KubeEnv.Contains('ENABLE_NODE_LOGGING') -and `
96+
if ($KubeEnv.Contains('ENABLE_STACKDRIVER_WINDOWS') -and `
97+
($KubeEnv['ENABLE_STACKDRIVER_WINDOWS'] -eq 'true')) {
98+
return $true
99+
} elseif ($KubeEnv.Contains('ENABLE_NODE_LOGGING') -and `
95100
($KubeEnv['ENABLE_NODE_LOGGING'] -eq 'true')) {
96101
return $true
97102
}

0 commit comments

Comments
 (0)