0
尝试迭代通过AWS json输出,并使用以下代码检查ECR中是否存在特定版本。但我总是得到“图像不存在于ECR!”即使图像标签存在。迭代AWS json响应python
client = boto3.client('ecr')
response = client.list_images(registryId='my_account_number', repositoryName='my_app')
for i in response['imageIds']:
if i['imageTag'] != version:
print(response)
print('Image does not exist in ECR!')
quit()
else:
pass
'if''imageTag']!= version:'我认为你的意思是'我['imageTag']'? – DeepSpace
是的..调整了上述..相同的结果 – user2040074
然后调试它。添加'print(i ['imageTag'])'。我们无法为您调试,因为我们没有收到您的回复。 – DeepSpace