Skip to content

Commit

Permalink
Use arn for manifest cache instead of ambiguous input package name
Browse files Browse the repository at this point in the history
  • Loading branch information
workeitel committed Oct 23, 2017
1 parent 52ac3ff commit a95a8fb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion agent/plugins/configurepackage/birdwatcher/birdwatcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ func downloadManifest(ds *PackageService, packageName string, version string) (*
return nil, err
}

err = ds.manifestCache.WriteManifest(packageName, manifest.Version, byteManifest)
err = ds.manifestCache.WriteManifest(manifest.PackageArn, manifest.Version, byteManifest)
if err != nil {
return nil, fmt.Errorf("failed to write manifest to file: %v", err)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ func TestReportResult(t *testing.T) {

func TestDownloadManifest(t *testing.T) {
manifestStrErr := "xkj]{}["
manifestStr := "{\"version\": \"1234\"}"
manifestStr := "{\"version\": \"1234\",\"packageArn\":\"packagearn\"}"
tracer := trace.NewTracer(log.NewMockLog())

data := []struct {
Expand Down Expand Up @@ -396,7 +396,7 @@ func TestDownloadManifest(t *testing.T) {
assert.Equal(t, "1234", result)
assert.NoError(t, err)
// verify cache
cachedManifest, cacheErr := cache.ReadManifest(testdata.packageName, "1234")
cachedManifest, cacheErr := cache.ReadManifest("packagearn", "1234")
assert.Equal(t, []byte(manifestStr), cachedManifest)
assert.NoError(t, cacheErr)
}
Expand Down

0 comments on commit a95a8fb

Please sign in to comment.