@@ -138,6 +138,21 @@ func ToRunnerInstance(fileAccess ConfigFileAccess) (*runnerconfiguration.RunnerI
138138 }
139139 ephemeral , _ := strconv .ParseBool (agent .Ephemeral )
140140 disableUpdate , _ := strconv .ParseBool (agent .DisableUpdate )
141+
142+ props := protocol.PropertiesCollection {}
143+ if agent .ServerURLV2 != "" {
144+ props ["ServerUrlV2" ] = protocol.PropertyValue {
145+ Type : "System.String" ,
146+ Value : agent .ServerURLV2 ,
147+ }
148+ }
149+ if agent .UseV2Flow {
150+ props ["UseV2Flow" ] = protocol.PropertyValue {
151+ Type : "System.Boolean" ,
152+ Value : agent .UseV2Flow ,
153+ }
154+ }
155+
141156 return & runnerconfiguration.RunnerInstance {
142157 PoolID : poolID ,
143158 Auth : & protocol.GitHubAuthResult {
@@ -155,14 +170,17 @@ func ToRunnerInstance(fileAccess ConfigFileAccess) (*runnerconfiguration.RunnerI
155170 },
156171 DisableUpdate : disableUpdate ,
157172 Version : "3.0.0" ,
158- ServerV2URL : agent . ServerURLV2 ,
173+ Properties : props ,
159174 },
160175 WorkFolder : agent .WorkFolder ,
161176 RegistrationURL : agent .GitHubURL ,
162177 }, nil
163178}
164179
165180func FromRunnerInstance (instance * runnerconfiguration.RunnerInstance , fileAccess ConfigFileAccess ) error {
181+
182+ useV2Flow , _ := instance .Agent .Properties .LookupBool ("UseV2Flow" )
183+ serverV2URL , _ := instance .Agent .Properties .LookupString ("ServerUrlV2" )
166184 agent := & DotnetAgent {
167185 AgentID : fmt .Sprint (instance .Agent .ID ),
168186 AgentName : instance .Agent .Name ,
@@ -172,8 +190,8 @@ func FromRunnerInstance(instance *runnerconfiguration.RunnerInstance, fileAccess
172190 ServerURL : instance .Auth .TenantURL ,
173191 WorkFolder : instance .WorkFolder ,
174192 GitHubURL : instance .RegistrationURL ,
175- UseV2Flow : instance . Auth . UseV2FLow ,
176- ServerURLV2 : instance . Agent . ServerV2URL ,
193+ UseV2Flow : useV2Flow ,
194+ ServerURLV2 : serverV2URL ,
177195 }
178196 if agent .WorkFolder == "" {
179197 agent .WorkFolder = "_work"
0 commit comments