Bug 2183975

Summary: [RFE] Add option to "podman kube generate" to print podman annotations
Product: Red Hat Enterprise Linux 9 Reporter: Suhaas Bhat <subhat>
Component: podmanAssignee: Jindrich Novy <jnovy>
Status: POST --- QA Contact: Alex Jia <ajia>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 9.1CC: ajia, bbaude, dwalsh, jcorrent, jnovy, lsm5, mboddu, mheon, pthomas, snangare, tsweeney, umohnani
Target Milestone: rcKeywords: FutureFeature, Triaged
Target Release: ---Flags: tsweeney: needinfo? (bbaude)
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: Story
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Comment 9 Daniel Walsh 2023-06-30 11:24:55 UTC
Should we just add annotations as long as they are < 63 chars?  Would that fix the problem.

Comment 10 Jake Correnti 2023-07-03 18:48:47 UTC
An initial pull request can be found here to add a flag to maintain the original annotation length for those longer than 63 characters: https://github.com/containers/podman/pull/19102
I am just starting the work to add an additional flag and the wiring to allow for reserved annotations in the generated YAML.

Comment 11 Jake Correnti 2023-07-18 15:23:42 UTC
The final PRs for this feature were merged upstream and will be included in RHEL 9.4: 
https://github.com/containers/podman/pull/19211
https://github.com/containers/podman/pull/19208

Comment 12 Tom Sweeney 2023-07-18 22:13:06 UTC
Assigning to @jnovy for any further packaging or BZ needs.

Comment 14 Alex Jia 2023-07-20 10:26:00 UTC
Sanity tests are passed on upstream podman.

7974eb181b09b2fe5d53a8988ff4413788543264
[root@kvm-01-guest18 podman]# git branch
* main
[root@kvm-01-guest18 podman]# git rev-parse HEAD
7974eb181b09b2fe5d53a8988ff4413788543264

[root@kvm-01-guest18 podman]# ./test/tools/build/ginkgo -focus "podman kube generate --podman-only" test/e2e/
...ignore...
[SynchronizedAfterSuite]
/root/podman/test/e2e/common_test.go:196
  integration timing results
  Podman kube generate podman kube generate --podman-only on container with --rm                0.155923
  Podman kube generate podman kube generate --podman-only on container with --cidfile           0.156007
  Podman kube generate podman kube generate --podman-only on container with --init              0.156307
  Podman kube generate podman kube generate --podman-only on container with --privileged                0.165792
  Podman kube generate podman kube generate --podman-only on container with --security-opt apparmor=unconfined         0.166067
  Podman kube generate podman kube generate --podman-only on container with --security-opt seccomp=unconfined          0.169739
  Podman kube generate podman kube generate --podman-only on container with --security-opt label=level:s0              0.268152
  Podman kube generate podman kube generate --podman-only on container with --volumes-from              0.447737
  Podman kube generate podman kube generate --podman-only on container with --publish-all               2.249498
[SynchronizedAfterSuite] PASSED [1.743 seconds]
------------------------------
[DeferCleanup (Suite)]
/root/podman/vendor/github.com/onsi/ginkgo/v2/internal/testingtproxy/testing_t_proxy.go:153
[DeferCleanup (Suite)] PASSED [0.000 seconds]
------------------------------
[DeferCleanup (Suite)]
/root/podman/vendor/github.com/onsi/ginkgo/v2/internal/testingtproxy/testing_t_proxy.go:153
[DeferCleanup (Suite)] PASSED [0.000 seconds]
------------------------------

Ran 9 of 2056 Specs in 91.936 seconds
SUCCESS! -- 9 Passed | 0 Failed | 0 Pending | 2047 Skipped
PASS

Ginkgo ran 1 suite in 1m54.557250578s
Test Suite Passed