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 --configmap to podman-remote kube play #18005

Merged
merged 1 commit into from
May 18, 2023

Conversation

umohnani8
Copy link
Member

@umohnani8 umohnani8 commented Mar 31, 2023

Enable the --configmap flag for the remote case of podman
kube play. Users can pass in the paths to the configmap files
for kube play to use when creating the pods and containers from
a kube yaml file. The configmap file is read and the contents are
appended to the contents of the main yaml file before passed to the
remote client.

Fixes #17513

Does this PR introduce a user-facing change?

Add --configmap flag to podman-remote kube play.

@openshift-ci openshift-ci bot added release-note approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Mar 31, 2023
@github-actions github-actions bot added the kind/api-change Change to remote API; merits scrutiny label Mar 31, 2023
@umohnani8
Copy link
Member Author

@vrothberg @baude was there a reason that this flag was disabled for the remote case? I tested it out locally and it works fine with podman-remote but maybe there is something I am missing.

@vrothberg
Copy link
Member

@vrothberg @baude was there a reason that this flag was disabled for the remote case? I tested it out locally and it works fine with podman-remote but maybe there is something I am missing.

It probably only works because you test it on the same machine. Passing a path to the server will work in this scenario but what if the client is on another machine? What would need to happen is to tar up the file, send it over to the server and use it there.

There are other flags/features (e.g., build) that don't (yet?) work for the same reason.

@Luap99
Copy link
Member

Luap99 commented Apr 3, 2023

Yes this came up before and we should not send local paths via API.
Play kube already supports configmaps as part of the same (mutli doc) yaml file, I think we should patch the remote client to read the configmaps and append them to the original yaml file which is then send via the body to the server.

For historical reference: #12243

@vrothberg
Copy link
Member

I think we should patch the remote client to read the configmaps and append them to the original yaml file which is then send via the body to the server

That is a very clever idea 👍

@openshift-merge-robot openshift-merge-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Apr 28, 2023
@openshift-merge-robot openshift-merge-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label May 16, 2023
@umohnani8 umohnani8 force-pushed the configmap branch 2 times, most recently from 329a66b to 1948da4 Compare May 17, 2023 12:19
Copy link
Member

@Luap99 Luap99 left a comment

Choose a reason for hiding this comment

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

There are more SkipIfRemote's that should be removed in the e2e tests.

pkg/api/server/register_kube.go Outdated Show resolved Hide resolved
@github-actions github-actions bot removed the kind/api-change Change to remote API; merits scrutiny label May 17, 2023
Copy link
Member

@Luap99 Luap99 left a comment

Choose a reason for hiding this comment

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

LGTM, @vrothberg PTAL

Copy link
Member

@vrothberg vrothberg left a comment

Choose a reason for hiding this comment

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

/lgtm
/hold

@openshift-ci openshift-ci bot added do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. lgtm Indicates that a PR is ready to be merged. labels May 17, 2023
@openshift-ci
Copy link
Contributor

openshift-ci bot commented May 17, 2023

[APPROVALNOTIFIER] This PR is APPROVED

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

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:
  • OWNERS [umohnani8,vrothberg]

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 removed the lgtm Indicates that a PR is ready to be merged. label May 17, 2023
Enable the --configmap flag for the remote case of podman
kube play. Users can pass in the paths to the configmap files
for kube play to use when creating the pods and containers from
a kube yaml file. The configmap file is read and the contents are
appended to the contents of the main yaml file before passed to the
remote client.

Signed-off-by: Urvashi Mohnani <[email protected]>
@@ -161,6 +161,10 @@ func playFlags(cmd *cobra.Command) {
waitFlagName := "wait"
flags.BoolVarP(&playOptions.Wait, waitFlagName, "w", false, "Clean up all objects created when a SIGTERM is received or pods exit")

configmapFlagName := "configmap"
flags.StringSliceVar(&playOptions.ConfigMaps, configmapFlagName, []string{}, "`Pathname` of a YAML file containing a kubernetes configmap")
Copy link
Member

@TomSweeneyRedHat TomSweeneyRedHat May 17, 2023

Choose a reason for hiding this comment

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

Nit, but it probably ought to be "Kubernetes"

Suggested change
flags.StringSliceVar(&playOptions.ConfigMaps, configmapFlagName, []string{}, "`Pathname` of a YAML file containing a kubernetes configmap")
flags.StringSliceVar(&playOptions.ConfigMaps, configmapFlagName, []string{}, "`Pathname` of a YAML file containing a Kubernetes configmap")

Copy link
Member Author

Choose a reason for hiding this comment

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

Will fix in a follow up PR.

@@ -653,8 +653,6 @@ spec:
}

@test "podman kube play with configmaps" {
skip_if_remote "the configmap argument is supported only locally"
Copy link
Member

Choose a reason for hiding this comment

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

Love, love, love all these removals!

@TomSweeneyRedHat
Copy link
Member

One nit, otherwise LGTM

@umohnani8
Copy link
Member Author

@containers/podman-maintainers can I please get a lgtm here

@rhatdan
Copy link
Member

rhatdan commented May 18, 2023

/lgtm
/hold

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label May 18, 2023
@umohnani8
Copy link
Member Author

/hold cancel

@openshift-ci openshift-ci bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label May 18, 2023
@openshift-merge-robot openshift-merge-robot merged commit a58ea23 into containers:main May 18, 2023
@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 Aug 23, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 23, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. 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.

Support --configmap in podman kube play with podman remote
6 participants