-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Switch digest
to contentDigest
in the json tags
#75
Conversation
testdata/bundles/digest.json
Outdated
"schemaVersion": "99.99", | ||
"images": { | ||
"my-microservice": { | ||
"contentDigest": "sha256:aaaaaaaaaaaa...", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On the basis that open source tests are a form of documentation, I'd prefer it if we used a proper content digest e.g. "sha256:deadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef" (or a vegetarian alternative).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, good idea. I took this directly from one of the examples in the spec examples directory.
testdata/bundles/digest.json
Outdated
}, | ||
"invocationImages": [ | ||
{ | ||
"contentDigest": "sha256:aaaaaaa...", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See previous comment about proper content digest, but use a distinct one here.
testdata/bundles/digest.json
Outdated
} | ||
} | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: add newline to keep github view clean?
bundle/bundle_test.go
Outdated
//images[] should have exactly 1 values | ||
_, ok := bundle.Images["my-microservice"] | ||
require.True(t, ok, "there should been an image named my-microservice in the bundle") | ||
// the image digest should equal sha256:aaaaaaaaaaaa... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: best to delete comments which merely repeat what the code says.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please see detailed comments.
This PR swaps `contentDigest` in place of `digest` in the json/mapstructure tags for the BaseImage type. Adds a test for marashalling as well. Fixes cnabio#59
This PR swaps
contentDigest
in place ofdigest
in the json/mapstructure tags for the BaseImage type. Adds a test for marashalling as well.Fixes #59