Skip to content
This repository has been archived by the owner on Jul 28, 2023. It is now read-only.

Commit

Permalink
Merge pull request #168 from davco01a/latest
Browse files Browse the repository at this point in the history
get image digest even if we can't get kab digest
  • Loading branch information
s1cyan authored Apr 10, 2020
2 parents 0ccd0cb + bad7ff5 commit 46daca8
Showing 1 changed file with 16 additions and 18 deletions.
34 changes: 16 additions & 18 deletions src/main/java/application/rest/StackUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -390,12 +390,10 @@ private static HashMap<String,String> getKabStackDigest(Stack s, String versionT
imageName=version.getImages().get(0).getImage();
}
}
if (digest != null) {
imageMetaData.put("digest",digest);
imageMetaData.put("imageName",imageName);
} else {
imageMetaData = null;
}

imageMetaData.put("digest",digest);
imageMetaData.put("imageName",imageName);


return imageMetaData;
}
Expand Down Expand Up @@ -439,18 +437,18 @@ public static List allStacks(StackList fromKabanero, String namespace, List cura
Map imageMap = getKabStackDigest(s, versionNum);

String kabDigest = null, image = null, imageDigest=null;
if (imageMap != null) {
kabDigest = (String) imageMap.get("digest");
image = (String) imageMap.get("imageName"); // docker.io/kabanero/nodejs
StringTokenizer st = new StringTokenizer(image,"/");
String containerRegistryURL = st.nextToken();
String crNameSpace = st.nextToken();
imageDigest = getImageDigestFromRegistry(name, versionNum, namespace, crNameSpace, containerRegistryURL);
}


kabDigest = (String) imageMap.get("digest");
image = (String) imageMap.get("imageName"); // docker.io/kabanero/nodejs
StringTokenizer st = new StringTokenizer(image,"/");

String containerRegistryURL = st.nextToken();
String crNameSpace = st.nextToken();

imageDigest = getImageDigestFromRegistry(name, versionNum, namespace, crNameSpace, containerRegistryURL);


String digestCheck="mismatched";
if (kabDigest!=null && imageDigest!=null) {
if (kabDigest.contentEquals(imageDigest)) {
Expand Down

0 comments on commit 46daca8

Please sign in to comment.