Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix dns_option typo #386

Merged
merged 1 commit into from
Apr 4, 2024

Conversation

robbmanes
Copy link
Contributor

The Podman API clarifies the field to give is dns_option, not dns_options here, so we need to drop the s to allow dns_opt fields to properly populate.

I thought about writing more unit tests for containers_create.py but there weren't existing tests for any of the options yet, so we'll have to add them for each API option I'd think.

Test program:

import json
from podman import PodmanClient

uri='unix:///run/user/1000/podman/podman.sock'

with PodmanClient(base_url=uri) as client:
    container = client.containers.create(
        image='registry.access.redhat.com/ubi8',
        command=['sleep 500'],
        dns_opt=['edns0'],
    )

Now properly works since we're passing in the right name:

$ podman --remote --url=unix://run/user/1000/podman/podman.sock ps -a
CONTAINER ID  IMAGE                                   COMMAND     CREATED        STATUS      PORTS       NAMES
211024bb2e5b  registry.access.redhat.com/ubi8:latest  sleep 500   5 seconds ago  Created                 silly_merkle

$ podman inspect silly_merkle | jq '.[].HostConfig.DnsOptions'
[
  "edns0"
]

Note that it looks like tox is failing for unrelated reasons; I'm hoping the CI will have different results and it's just a local problem.

Signed-off-by: Robb Manes <[email protected]>
@mheon
Copy link
Member

mheon commented Apr 2, 2024

@jwhonce @umohnani8 PTAL

@umohnani8
Copy link
Member

LGTM

@jwhonce
Copy link
Member

jwhonce commented Apr 2, 2024

/lgtm

@umohnani8
Copy link
Member

/approve

Copy link
Contributor

openshift-ci bot commented Apr 4, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: robbmanes, umohnani8

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci bot added the approved label Apr 4, 2024
@openshift-merge-bot openshift-merge-bot bot merged commit ca024cc into containers:main Apr 4, 2024
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants