Skip to content

Commit 45bda99

Browse files
revert some
1 parent 0c28ffb commit 45bda99

File tree

3 files changed

+12
-17
lines changed

3 files changed

+12
-17
lines changed

bundle/deploy/terraform/check_dashboards_modified_remotely.go

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -16,19 +16,9 @@ type dashboardState struct {
1616
}
1717

1818
func collectDashboardsFromState(ctx context.Context, b *bundle.Bundle) ([]dashboardState, error) {
19-
var state ExportedResourcesMap
20-
var err error
21-
if b.DirectDeployment {
22-
err := b.OpenStateFile(ctx)
23-
if err != nil {
24-
return nil, err
25-
}
26-
state = b.DeploymentBundle.StateDB.ExportState(ctx)
27-
} else {
28-
state, err = ParseResourcesState(ctx, b)
29-
if err != nil && state == nil {
30-
return nil, err
31-
}
19+
state, err := ParseResourcesState(ctx, b)
20+
if err != nil && state == nil {
21+
return nil, err
3222
}
3323

3424
var dashboards []dashboardState
@@ -57,6 +47,11 @@ func (l *checkDashboardsModifiedRemotely) Apply(ctx context.Context, b *bundle.B
5747
return nil
5848
}
5949

50+
if b.DirectDeployment {
51+
// TODO: not implemented yet
52+
return nil
53+
}
54+
6055
// If the user has forced the deployment, skip this check.
6156
if b.Config.Bundle.Force {
6257
return nil

bundle/phases/deploy.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ func Deploy(ctx context.Context, b *bundle.Bundle, outputHandler sync.OutputHand
153153
bundle.ApplyContext(ctx, b, lock.Release(lock.GoalDeploy))
154154
}()
155155

156-
libs := deployPrepare(ctx, b)
156+
libs := deployPrepare(ctx, b, false)
157157
if logdiag.HasError(ctx) {
158158
return
159159
}
@@ -243,7 +243,7 @@ func planWithoutPrepare(ctx context.Context, b *bundle.Bundle) *deployplan.Plan
243243
}
244244

245245
func Plan(ctx context.Context, b *bundle.Bundle) *deployplan.Plan {
246-
deployPrepare(ctx, b)
246+
deployPrepare(ctx, b, true)
247247
if logdiag.HasError(ctx) {
248248
return nil
249249
}

bundle/phases/plan.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ import (
1919

2020
// deployPrepare is common set of mutators between "bundle plan" and "bundle deploy".
2121
// This function does not make any mutations in the workspace remotely, only in-memory bundle config mutations
22-
func deployPrepare(ctx context.Context, b *bundle.Bundle) map[string][]libraries.LocationToUpdate {
22+
func deployPrepare(ctx context.Context, b *bundle.Bundle, isPlan bool) map[string][]libraries.LocationToUpdate {
2323
bundle.ApplySeqContext(ctx, b,
2424
statemgmt.StatePull(),
25-
terraform.CheckDashboardsModifiedRemotely(),
25+
terraform.CheckDashboardsModifiedRemotely(isPlan),
2626
deploy.StatePull(),
2727
mutator.ValidateGitDetails(),
2828
terraform.CheckRunningResource(),

0 commit comments

Comments
 (0)