Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin' into add-telemetry-logger
Browse files Browse the repository at this point in the history
  • Loading branch information
shreyas-goenka committed Jan 20, 2025
2 parents 702c856 + 84a7305 commit 5c761d3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -72,17 +72,18 @@ func (m *applySourceLinkedDeploymentPreset) Apply(ctx context.Context, b *bundle
return diags
}

// This mutator runs before workspace paths are defaulted so it's safe to check for the user-defined value
if b.Config.Workspace.FilePath != "" && config.IsExplicitlyEnabled(b.Config.Presets.SourceLinkedDeployment) {
path := dyn.NewPath(dyn.Key("targets"), dyn.Key(target), dyn.Key("workspace"), dyn.Key("file_path"))

path := dyn.NewPath(dyn.Key("workspace"), dyn.Key("file_path"))
diags = diags.Append(
diag.Diagnostic{
Severity: diag.Warning,
Summary: "workspace.file_path setting will be ignored in source-linked deployment mode",
Detail: "In source-linked deployment files are not copied to the destination and resources use source files instead",
Paths: []dyn.Path{
path[2:],
path,
},
Locations: b.Config.GetLocations(path[2:].String()),
Locations: b.Config.GetLocations(path.String()),
},
)
}
Expand Down
1 change: 1 addition & 0 deletions bundle/deploy/metadata/compute.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ func (m *compute) Apply(_ context.Context, b *bundle.Bundle) diag.Diagnostics {

// Set file upload destination of the bundle in metadata
b.Metadata.Config.Workspace.FilePath = b.Config.Workspace.FilePath
// In source-linked deployment files are not copied and resources use source files, therefore we use sync path as file path in metadata
if config.IsExplicitlyEnabled(b.Config.Presets.SourceLinkedDeployment) {
b.Metadata.Config.Workspace.FilePath = b.SyncRootPath
}
Expand Down

0 comments on commit 5c761d3

Please sign in to comment.