cnoe-io / idpbuilder

Spin up a complete internal developer platform with only Docker required as a dependency.
https://cloud-native.slack.com/archives/C05TN9WFN5S
Apache License 2.0
182 stars 57 forks source link

Image digest is used for image ID #36

Closed nabuskey closed 9 months ago

nabuskey commented 1 year ago

The image ID field is filled with image digest, not image ID.

https://github.com/cnoe-io/idpbuilder/blob/1a9acbb3d71ac797dae14bbb32533507b30538e4/pkg/controllers/gitserver/image.go#L53-L62

PushImage returns: https://github.com/cnoe-io/idpbuilder/blob/1a9acbb3d71ac797dae14bbb32533507b30538e4/pkg/apps/image.go#L55-L63

Because digest is passed to Docker client, the test fails. https://github.com/cnoe-io/idpbuilder/blob/1a9acbb3d71ac797dae14bbb32533507b30538e4/pkg/controllers/gitserver/image_test.go#L55

Did we meant to return the digest instead of id in this? https://github.com/cnoe-io/idpbuilder/blob/1a9acbb3d71ac797dae14bbb32533507b30538e4/pkg/apps/image.go#L23

nimakaviani commented 1 year ago

I think we should populate GitServerStatus to keep both the imageId and the imageDigest. the data will come in handy later on

nimakaviani commented 1 year ago

well actually thinking about it more and looking at the code, the image ID is rather fixed, knowing the GitResource. for the test to pass, we just need to make sure the reference contains both the id and its SHA256. I will send a fix for this.