Skip to content

Commit

Permalink
fix(cd): export 'buildstate' fields for correct unmarshalling
Browse files Browse the repository at this point in the history
  • Loading branch information
smrz2001 committed Nov 6, 2023
1 parent cab9483 commit a7b11b4
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions cd/manager/common/aws/ddb/dynamoDb.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ const buildHashTag = "sha_tag"
// buildState represents build/deploy commit hash information. This information is maintained in a legacy DynamoDB table
// used by our utility AWS Lambdas.
type buildState struct {
key manager.DeployComponent `dynamodbav:"key"`
deployTag string `dynamodbav:"deployTag"`
buildInfo map[string]interface{} `dynamodbav:"buildInfo"`
Key manager.DeployComponent `dynamodbav:"key"`
DeployTag string `dynamodbav:"deployTag"`
BuildInfo map[string]interface{} `dynamodbav:"buildInfo"`
}

func NewDynamoDb(cfg aws.Config, cache manager.Cache) manager.Database {
Expand Down Expand Up @@ -368,7 +368,7 @@ func (db DynamoDb) GetBuildHashes() (map[manager.DeployComponent]string, error)
} else {
commitHashes := make(map[manager.DeployComponent]string, len(buildStates))
for _, state := range buildStates {
commitHashes[state.key] = state.buildInfo[buildHashTag].(string)
commitHashes[state.Key] = state.BuildInfo[buildHashTag].(string)
}
return commitHashes, nil
}
Expand All @@ -380,7 +380,7 @@ func (db DynamoDb) GetDeployHashes() (map[manager.DeployComponent]string, error)
} else {
commitHashes := make(map[manager.DeployComponent]string, len(buildStates))
for _, state := range buildStates {
commitHashes[state.key] = state.deployTag
commitHashes[state.Key] = state.DeployTag
}
return commitHashes, nil
}
Expand Down

0 comments on commit a7b11b4

Please sign in to comment.