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

add omitempty to Secret in k8s VolumeSource #15158

Merged
merged 1 commit into from
Aug 4, 2022
Merged

Conversation

cdoern
Copy link
Contributor

@cdoern cdoern commented Aug 2, 2022

Secret was populating a generated kube as null. Add omitempty
so that when the volume source is not a secret, we do not print unnecessary info

resolves #15156

Signed-off-by: Charlie Doern [email protected]

Does this PR introduce a user-facing change?

fix a bug that was printing Secret: null even when a secret volume type is not used in a pod for podman generate kube

@openshift-ci openshift-ci bot added the do-not-merge/release-note-label-needed Enforce release-note requirement, even if just None label Aug 2, 2022
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Aug 2, 2022

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: cdoern
Once this PR has been reviewed and has the lgtm label, please assign edsantiago for approval by writing /assign @edsantiago in a comment. For more information see:The Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found 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 release-note and removed do-not-merge/release-note-label-needed Enforce release-note requirement, even if just None labels Aug 2, 2022
@rhatdan
Copy link
Member

rhatdan commented Aug 2, 2022

LGTM

@rhatdan
Copy link
Member

rhatdan commented Aug 2, 2022

@containers/podman-maintainers PTAL

Copy link
Member

@ashley-cui ashley-cui left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@dilyanpalauzov
Copy link
Contributor

Will this change the output from Secret to secret, or both forms are valid, or just the first form is valid?

@cdoern
Copy link
Contributor Author

cdoern commented Aug 2, 2022

Will this change the output from Secret to secret, or both forms are valid, or just the first form is valid?

the output will not show up unless the secret volume type is specified. Then it will show up as secret

@TomSweeneyRedHat
Copy link
Member

Changes LGTM
I'm not sure what's happening with the test. It's not leaving many breadcrumbs behind. Will restart.

@vrothberg
Copy link
Member

The flake is hitting us hard at the moment

[+1200s] not ok 268 pod resource limits
[+1200s] # (from function `die' in file test/system/helpers.bash, line 567,
[+1200s] #  from function `run_podman' in file test/system/helpers.bash, line 219,
[+1200s] #  in test file test/system/200-pod.bats, line 518)
[+1200s] #   `run_podman --cgroup-manager=$cgm pod create --name=$name --cpus=5 --memory=5m --memory-swap=1g --cpu-shares=1000 --cpuset-cpus=0 --cpuset-mems=0 --device-read-bps=${LOOPDEVICE}:1mb --device-write-bps=${LOOPDEVICE}:1mb --blkio-weight-device=${LOOPDEVICE}:123 --blkio-weight=50' failed
[+1200s] # # /var/tmp/go/src/github.com/containers/podman/bin/podman rm -t 0 --all --force --ignore
[+1200s] # # /var/tmp/go/src/github.com/containers/podman/bin/podman ps --all --external --format {{.ID}} {{.Names}}
[+1200s] # # /var/tmp/go/src/github.com/containers/podman/bin/podman images --all --format {{.Repository}}:{{.Tag}} {{.ID}}
[+1200s] # quay.io/libpod/testimage:20220615 87fc32ccf6be
[+1200s] # # /var/tmp/go/src/github.com/containers/podman/bin/podman --cgroup-manager=systemd pod create --name=resources-systemd --cpus=5 --memory=5m --memory-swap=1g --cpu-shares=1000 --cpuset-cpus=0 --cpuset-mems=0 --device-read-bps=/dev/loop0:1mb --device-write-bps=/dev/loop0:1mb --blkio-weight-device=/dev/loop0:123 --blkio-weight=50
[+1200s] # ca2a483da9412f0c288ec07fd2b0be65436704f864cc65600867e2dc0a6403c2
[+1200s] # # /var/tmp/go/src/github.com/containers/podman/bin/podman --cgroup-manager=systemd pod start resources-systemd
[+1200s] # ca2a483da9412f0c288ec07fd2b0be65436704f864cc65600867e2dc0a6403c2
[+1200s] # # /var/tmp/go/src/github.com/containers/podman/bin/podman pod inspect --format {{.CgroupPath}} resources-systemd
[+1200s] # machine.slice/machine-libpod_pod_ca2a483da9412f0c288ec07fd2b0be65436704f864cc65600867e2dc0a6403c2.slice
[+1200s] # # /var/tmp/go/src/github.com/containers/podman/bin/podman --cgroup-manager=systemd pod rm -f resources-systemd
[+1200s] # ca2a483da9412f0c288ec07fd2b0be65436704f864cc65600867e2dc0a6403c2
[+1200s] # # /var/tmp/go/src/github.com/containers/podman/bin/podman --cgroup-manager=cgroupfs pod create --name=resources-cgroupfs --cpus=5 --memory=5m --memory-swap=1g --cpu-shares=1000 --cpuset-cpus=0 --cpuset-mems=0 --device-read-bps=/dev/loop0:1mb --device-write-bps=/dev/loop0:1mb --blkio-weight-device=/dev/loop0:123 --blkio-weight=50
[+1200s] # Error: error creating cgroup path /libpod_parent/3161e2310ab9f512cd9b78773784e1dbdec271319481ca593678a34440d3052c: write /sys/fs/cgroup/libpod_parent/cgroup.subtree_control: no such file or directory
[+1200s] # [ rc=125 (** EXPECTED 0 **) ]
[+1200s] # #/vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
[+1200s] # #| FAIL: exit code is 125; expected 0
[+1200s] # #\^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

@vrothberg
Copy link
Member

@edsantiago what does your data say on the flake?

@edsantiago
Copy link
Member

The flake is a known one (#15074), a nasty one, and biting us hard. @cevich has some WIP to be able to spin up aarch64 VMs, I suggest that we use it.

Secret was populating a generated kube as `null`. Add omitempty
so that when the volume source is not a secret, we do not print unnecessary info

resolves containers#15156

Signed-off-by: Charlie Doern <[email protected]>
@rhatdan
Copy link
Member

rhatdan commented Aug 4, 2022

The cross is not caused by this PR so forcing this through.

@rhatdan rhatdan merged commit 1638218 into containers:main Aug 4, 2022
@github-actions github-actions bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Sep 20, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 20, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. release-note
Projects
None yet
Development

Successfully merging this pull request may close these issues.

podman generate kube prints Secret: null
7 participants