я не могу получить название изображения.Мне нужно значение sha256 для сравнения изображений.я хочу сравнить sha256 бэкапа с последними s2525
jenkins и openshift dsl
json:
{
"apiVersion": "image.openshift.io/v1",
"kind": "ImageStream",
"metadata": {
"creationTimestamp": "2019-03-09T07:16:09Z",
"generation": 15,
"labels": {
"app": "account"
},
"name": "account",
"namespace": "tosla-int",
"resourceVersion": "37110906",
"selfLink": "/apis/image.openshift.io/v1/namespaces/tosla-int/imagestreams/account",
"uid": "362935bc-423b-11e9-9f1b-005056a04991"
},
"spec": {
"lookupPolicy": {
"local": false
},
"tags": [
{
"annotations": null,
"from": {
"kind": "ImageStreamImage",
"name": "account@sha256:99b8efe4b68d79070bfbf7c5209eb959c141e53f0325938985dd30ab0eca0430"
},
"generation": 13,
"importPolicy": {},
"name": "backup",
"referencePolicy": {
"type": "Source"
}
},
{
"annotations": null,
"from": {
"kind": "ImageStreamImage",
"name": "account@sha256:a0ada237e1db2d986d844217fa4dda326f577647a73cae525f6a0554ff30b74f",
"namespace": "tosla-dev"
},
"generation": 14,
"importPolicy": {},
"name": "latest",
"referencePolicy": {
"type": "Source"
}
},
{
"annotations": null,
"from": {
"kind": "ImageStreamImage",
"name": "account@sha256:a0ada237e1db2d986d844217fa4dda326f577647a73cae525f6a0554ff30b74f"
},
"generation": 15,
"importPolicy": {},
"name": "uc",
"referencePolicy": {
"type": "Source"
}
}
]
},
"status": {
"dockerImageRepository": "docker-registry.default.svc:5000/tosla-int/account",
"tags": [
{
"items": [
{
"created": "2019-04-10T09:52:02Z",
"dockerImageReference": "docker-registry.default.svc:5000/tosla-int/account@sha256:99b8efe4b68d79070bfbf7c5209eb959c141e53f0325938985dd30ab0eca0430",
"generation": 13,
"image": "sha256:99b8efe4b68d79070bfbf7c5209eb959c141e53f0325938985dd30ab0eca0430"
},
{
"created": "2019-04-09T19:48:48Z",
"dockerImageReference": "docker-registry.default.svc:5000/tosla-int/account@sha256:2066a813b65b7235b358bd5abb5467d4b5cf8d8155c4c8746bb21ea8f9f255f5",
"generation": 11,
"image": "sha256:2066a813b65b7235b358bd5abb5467d4b5cf8d8155c4c8746bb21ea8f9f255f5"
},
{
"created": "2019-04-04T12:57:36Z",
"dockerImageReference": "docker-registry.default.svc:5000/tosla-int/account@sha256:c0ac0f834c84f3d3f8efd33600563ec69595eca5297482b8d292341d80b31bff",
"generation": 9,
"image": "sha256:c0ac0f834c84f3d3f8efd33600563ec69595eca5297482b8d292341d80b31bff"
},
{
"created": "2019-03-28T17:05:44Z",
"dockerImageReference": "docker-registry.default.svc:5000/tosla-int/account@sha256:77d5925c828556072533f813ff105cfc8edd73c5eebbacbc3108173fc70186d4",
"generation": 7,
"image": "sha256:77d5925c828556072533f813ff105cfc8edd73c5eebbacbc3108173fc70186d4"
},
{
"created": "2019-03-27T20:15:57Z",
"dockerImageReference": "docker-registry.default.svc:5000/tosla-int/account@sha256:e55065998aeabe5695c918dddbaefcb3b1df2dd00c25381287d593d040596a19",
"generation": 5,
"image": "sha256:e55065998aeabe5695c918dddbaefcb3b1df2dd00c25381287d593d040596a19"
},
{
"created": "2019-03-10T08:13:15Z",
"dockerImageReference": "docker-registry.default.svc:5000/tosla-int/account@sha256:22ae5678b5b0a17bb3fe7c8c23e5c3d857dfdcbec36d922bb580bff44fde3c06",
"generation": 3,
"image": "sha256:22ae5678b5b0a17bb3fe7c8c23e5c3d857dfdcbec36d922bb580bff44fde3c06"
}
],
"tag": "backup"
},
{
"items": [
{
"created": "2019-04-17T16:49:39Z",
"dockerImageReference": "docker-registry.default.svc:5000/tosla-int/account@sha256:a0ada237e1db2d986d844217fa4dda326f577647a73cae525f6a0554ff30b74f",
"generation": 14,
"image": "sha256:a0ada237e1db2d986d844217fa4dda326f577647a73cae525f6a0554ff30b74f"
},
{
"created": "2019-04-09T19:49:21Z",
"dockerImageReference": "docker-registry.default.svc:5000/tosla-int/account@sha256:99b8efe4b68d79070bfbf7c5209eb959c141e53f0325938985dd30ab0eca0430",
"generation": 12,
"image": "sha256:99b8efe4b68d79070bfbf7c5209eb959c141e53f0325938985dd30ab0eca0430"
},
{
"created": "2019-04-04T12:58:16Z",
"dockerImageReference": "docker-registry.default.svc:5000/tosla-int/account@sha256:2066a813b65b7235b358bd5abb5467d4b5cf8d8155c4c8746bb21ea8f9f255f5",
"generation": 10,
"image": "sha256:2066a813b65b7235b358bd5abb5467d4b5cf8d8155c4c8746bb21ea8f9f255f5"
},
{
"created": "2019-03-28T17:06:17Z",
"dockerImageReference": "docker-registry.default.svc:5000/tosla-int/account@sha256:c0ac0f834c84f3d3f8efd33600563ec69595eca5297482b8d292341d80b31bff",
"generation": 8,
"image": "sha256:c0ac0f834c84f3d3f8efd33600563ec69595eca5297482b8d292341d80b31bff"
},
{
"created": "2019-03-27T20:16:37Z",
"dockerImageReference": "docker-registry.default.svc:5000/tosla-int/account@sha256:77d5925c828556072533f813ff105cfc8edd73c5eebbacbc3108173fc70186d4",
"generation": 6,
"image": "sha256:77d5925c828556072533f813ff105cfc8edd73c5eebbacbc3108173fc70186d4"
},
{
"created": "2019-03-25T18:15:14Z",
"dockerImageReference": "docker-registry.default.svc:5000/tosla-int/account@sha256:e55065998aeabe5695c918dddbaefcb3b1df2dd00c25381287d593d040596a19",
"generation": 4,
"image": "sha256:e55065998aeabe5695c918dddbaefcb3b1df2dd00c25381287d593d040596a19"
},
{
"created": "2019-03-09T07:22:20Z",
"dockerImageReference": "docker-registry.default.svc:5000/tosla-int/account@sha256:22ae5678b5b0a17bb3fe7c8c23e5c3d857dfdcbec36d922bb580bff44fde3c06",
"generation": 2,
"image": "sha256:22ae5678b5b0a17bb3fe7c8c23e5c3d857dfdcbec36d922bb580bff44fde3c06"
}
],
"tag": "latest"
},
{
"items": [
{
"created": "2019-04-17T17:56:02Z",
"dockerImageReference": "docker-registry.default.svc:5000/tosla-int/account@sha256:a0ada237e1db2d986d844217fa4dda326f577647a73cae525f6a0554ff30b74f",
"generation": 15,
"image": "sha256:a0ada237e1db2d986d844217fa4dda326f577647a73cae525f6a0554ff30b74f"
}
],
"tag": "uc"
}
]
}
}
код:
def image_list = sh(script: ' oc get is/account -o json ', returnStdout: true).trim() as String
println image_list
JsonSlurper slurper = new JsonSlurper()
Map parsedJson = slurper.parseText(image_list)
String idValue = parsedJson.apiVersion
print idValue ?????
как я могу напечатать значение последнего изображения и значение резервного изображения.я хочу сравнить 256 изображений digest