Smithx10 / nomad-driver-triton

HashiCorp Nomad Triton driver plugin
15 stars 6 forks source link

Modified the image sort function to sort on image version and publishedAt timestamp #18

Closed shaikmanu797 closed 5 years ago

shaikmanu797 commented 5 years ago

I am new to GoLang any suggestions would help me to learn better.

shaikmanu797 commented 5 years ago

16

shaikmanu797 commented 5 years ago

I had created two image version like below:

$ triton images name=usx-metadata-api -l ID NAME VERSION STATE FLAGS OS TYPE PUBDATE ec3430da-228c-4fe1-9189-69d06593ebcd usx-metadata-api 1.8-SNAPSHOT active I linux lx-dataset 2019-09-06 07c241c5-cb2e-4520-bec6-37e5e1552b35 usx-metadata-api 1.7-SNAPSHOT active I linux lx-dataset 2019-09-12

Ran the nomad job and the plugin retrieved the image id of the 1.8-SNAPSHOT when most_recent="true", since it is the higher version irrespective of the published date. Incase, if I have two images with same versions then only publishedAt is considered.