File tree Expand file tree Collapse file tree 2 files changed +10
-3
lines changed
src/WebJobs.Script.WebHost/Management
test/WebJobs.Script.Tests.Integration/Management Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -561,7 +561,13 @@ internal HttpRequestMessage BuildSetTriggersRequest()
561
561
var url = default ( string ) ;
562
562
if ( _environment . IsKubernetesManagedHosting ( ) )
563
563
{
564
- url = $ "http://{ ManagedKubernetesBuildServiceName } .{ ManagedKubernetesBuildServiceNamespace } .svc.cluster.local:{ ManagedKubernetesBuildServicePort } /operations/settriggers";
564
+ var buildServiceHostname =
565
+ _environment . GetEnvironmentVariable ( "BUILD_SERVICE_HOSTNAME" ) ;
566
+ if ( string . IsNullOrEmpty ( buildServiceHostname ) )
567
+ {
568
+ buildServiceHostname = $ "http://{ ManagedKubernetesBuildServiceName } .{ ManagedKubernetesBuildServiceNamespace } .svc.cluster.local:{ ManagedKubernetesBuildServicePort } ";
569
+ }
570
+ url = $ "{ buildServiceHostname } /api/operations/settriggers";
565
571
}
566
572
else
567
573
{
Original file line number Diff line number Diff line change @@ -657,13 +657,14 @@ public void Use_Website_Name_If_Website_Hostname_Is_Not_Available(string hostNam
657
657
}
658
658
659
659
[ Theory ]
660
- [ InlineData ( "KUBERNETES_SERVICE_HOST" , "http://k8se-build-service.k8se-system.svc.cluster.local:8181/operations/settriggers" ) ]
660
+ [ InlineData ( "KUBERNETES_SERVICE_HOST" , "http://k8se-build-service.k8se-system.svc.cluster.local:8181/api/ operations/settriggers" ) ]
661
661
[ InlineData ( null , "https://appname.azurewebsites.net/operations/settriggers" ) ]
662
662
public void Managed_Kubernetes_Environment_SyncTrigger_Url_Validation ( string kubernetesServiceHost , string expectedSyncTriggersUri )
663
663
{
664
664
_mockEnvironment . Setup ( p => p . GetEnvironmentVariable ( EnvironmentSettingNames . KubernetesServiceHost ) ) . Returns ( kubernetesServiceHost ) ;
665
665
_mockEnvironment . Setup ( p => p . GetEnvironmentVariable ( EnvironmentSettingNames . PodNamespace ) ) . Returns ( "POD_NAMESPACE" ) ;
666
-
666
+ _mockEnvironment . Setup ( p => p . GetEnvironmentVariable ( "BUILD_SERVICE_HOSTNAME" ) )
667
+ . Returns ( "" ) ;
667
668
var httpRequest = _functionsSyncManager . BuildSetTriggersRequest ( ) ;
668
669
Assert . Equal ( expectedSyncTriggersUri , httpRequest . RequestUri . AbsoluteUri ) ;
669
670
Assert . Equal ( HttpMethod . Post , httpRequest . Method ) ;
You can’t perform that action at this time.
0 commit comments