Skip to content

Commit 2135d09

Browse files
committed
fix minor comments and logged typos
1 parent f431c4c commit 2135d09

File tree

3 files changed

+9
-12
lines changed

3 files changed

+9
-12
lines changed

internal/terraform/node_resource_abstract_instance.go

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -261,10 +261,6 @@ const (
261261
// writeResourceInstanceState saves the given object as the current object for
262262
// the selected resource instance.
263263
//
264-
// dependencies is a parameter, instead of those directly attacted to the
265-
// NodeAbstractResourceInstance, because we don't write dependencies for
266-
// datasources.
267-
//
268264
// targetState determines which context state we're writing to during plan. The
269265
// default is the global working state.
270266
func (n *NodeAbstractResourceInstance) writeResourceInstanceState(ctx EvalContext, obj *states.ResourceInstanceObject, targetState phaseState) error {
@@ -280,7 +276,7 @@ func (n *NodeAbstractResourceInstance) writeResourceInstanceStateDeposed(ctx Eva
280276
return n.writeResourceInstanceStateImpl(ctx, deposedKey, obj, targetState)
281277
}
282278

283-
// (this is the private common body of both writeResourceInstanceState and
279+
// this is the private common body of both writeResourceInstanceState and
284280
// writeResourceInstanceStateDeposed. Don't call it directly; instead, use
285281
// one of the two wrappers to be explicit about which of the instance's
286282
// objects you are intending to write.
@@ -290,11 +286,11 @@ func (n *NodeAbstractResourceInstance) writeResourceInstanceStateImpl(ctx EvalCo
290286
if err != nil {
291287
return err
292288
}
293-
logFuncName := "NodeAbstractResouceInstance.writeResourceInstanceState"
289+
logFuncName := "NodeAbstractResourceInstance.writeResourceInstanceState"
294290
if deposedKey == states.NotDeposed {
295291
log.Printf("[TRACE] %s to %s for %s", logFuncName, targetState, absAddr)
296292
} else {
297-
logFuncName = "NodeAbstractResouceInstance.writeResourceInstanceStateDeposed"
293+
logFuncName = "NodeAbstractResourceInstance.writeResourceInstanceStateDeposed"
298294
log.Printf("[TRACE] %s to %s for %s (deposed key %s)", logFuncName, targetState, absAddr, deposedKey)
299295
}
300296

@@ -1318,7 +1314,7 @@ func (n *NodeAbstractResourceInstance) plan(
13181314
Before: priorVal,
13191315
BeforeIdentity: priorIdentity,
13201316
// Pass the marked planned value through in our change
1321-
// to propogate through evaluation.
1317+
// to propagate through evaluation.
13221318
// Marks will be removed when encoding.
13231319
After: plannedNewVal,
13241320
AfterIdentity: plannedIdentity,

internal/terraform/transform_action_trigger_config.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,10 @@ func (t *ActionTriggerConfigTransformer) transformSingle(g *Graph, config *confi
7878
containsBeforeEvent := false
7979
containsAfterEvent := false
8080
for _, event := range at.Events {
81-
if event == configs.BeforeCreate || event == configs.BeforeUpdate {
81+
switch event {
82+
case configs.BeforeCreate, configs.BeforeUpdate:
8283
containsBeforeEvent = true
83-
} else if event == configs.AfterCreate || event == configs.AfterUpdate {
84+
case configs.AfterCreate, configs.AfterUpdate:
8485
containsAfterEvent = true
8586
}
8687
}

internal/terraform/transform_attach_config_resource.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ type GraphNodeAttachResourceConfig interface {
2525

2626
// AttachResourceConfigTransformer goes through the graph and attaches
2727
// resource configuration structures to nodes that implement
28-
// GraphNodeAttachManagedResourceConfig or GraphNodeAttachDataResourceConfig.
28+
// GraphNodeAttachResourceConfig.
2929
//
3030
// The attached configuration structures are directly from the configuration.
3131
// If they're going to be modified, a copy should be made.
@@ -53,7 +53,7 @@ func (t *AttachResourceConfigTransformer) Transform(g *Graph) error {
5353

5454
// Go through and find GraphNodeAttachResource
5555
for _, v := range g.Vertices() {
56-
// Only care about GraphNodeAttachResource implementations
56+
// Only care about GraphNodeAttachResourceConfig implementations
5757
arn, ok := v.(GraphNodeAttachResourceConfig)
5858
if !ok {
5959
continue

0 commit comments

Comments
 (0)