Skip to content
This repository has been archived by the owner on May 10, 2024. It is now read-only.

Commit

Permalink
k8s-scheduler: Handle null image list on NodeStatus
Browse files Browse the repository at this point in the history
NodeStatus image name can be null if there is a not tagged image in
node. This can happen if building image on Nodes without tagging or
untagging existing images.

Signed-off-by: Amir Ghassemi Nasr <[email protected]>
  • Loading branch information
reith authored and lalithsuresh committed Nov 8, 2020
1 parent 8e481b8 commit dff64e6
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ private List<Insert<NodeTaintsRecord>> addNodeTaints(final DSLContext conn, fina
private List<Insert<NodeImagesRecord>> addNodeImages(final DSLContext conn, final Node node) {
final List<Insert<NodeImagesRecord>> inserts = new ArrayList<>();
for (final ContainerImage image: node.getStatus().getImages()) {
for (final String imageName: image.getNames()) {
for (final String imageName: Optional.ofNullable(image.getNames()).orElse(Collections.emptyList())) {
final int imageSizeInMb = (int) (((float) image.getSizeBytes()) / 1024 / 1024);
inserts.add(
conn.insertInto(Tables.NODE_IMAGES)
Expand Down

0 comments on commit dff64e6

Please sign in to comment.