Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix the addresss of the BuildService #7367

Closed
wants to merge 8 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -561,7 +561,14 @@ internal HttpRequestMessage BuildSetTriggersRequest()
var url = default(string);
if (_environment.IsKubernetesManagedHosting())
{
url = $"http://{ManagedKubernetesBuildServiceName}.{ManagedKubernetesBuildServiceNamespace}.svc.cluster.local:{ManagedKubernetesBuildServicePort}/operations/settriggers";
var buildServiceHostname =
_environment.GetEnvironmentVariable(EnvironmentSettingNames.BuildServiceHostname);

Copy link
Member

@pragnagopa pragnagopa May 12, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move this to environment extensions and add tests

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.
Could you have a look? @pragnagopa

if (string.IsNullOrEmpty(buildServiceHostname))
{
buildServiceHostname = $"http://{ManagedKubernetesBuildServiceName}.{ManagedKubernetesBuildServiceNamespace}.svc.cluster.local:{ManagedKubernetesBuildServicePort}";
}
url = $"{buildServiceHostname}/api/operations/settriggers";
}
else
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ public static class EnvironmentSettingNames
public const string PodName = "POD_NAME";
public const string PodEncryptionKey = "POD_ENCRYPTION_KEY";
public const string HttpLeaderEndpoint = "HTTP_LEADER_ENDPOINT";
public const string BuildServiceHostname = "BUILD_SERVICE_HOSTNAME";

/// <summary>
/// Environment variable dynamically set by the platform when it is safe to
Expand Down