File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -84,6 +84,20 @@ function FetchAndImport-ModuleFromMetadata {
84
84
Import-Module - Force C:\$Filename
85
85
}
86
86
87
+ # Returns true if the ENABLE_NODE_LOGGING field in kube_env is true.
88
+ # $KubeEnv is a hash table containing the kube-env metadata keys+values.
89
+ function IsLoggingEnabled {
90
+ param (
91
+ [parameter (Mandatory = $true )] [hashtable ]$KubeEnv
92
+ )
93
+
94
+ if ($KubeEnv.Contains (' ENABLE_NODE_LOGGING' ) -and `
95
+ ($KubeEnv [' ENABLE_NODE_LOGGING' ] -eq ' true' )) {
96
+ return $true
97
+ }
98
+ return $false
99
+ }
100
+
87
101
try {
88
102
# Don't use FetchAndImport-ModuleFromMetadata for common.psm1 - the common
89
103
# module includes variables and functions that any other function may depend
@@ -108,6 +122,10 @@ try {
108
122
StartProcess- WriteSshKeys
109
123
}
110
124
125
+ if (IsLoggingEnabled $kube_env ) {
126
+ InstallAndStart- LoggingAgent
127
+ }
128
+
111
129
Set-EnvironmentVars
112
130
Create- Directories
113
131
Download- HelperScripts
You can’t perform that action at this time.
0 commit comments