Skip to content

Commit

Permalink
Merge pull request weaveworks#2991 from weaveworks/2981-no-spec
Browse files Browse the repository at this point in the history
Do not assume template.spec in images() call
  • Loading branch information
jpellizzari authored Nov 16, 2022
2 parents bf342ec + 52ef473 commit 5b1f443
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion ui/lib/objects.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,9 @@ export class FluxObject {
get images(): string[] {
const spec = this.obj.spec;
if (!spec) return [];
if (spec.template) return spec.template.spec.containers.map((x) => x.image);
if (spec.template) {
return spec.template.spec?.containers.map((x) => x.image);
}
if (spec.containers) return spec.containers.map((x) => x.image);
return [];
}
Expand Down

0 comments on commit 5b1f443

Please sign in to comment.