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

Improve func config envs #1188

Merged
merged 1 commit into from
Aug 30, 2022

Conversation

matejvasek
Copy link
Contributor

@matejvasek matejvasek commented Aug 24, 2022

Changes

  • 🎁 Added ability to add env non-interactively via flags
  • 🎁 Added ability to list envs as JSON

/kind enhancement

feat: added ability to add env non-interactively via flags and to list envs as JSON

@knative-prow
Copy link

knative-prow bot commented Aug 24, 2022

@matejvasek: The label(s) kind/<kind> cannot be applied, because the repository doesn't have them.

In response to this:

  • Added ability to add env non-interactively
  • Added ability to list envs as JSON

Signed-off-by: Matej Vasek mvasek@redhat.com

Changes

/kind

Fixes #

Release Note


Docs


Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@knative-prow knative-prow bot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Aug 24, 2022
@codecov
Copy link

codecov bot commented Aug 24, 2022

Codecov Report

Merging #1188 (c88cb98) into main (cd64b70) will increase coverage by 0.24%.
The diff coverage is 71.73%.

@@            Coverage Diff             @@
##             main    #1188      +/-   ##
==========================================
+ Coverage   44.92%   45.17%   +0.24%     
==========================================
  Files          68       68              
  Lines        9698     9745      +47     
==========================================
+ Hits         4357     4402      +45     
- Misses       4941     4942       +1     
- Partials      400      401       +1     
Impacted Files Coverage Δ
cmd/config_volumes.go 25.64% <0.00%> (ø)
cmd/config_envs.go 25.32% <72.00%> (+10.39%) ⬆️
cmd/config.go 30.27% <80.00%> (+0.18%) ⬆️
cmd/config_labels.go 70.45% <100.00%> (ø)
cmd/root.go 75.19% <100.00%> (-0.39%) ⬇️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@matejvasek matejvasek force-pushed the non-interactive-add-env branch 6 times, most recently from 2eeb30d to 3725736 Compare August 25, 2022 13:57
@matejvasek matejvasek changed the title Improve func config envs [WIP] Improve func config envs Aug 25, 2022
@matejvasek matejvasek marked this pull request as ready for review August 25, 2022 17:41
@knative-prow knative-prow bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Aug 25, 2022
@matejvasek
Copy link
Contributor Author

@lance @lkingland @zroubalik PTAL

Copy link
Member

@lance lance left a comment

Choose a reason for hiding this comment

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

Looks good overall. Thanks! Can you add an example to ConfigEnvsAddCmd() help text so that we the configMap syntax is shown? Also, I don't see a test for secret - is that also possible? Perhaps a test and doc for that as well?

Copy link
Member

@lkingland lkingland left a comment

Choose a reason for hiding this comment

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

Looks good to me as well. Lance brings up some good points. My only question was about changing to use the simplified flag --json rather than the key/value output=[x] approach we started with some time ago.

/lgtm
/hold for Lance's suggestions

cmd/config_envs.go Show resolved Hide resolved
@knative-prow knative-prow bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Aug 26, 2022
@knative-prow knative-prow bot added the lgtm Indicates that a PR is ready to be merged. label Aug 26, 2022
@matejvasek
Copy link
Contributor Author

matejvasek commented Aug 29, 2022

Also, I don't see a test for secret - is that also possible? Perhaps a test and doc for that as well?

@lance Actually even test for configMap is overkill here, everything is handled as string here (no special cases for configMap or secrets). Magic happens in deploy phase.

@lance
Copy link
Member

lance commented Aug 29, 2022

Also, I don't see a test for secret - is that also possible? Perhaps a test and doc for that as well?

@lance Actually even test for configMap is overkill here, everything is handled as string here (no special cases for configMap or secrets). Magic happens in deploy phase.

Fair enough - but how about an example in func config envs add help text?

@knative-prow knative-prow bot removed the lgtm Indicates that a PR is ready to be merged. label Aug 30, 2022
@matejvasek
Copy link
Contributor Author

/override style / Lint

@knative-prow
Copy link

knative-prow bot commented Aug 30, 2022

@matejvasek: matejvasek unauthorized: /override is restricted to Repo administrators.

In response to this:

/override style / Lint

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@matejvasek
Copy link
Contributor Author

@lance PTAL

@matejvasek
Copy link
Contributor Author

@lance also I need override /override style / Lint

@matejvasek matejvasek force-pushed the non-interactive-add-env branch 2 times, most recently from 7725020 to 3ee546f Compare August 30, 2022 13:53
@matejvasek
Copy link
Contributor Author

@lance the override shouldn't be needed now after docgen update.

* Added ability to add env non-interactively
* Added ability to list envs as JSON

Signed-off-by: Matej Vasek <mvasek@redhat.com>
Copy link
Contributor

@zroubalik zroubalik left a comment

Choose a reason for hiding this comment

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

/lgtm
/approve

@knative-prow knative-prow bot added the lgtm Indicates that a PR is ready to be merged. label Aug 30, 2022
@knative-prow
Copy link

knative-prow bot commented Aug 30, 2022

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: lkingland, matejvasek, zroubalik

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 [lkingland,matejvasek,zroubalik]

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

@matejvasek
Copy link
Contributor Author

/unhold

@knative-prow knative-prow bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Aug 30, 2022
@knative-prow knative-prow bot merged commit 56b1db3 into knative:main Aug 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants