Skip to content

Commit

Permalink
Split domain knob into separate build|pipeline artifact knobs.
Browse files Browse the repository at this point in the history
  • Loading branch information
Brian Barthel committed Jan 28, 2024
1 parent 5f550fd commit 183538b
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/Agent.Plugins/Artifact/PipelineArtifactServer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ internal async Task UploadAsync(
cancellationToken);

// Check if the pipeline has an override domain set, if not, use the default domain from the client settings.
string overrideDomain = AgentKnobs.SendArtifactsToBlobstoreDomain.GetValue(context).AsString();
string overrideDomain = AgentKnobs.SendPipelineArtifactsToBlobstoreDomain.GetValue(context).AsString();
IDomainId domainId = String.IsNullOrWhiteSpace(overrideDomain) ? clientSettings.GetDefaultDomainId() : DomainIdFactory.Create(overrideDomain);

var (dedupManifestClient, clientTelemetry) = DedupManifestArtifactClientFactory.Instance
Expand Down
16 changes: 11 additions & 5 deletions src/Agent.Sdk/Knob/AgentKnobs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -374,11 +374,17 @@ public class AgentKnobs
new RuntimeKnobSource("DISABLE_BUILD_ARTIFACTS_TO_BLOB"),
new EnvironmentKnobSource("DISABLE_BUILD_ARTIFACTS_TO_BLOB"),
new BuiltInDefaultKnobSource("false"));
public static readonly Knob SendArtifactsToBlobstoreDomain = new Knob(
nameof(SendArtifactsToBlobstoreDomain),
"When set, defines the domain to use to send (Build|Pipeline) artifacts to.",
new RuntimeKnobSource("SEND_ARTIFACTS_TO_BLOBSTORE_DOMAIN"),
new EnvironmentKnobSource("SEND_ARTIFACTS_TO_BLOBSTORE_DOMAIN"),
public static readonly Knob SendBuildArtifactsToBlobstoreDomain = new Knob(
nameof(SendBuildArtifactsToBlobstoreDomain),
"When set, defines the domain to use to send Build artifacts to.",
new RuntimeKnobSource("SEND_BUILD_ARTIFACTS_TO_BLOBSTORE_DOMAIN"),
new EnvironmentKnobSource("SEND_BUILD_ARTIFACT_ARTIFACTS_TO_BLOBSTORE_DOMAIN"),
new BuiltInDefaultKnobSource(string.Empty));
public static readonly Knob SendPipelineArtifactsToBlobstoreDomain = new Knob(
nameof(SendPipelineArtifactsToBlobstoreDomain),
"When set, defines the domain to use to send Pipeline artifacts to.",
new RuntimeKnobSource("SEND_PIPELINE_ARTIFACTS_TO_BLOBSTORE_DOMAIN"),
new EnvironmentKnobSource("SEND_PIPELINE_ARTIFACT_ARTIFACTS_TO_BLOBSTORE_DOMAIN"),
new BuiltInDefaultKnobSource(string.Empty));

public static readonly Knob EnableIncompatibleBuildArtifactsPathResolution = new Knob(
Expand Down
2 changes: 1 addition & 1 deletion src/Agent.Worker/Build/FileContainerServer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ private async Task<UploadResult> BlobUploadAsync(IAsyncCommandContext context, I
token);

// Check if the pipeline has an override domain set, if not, use the default domain from the client settings.
string overrideDomain = AgentKnobs.SendArtifactsToBlobstoreDomain.GetValue(context).AsString();
string overrideDomain = AgentKnobs.SendBuildArtifactsToBlobstoreDomain.GetValue(context).AsString();
IDomainId domainId = String.IsNullOrWhiteSpace(overrideDomain) ? clientSettings.GetDefaultDomainId() : DomainIdFactory.Create(overrideDomain);

(dedupClient, clientTelemetry) = DedupManifestArtifactClientFactory.Instance
Expand Down

0 comments on commit 183538b

Please sign in to comment.