Skip to content
This repository has been archived by the owner on Mar 9, 2021. It is now read-only.

[kn-curl] with support for namespace and better help #52

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

maximilien
Copy link
Contributor

@maximilien maximilien commented Jun 18, 2020

kn-curl second attempt

  • supports namespace
  • better help usage message matching kn style
  • supports -h and --help

Supports getting INGRESS with Istio. Needs to following:

  • needs to be updated to support other ingress types.
  • needs at least an integration test and run in new vendor-less fashion.

@googlebot googlebot added the cla: yes Indicates the PR's author has signed the CLA. label Jun 18, 2020
@knative-prow-robot knative-prow-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jun 18, 2020
Copy link
Member

@mattmoor mattmoor left a comment

Choose a reason for hiding this comment

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

Produced via:
prettier --write --prose-wrap=always $(find -name '*.md' | grep -v vendor | grep -v .github | grep -v docs/cmd/)

Copy link
Member

@mattmoor mattmoor left a comment

Choose a reason for hiding this comment

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

Produced via:
prettier --write --prose-wrap=always $(find -name '*.md' | grep -v vendor | grep -v .github | grep -v docs/cmd/)

Copy link
Member

@mattmoor mattmoor left a comment

Choose a reason for hiding this comment

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

Produced via:
prettier --write --prose-wrap=always $(find -name '*.md' | grep -v vendor | grep -v .github | grep -v docs/cmd/)

Copy link
Contributor

@navidshaikh navidshaikh left a comment

Choose a reason for hiding this comment

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

nice!

plugins/kn-curl/README.md Outdated Show resolved Hide resolved
plugins/kn-curl/README.md Outdated Show resolved Hide resolved
plugins/kn-curl/README.md Outdated Show resolved Hide resolved
plugins/kn-curl/README.md Show resolved Hide resolved
plugins/kn-curl/kn-curl Outdated Show resolved Hide resolved
plugins/kn-curl/kn-curl Outdated Show resolved Hide resolved
plugins/kn-curl/kn-curl Outdated Show resolved Hide resolved
plugins/kn-curl/kn-curl Outdated Show resolved Hide resolved
@maximilien
Copy link
Contributor Author

Thanks for review @navidshaikh 🙏🏽

Will address comments today. Best.

Copy link
Member

@mattmoor mattmoor left a comment

Choose a reason for hiding this comment

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

Produced via:
prettier --write --prose-wrap=always $(find -name '*.md' | grep -v vendor | grep -v .github | grep -v docs/cmd/)

Copy link
Contributor

@navidshaikh navidshaikh 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

/hold
for @daisy-ycguo @rhuss to take a look

@knative-prow-robot knative-prow-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jun 26, 2020
@knative-prow-robot knative-prow-robot added the lgtm Indicates that a PR is ready to be merged. label Jun 26, 2020
@knative-prow-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: maximilien, navidshaikh

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 [maximilien,navidshaikh]

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

plugins/kn-curl/kn-curl Outdated Show resolved Hide resolved
plugins/kn-curl/kn-curl Outdated Show resolved Hide resolved
plugins/kn-curl/kn-curl Outdated Show resolved Hide resolved
@@ -0,0 +1,77 @@
#!/bin/bash
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe we could restrict to a simple bourne shell to make it the plugin more conservative and allow it to run on more platforms (e.g. also on Alpine which only has ash by default) ?

This would require to avoid bash specific extensions, but since this plugin is quite simple I think this should be no issue.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Did you really mean ash?

Copy link
Contributor

Choose a reason for hiding this comment

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

@maximilien : /bin/sh

plugins/kn-curl/kn-curl Show resolved Hide resolved
plugins/kn-curl/kn-curl Outdated Show resolved Hide resolved
plugins/kn-curl/kn-curl Outdated Show resolved Hide resolved
plugins/kn-curl/kn-curl Outdated Show resolved Hide resolved
plugins/kn-curl/kn-curl Outdated Show resolved Hide resolved
@maximilien
Copy link
Contributor Author

Great feedback @rhuss and @navidshaikh. Addressing. Thank you 🙏

@knative-prow-robot knative-prow-robot removed the lgtm Indicates that a PR is ready to be merged. label Jun 29, 2020
@knative-prow-robot
Copy link

New changes are detected. LGTM label has been removed.

@maximilien
Copy link
Contributor Author

OK latest update addresses all comments except for the two TODOs I had: 1) e2e tests (almost done) and 2) other ingress, have not started this...

plugins/kn-curl/README.md Outdated Show resolved Hide resolved
plugins/kn-curl/README.md Outdated Show resolved Hide resolved
Copy link
Member

@mattmoor mattmoor left a comment

Choose a reason for hiding this comment

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

Produced via:
prettier --write --prose-wrap=always $(find -name '*.md' | grep -v vendor | grep -v .github | grep -v docs/cmd/)

plugins/kn-curl/README.md Outdated Show resolved Hide resolved
plugins/kn-curl/README.md Outdated Show resolved Hide resolved
@maximilien
Copy link
Contributor Author

Added checks for istio and first e2e tests. Need to address some of auto the linting feedback

@maximilien
Copy link
Contributor Author

/hold remove

@maximilien
Copy link
Contributor Author

/unhold

@knative-prow-robot knative-prow-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Aug 19, 2020
@maximilien
Copy link
Contributor Author

@navidshaikh can I get a final review and LGTM on this? Thanks

@@ -0,0 +1,88 @@
#!/bin/bash
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
#!/bin/bash
#!/bin/sh

@@ -0,0 +1,77 @@
#!/bin/bash
Copy link
Contributor

Choose a reason for hiding this comment

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

@maximilien : /bin/sh

# See the License for the specific language governing permissions and
# limitations under the License.

USAGE=$"Usage:
Copy link
Contributor

Choose a reason for hiding this comment

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

not sure why $ is prefixed here

Comment on lines +31 to +41
# Need at least the service name
if [ -z "$1" ]; then
echo "$USAGE"
exit 0
fi

# If -h or --help is first argument
if [ "$1" == "-h" ] || [ "$1" == "--help" ]; then
echo "$USAGE"
exit 0
fi
Copy link
Contributor

Choose a reason for hiding this comment

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

just combine the if checks then it'd print USAGE in all the three cases ?

Base automatically changed from master to main March 8, 2021 17:37
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. cla: yes Indicates the PR's author has signed the CLA. 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.

6 participants