Skip to content

Cannot define additional containers using make_pod_spec and extra_pod_config #527

@isaacbrodsky

Description

@isaacbrodsky

Using make_pod_spec, it is not possible to add additional containers correctly.

In [43]: type(make_pod_spec('testimage').spec.containers[0])
Out[43]: kubernetes.client.models.v1_container.V1Container

In [44]: type(make_pod_spec('testimage', extra_pod_config={"containers":[{"name":"test"}]}).spec.containers[0])
Out[44]: dict

In [45]: type(make_pod_spec('testimage', extra_pod_config={"containers":[{"name":"test"}]}).spec.containers[1])
Out[45]: dict

Expected: type should be kubernetes.client.models.v1_container.V1Container

The type needs to be preserved because

if pod_template.spec.containers[0].env is None:
requires that it be V1Container, not dict. Or, that line needs to be changed to accept dict.

Edit: Note: I tested on 2021.10.0, apologies if this is not applicable to master, but it looks like it is.
Edit2: If you do work around this, then #320 applies.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions