Skip to content

Commit

Permalink
🐛 podspec should not try to access template
Browse files Browse the repository at this point in the history
  • Loading branch information
nikhiljha committed Apr 28, 2024
1 parent f999324 commit 537094e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions transpire/resources/podspec.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ def with_arbitrary_volume(
def get_container(
self, name: str | None = None, *, remove: bool = False
) -> client.V1Container:
container_list = self.obj.template.spec.containers
container_list = self.obj.containers

if name is None:
if len(container_list) != 1:
Expand All @@ -219,7 +219,7 @@ def get_container(
raise ValueError(f"No such container: {name}")

def add_container(self, name: str, image: str) -> Self:
container_list = self.obj.template.spec.containers
container_list = self.obj.containers

names = set(c.name for c in container_list)
if name in names:
Expand All @@ -234,7 +234,7 @@ def add_container(self, name: str, image: str) -> Self:
return self

def add_arbitrary_container(self, container: client.V1Container) -> int:
container_list = self.obj.template.spec.containers
container_list = self.obj.containers

names = set(c.name for c in container_list)
if container.name in names:
Expand Down

0 comments on commit 537094e

Please sign in to comment.