Skip to content

Commit

Permalink
migration: fix files' URL on Windows (#132)
Browse files Browse the repository at this point in the history
  • Loading branch information
NathanBaulch authored Jun 9, 2024
1 parent 547b653 commit 9aaee34
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion internal/provider/atlas_migration_data_source.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ func (d *MigrationDataSource) Read(ctx context.Context, req datasource.ReadReque
return
}
r, err := d.client.MigrateStatus(ctx, &atlas.MigrateStatusParams{
ConfigURL: fmt.Sprintf("file://%s", cfgPath),
ConfigURL: fmt.Sprintf("file://%s", filepath.ToSlash(cfgPath)),
Env: "tf",
})
if err != nil {
Expand Down
10 changes: 5 additions & 5 deletions internal/provider/atlas_migration_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ func (r *MigrationResource) ModifyPlan(ctx context.Context, req resource.ModifyP
return
}
report, err := r.client.MigrateStatus(ctx, &atlas.MigrateStatusParams{
ConfigURL: fmt.Sprintf("file://%s", cfgPath),
ConfigURL: fmt.Sprintf("file://%s", filepath.ToSlash(cfgPath)),
Env: defaultString(plan.EnvName, "tf"),
})
if err != nil {
Expand Down Expand Up @@ -339,7 +339,7 @@ func (r *MigrationResource) ModifyPlan(ctx context.Context, req resource.ModifyP
return
}
lint, err := r.client.MigrateLint(ctx, &atlas.MigrateLintParams{
ConfigURL: fmt.Sprintf("file://%s", cfgPath),
ConfigURL: fmt.Sprintf("file://%s", filepath.ToSlash(cfgPath)),
Env: defaultString(plan.EnvName, "tf"),
Latest: pendingCount,
})
Expand Down Expand Up @@ -383,7 +383,7 @@ func (r *MigrationResource) migrate(ctx context.Context, data *MigrationResource
return
}
statusReport, err := r.client.MigrateStatus(ctx, &atlas.MigrateStatusParams{
ConfigURL: fmt.Sprintf("file://%s", cfgPath),
ConfigURL: fmt.Sprintf("file://%s", filepath.ToSlash(cfgPath)),
Env: defaultString(data.EnvName, "tf"),
})
if err != nil {
Expand All @@ -401,7 +401,7 @@ func (r *MigrationResource) migrate(ctx context.Context, data *MigrationResource
return
}
_, err := r.client.MigrateApply(ctx, &atlas.MigrateApplyParams{
ConfigURL: fmt.Sprintf("file://%s", cfgPath),
ConfigURL: fmt.Sprintf("file://%s", filepath.ToSlash(cfgPath)),
Env: defaultString(data.EnvName, "tf"),
Amount: amount,
Context: &atlas.DeployRunContext{
Expand Down Expand Up @@ -434,7 +434,7 @@ func (r *MigrationResource) buildStatus(ctx context.Context, data *MigrationReso
return
}
report, err := r.client.MigrateStatus(ctx, &atlas.MigrateStatusParams{
ConfigURL: fmt.Sprintf("file://%s", cfgPath),
ConfigURL: fmt.Sprintf("file://%s", filepath.ToSlash(cfgPath)),
Env: defaultString(data.EnvName, "tf"),
})
if err != nil {
Expand Down

0 comments on commit 9aaee34

Please sign in to comment.