* Adds service delete command
This chageset adds `service delete` command, able to delete a service
at a time.
Fixes#49
```
kn service delete --help
Delete a service
Usage:
kn service delete <SERVICE_NAME> [flags]
Aliases:
delete, del, d
Examples:
# Delete a service 'svc1' in default namespace
kn service delete svc1
# Delete a service 'svc2' in 'ns1' namespace
kn service delete svc2 -n ns1
```
* Removes aliases, PreRunE and addresses review comments
* Support --all-namespaces option for service and revision list
`kn {service, revision} list` does not have the all-namespaces
options. Although it is possible to list them by `kn service list -n
""`(empty string), it is difficult to find such secret trick.
Hence, This patch adds `--all-namespaces` option.
* Add all-namespace option to KnParams
* Add AddNamespaceFlags function
* Add GetNamespace func
* Update help message
* Use GetNamespace util in service create cmmand
* Adds example usage in service create command
Fixes#61
Adds two examples to service create command as below
```
Examples:
kn service create mysvc --image dev.local/ns/image:latest
kn service create mysvc --env KEY1=VALUE1 --env KEY2=VALUE2 --image dev.local/ns/image:latest
```
* Adds double spaces in the example text
Adding double spaces to properly aligns the example
text while displaying help.
* Stub in an integration test
This just calls `kn service list` and verifies it doesn't have a
non-zero exit status.
* Build the client in pre_integration_tests
* Need to explicitly build the `kn` client
As opposed to just building the entire repo. That didn't actually
stick a `kn` binary in the root.
* Address code review feedback
Build the client in e2e-tests.sh instead of presubmit-tests.sh, fix a
couple copy/paste places that referred to eventing, remove unnecessary
knative_teardown function.
* Don't attempt to build kn twice
* Turns out pre_integration_tests() is the easiest way to build kn
We don't have any other good hooks at the moment to do something in
`e2e-tests.sh` that runs only once before the test cluster gets setup.
* Update test-infra to use the new cluster_setup function
This updates the version of test-infra to use the new cluster_setup
function added in https://github.com/knative/test-infra/pull/667
It simplifies our e2e setup logic into one place instead of being
split over presubmit-tests.sh and e2e-tests.sh
* Update vendored test-infra as well
* We have to explicitly tell CI to use the vendored modules
* Be a bit more descriptive in the stubbed out integration test
`service create` command always requires and specify `--image` to run.
This patch changes:
- Add validation check if image is empty or not.
- Add image to `MarkFlagRequired()`.
- to add `--image IMAGE` in help message
Yes, the file is called verify-codegen.sh, and yes in the other
Knative projects it both verifies generated code and verifies vendored
dependencies are up-to-date. For client, it just verifies vendored
dependencies don't drift.
The test-infra scripts specifically look for a file with this name. If
we'd prefer to call this something else, we'll also need to update
test-infra to look for that something else.
* Intermediate.
* Basic creation working
* Simplify
* Simple test passes
* Tests for env var updater, fix to bug found where wasnt getting a pointer
* Add some comments
* Fix env var quoting issues
* More comments from cppforlife
* Fix a couple copyrights
* Adds DEVELOPMENT.md
Fixes#26
Also adds CONTRIBUTING.md which points to knative/docs.
* Links DEVELOPMENT.md with README.md
- also removes the build steps as those are now part of DEVELOPMENT.md
- links the install guide to www.knative.dev/docs/install/
- removes unnecessary GOPATH setup steps
- removes CONTRIBUTING.md as its linked from README.md now
- links all references for contribution guide to https://www.knative.dev/contributing/
* Updates the repo fork step and removes unnecessary heading
* Add SilenceUsage option to cobra command
This patch adds `cmd.SilenceUsage` to command to stop usage output
after command validation.
Fixes https://github.com/knative/client/issues/38
* Set cmd.SilenceUsage to global cmd
* Support generating bash completion
This patch adds subcommand to generate completion script for bash.
As an knative user, we would like to complete subcommands and
options rather than typing them.
* Adds docs about bash auto completion in README.md
This changeset adds auto-completion section in existing README.md
Suggested-by: Navid Shaikh <nshaikh@redhat.com>
When building with go 1.11.5 I see a hash mismatch for knative/serving.
The algorithm for computing the hash has changed in recent go releases.
To create this PR I ran:
- `rm go.sum`
- `go test ./pkg/...`
- `go build ./cmd/kn`
- `go mod tidy`
All developers should update their version of go and clean their module
cache to flush downloaded modules with an invalid hash.
* put the auth libraries in the root command
* add revision describe (#15)
* print the yaml formatted revision by default
* allow for custom formatting to be passed in
* Refactor commands to allow insertion of fakes for testing
* Pin client-go to version that matches signatures other libs use
* Add tests for service list
* actually add test file
* Review comments: Fatal instead of Error/return, Split instead of read to newline
* Get revision and service listing skeletons in.
This adds the kn program, with basic commands for service and revision listing
in.
kn service list
kn revision list
They use the genericclioptions library from kubernetes to support jsonpath,
yaml, and json output. The default is to just list the names of the objects, for
now, until we add in some of the kubectl-based libraries for creating tables in
another commit.
This is deliberately bare-bones; I am looking to get the basic skeletons of how
this repository is laid out down.
No tests yet. Soon.
* Move commands to pkg, so cmd only contains minimalist main.go
* RunE instead of Run. The defaults on Cobra command generation are weird.
* Oops forgot to change types of stuff
* Do not panic on bad config file
* Make commands no longer global
* Make configuration initialization not static in the module, but rather triggered by main.go init