Commit Graph

184 Commits

Author SHA1 Message Date
Navid Shaikh d25ea5f1e7 Renames service 'get' to 'list' (#179)
* Renames service 'get' to 'list'

 As per title.

* Renames get references to list in e2e tests

* Replaces get to list in docs
2019-06-13 13:56:43 -07:00
Ali Ok e010ca816d Fix typo in README.md (#181) 2019-06-13 13:42:43 -07:00
dr.max 39d994794b Adds a Golang version of e2e Basic workflow that can execute locally (#121)
1. creates a namespace 'kne2etests' (default name, change with env KN_E2E_NAMESPACE)
2. executes kn commands as per Basic workflow doc in said namespace
3. verifies each command's output
4. deletes the 'kne2etests' namespace
2019-06-11 19:49:43 -07:00
Roland Huß 0d94947366 fix(build.sh): Change from xnotify to fswatch for watching source code (#171)
While working with `build.sh --watch` it turned out the underlying
tool xnotify is not matured enough:

* It doesn't work when IntelliJ IDEA changes a file
* It can't deal with ignoring newly generated temp files (like .swp for vi)

This commit exchanges xnotify with fswatch which is much more matured.
2019-06-10 11:41:44 -07:00
Roland Huß ecc61d59c1 fix(e2e): Use build.sh for compiling (#175)
* fix(e2e): Use build.sh for compiling

Fixes #174.

* Update test/e2e-tests.sh

Co-Authored-By: Adriano Cunha <35786489+adrcunha@users.noreply.github.com>
2019-06-10 11:30:42 -07:00
Kenjiro Nakayama 176cb0ea72 Remove unused value CfgFile (#173)
This patch removes unused `CfgFile` value from codes.
2019-06-10 11:04:43 -07:00
Kenjiro Nakayama 1b471d587f Remove unused `--config` option (#139)
* Remove unused `--config` option

Currently `--config` option in kn command is not used from anywhere.
This patch removes the option from the command.

* update auto gen files

* Update deps by hack/update-deps.sh
2019-06-08 09:03:41 -07:00
Suraj Narwade 5308101a48 Move DEVELOPMENT.md to docs directory (#105)
* it will make easy to access docs from single directory, it will also help in case if we create github pages for the same

* fixed links from README.md

rebased and addressed comments
2019-06-08 08:47:41 -07:00
Roland Huß b885e41974 feat(service create/update): Add support of minScale/maxScale/concurrency-target/concurrency-limit (#157)
Autoscaler concurrency annotations are added to the revision template if
--min-scale / --max-scale / --concurrency-target/--concurrency-limit
are provided to `kn service create` and `kn service update`

Fixes #151
2019-06-08 08:27:40 -07:00
Roland Huß 8a1adf0cb0 feat(build.sh): Add a watch mode for automatic recompilation (#160)
This features uses and requires https://github.com/AgentCosmic/xnotify
and should work on any platform

Use it with

* Watch & compile: build.sh --watch
* Watch, compile, test: build.sh --watch --test
* Watch, compile, test & verbose output: build.sh --watch --test --verbose

(shortcuts -w && -t can be used, too)
2019-06-06 18:10:40 -07:00
Kenjiro Nakayama 01da225f85 Update go.mod and go.sum by test/presubmit-tests.sh (#162)
This changes are updated by `test/presubmit-tests.sh`.
2019-06-06 17:59:40 -07:00
Vincent 5d2a7aa912 Add the support to build container image for kn (#152) 2019-06-06 17:30:40 -07:00
dr.max 0800d7c4d3 Regroups code to use subpackages. Finishes issue #66 (#145)
Creates four subpackages for now:

1. kn/commands - inludes types.go for common
   struct and other common files and misc commands
2. kn/commands/service - all 'kn service *' commands
3. kn/commands/revision - all 'kn revision *' commands
4. kn/core - contains the root.go and other top level
   for code and testing
5. refactors:
   a. split .../commons/human_readable_flags.go into three
   b. modifies the HumanReadableFlags.ToPrinter to get pass
      a function that sets the columns and fields

Had to refactor all tests to avoid cycles.
2019-06-05 16:30:38 -07:00
Roland Huß b6a8fa9213 fix(service update): Only update fields which have been sent by server. (#155)
* fix(service update): Only update fields which have been sent by server.

This reflects the lemonade process step1. Tests have been adapted to
verify this behaviours.

The only situation when we update field coming from the server is for
"kn service update" for envs, image and requests/limits.

All other operation are either create (here, we always have to send the
old fields), or read (get/describe).

Fixes #144.

* chore: typo fix

* refactor(service update/create): Moved from Configuration to RevisionTemplateSpec

In order to proper handling the v1alpha1 -> v1beta1 migration methods has been updated to get rid fo Configuration within the service as this
is completely inlined in v1beta1.

The helper methods have been also updated accordingly.
I think we are good now.
2019-06-03 13:30:35 -07:00
Joyce Liu 43061af74a Update test-infra to the latest version (#154) 2019-05-31 17:41:33 -07:00
Roland Huß 9221429cb0 feat(build.sh): Adding options and running tests (#149)
* feat(build.sh): Adding options and running tests

* Added running unit tests to the script
* Added options to support different development flows (see help message below)
* Allow symlinking to /usr/local/bin so that the script can be called from everywhere

Usage message:

Knative Client Build Script

Usage: hack/build.sh [... options ...]

with the following options:

-f  --fast                    Only build (without formatting, testing, code generation)
-t  --test                    Run tests even when used with --fast
-u  --update                  Update dependencies
-h  --help                    Display this help message
    --verbose                 Verbose script output (set -x)

You can add a symbolic link to this build script into your PATH so that it can be
called from everywhere. E.g.:

ln -s .../hack/build.sh /usr/local/bin/kn_build.sh

Examples:

* Compile, format, tests, docs:       build.sh
* Compile only:                       build.sh --fast
* Compile with tests:                 build.sh -f -t

* doc(build.sh): Added documentation for new build.sh options

* docs(build.sh): Cosmetic fixes

* docs(build.sh): Tiny documentation fix

* chore(build.sh): Another typo fix
2019-05-30 10:18:32 -07:00
Joyce Liu cf41ab2b73 update test-infra in vendor (#148) 2019-05-29 11:46:31 -07:00
Roland Huß bfd5b56c3f chore: Streamlined build.sh (#136)
* chore: Streamlined build.sh

* Merged generate-docs.sh into build.sh
* Split up into smaller functions
* Added serving dependency version to 'kn version' command

Not sure whether the latter is really useful (showing the serving dependency)
as this is might get confused with the knative version
installed on the cluster.

* chore: Fixed indentation
2019-05-28 06:08:31 -07:00
Roland Huß c10092ffae fix: Update cli-runtime to include fix for cli options help (#137)
The update to kubernetes-1.13.5 for cli-runtime introduces a fix for #135 (i.e. sorting the keys for the options)
2019-05-21 09:54:27 -07:00
Roland Huß 52b6b236fe Update to serving 0.6.0 (#129)
* chore: Update to 0.6.0

* chore: Fix test

* chore: Update modules.txt
2019-05-20 10:41:27 -07:00
Navid Shaikh a264f060c1 Adds missing license to completion.go (#119) 2019-05-20 09:07:27 -07:00
dr.max 4280715ec3 Adds IBM's IKS to the list of services (update docs) (#131) 2019-05-20 08:57:30 -07:00
dr.max 3189c30275 Adds Zsh completion (finishes issue #130) (#132) 2019-05-20 08:54:29 -07:00
Navid Shaikh 1b92b1fb56 Tests running simple workflow in e2e (#112)
* Tests running simple workflow in e2e

 Fixes #104

* Adds e2e test for --force flag while creating service

 also removes http:// before the registry name

* Removes the update command

* Adds the service update command back to e2e tests

 also increases the sleep time between create and get
2019-05-17 16:42:15 -07:00
Naomi Seyfer a4242b3bb5 Copy-edit documentation, and make user guide start with installation. (#125)
* Copy edit docs and add getting-started section.

* Remove hash

* list to get

* list to get
2019-05-17 16:22:16 -07:00
Roland Huß e0f4f51e67 fix(build.sh): Reintroduced build-flags.sh (#122)
so that it can be shared between build.sh and release.sh

Fixes #120
2019-05-17 15:17:09 -07:00
Navid Shaikh bbfc9fbaa3 Checks if --image is given before applying image to config (#118)
Fixes #117
2019-05-17 15:05:16 -07:00
Adriano Cunha 8bb85c6aed Fix auto releases of Knative Client (#124)
This requires updating test-infra to deal with a repo that has no releases yet.

Also use hash and dates from the helper, to keep the binary and the GCS dirs in sync.
2019-05-17 14:40:16 -07:00
Adriano Cunha 9ec9671b2e Setup release infrastructure for Knative Client (#115)
Just like the other Knative modules, and ready for automation.

Requires updating test-infra to the latest version.
2019-05-16 10:51:17 -07:00
dr.max d8e710f389 Updates generated Cobra docs for commands and ... (#108)
Also:

1. New docs for commands
* service get
* revision get

2. Removes auto generated docs tags

3. Auto run generated docs when building to pick up any command changes
2019-05-15 15:00:32 -07:00
Navid Shaikh cab512c969 Adds --force flag to service create command (service replace) (#79)
* Adds --force flag to service create command / service replace

 Fixes #13

* Keeps the resourceVersion of service with --force flag

* Updates the tests

* Removes unnecessary comments
2019-05-15 14:49:32 -07:00
dr.max 08a12e112f Updates docs/workflows.md (#109)
* checked each command and add any ouput
* removes all `service list` since that's no longer a command
* adds `service get` and output
2019-05-15 14:37:32 -07:00
Adriano Cunha d4d135760c Fix command for "kn service" smoke test (#113)
It's now `get`, not `list` anymore.
2019-05-15 14:31:31 -07:00
Naomi Seyfer 5e5b46028f Disable cgo extensions in build-binaries.sh (#106)
Previously, we were running into errors on computers without cross-compilation C
headers. For simplicity of building, and because we don't need superperformant
net libs, disable cgo.
2019-05-14 12:22:31 -07:00
dr.max 570325425f addressing comments on PR #99 (#99) 2019-05-14 11:08:40 -07:00
Navid Shaikh 5b8b9d53bc Adds info message after service create and delete operations (#95)
* Adds info message after service create operation

 Fixes #87

 Aligns the service delete info message with service create too.

* Updates per review comments

 Adds newline after std imports
 Line breaks at proper operator
2019-05-14 10:44:41 -07:00
Navid Shaikh 39034a73f9 Adds revision get command (#97)
* Renames test names for service get command

 also removes unnecessary commented imports

* Adds revision get command

 renames `revision list` ==> `revision get`

* Adds tests for revision get command

* Updates the vendors/modules.txt

* Removes revision list command
2019-05-13 13:21:39 -07:00
Navid Shaikh bd7d57fa09 Adds service get command (#90)
* Adds service get command

 replaces service list command

* Updates go.mod and vendors/*

* Adds message if no services found in requested namespace

* Adds tests for service get
2019-05-13 10:56:40 -07:00
Doug Davis 6582e8239a Add a Makefile (#83)
Just to make it a little easier for folks.

Signed-off-by: Doug Davis <dug@us.ibm.com>
2019-05-10 11:58:38 -07:00
dr.max 47a10c079d Remove fmt.Printf of error since creates double error print to user (#96)
Fixes issue #89
2019-05-10 11:54:38 -07:00
Navid Shaikh b6d1bb47e7 Adds human-friendly table printing for resource listing (#85)
* Adds human-friendly printer

 All the credits goes to authors of https://github.com/kubernetes/kubernetes/tree/master/pkg/printers

* Updates the vendor/modules.txt

 As its updated after running hack/verify-codegen.sh

* Removes WithKind and WithNamespace printing options

 Lets start with bare minimum printer

* Adds licenses

 and references the original implementation file link.

 Removes pkg/printers/printers.go

* Removes unused imports
2019-05-09 16:27:38 -07:00
Navid Shaikh ba59ad8b9a Fix returning the namespace for listing resources (#88)
* Fix returning the namespace for listing resources

 Fixes #86

* Adds license to pkg/kn/commands/namespaced.go

* Adds tests for namespace flags and retrieval

* Renames test function
2019-05-09 15:55:38 -07:00
Adriano Cunha c33b1de89a License checking works now, enable it (#98)
* License checking now works, enable it

* Update test-infra

* Update vendored test-infra
2019-05-09 14:51:38 -07:00
dr.max 95808278d4 Adds Cobra generated docs and means to generate them and first cut of other docs (#93)
* Added Cobra generated docs and ways to generate them

* Adds docs/README.md and first user's guide for Kn
2019-05-06 17:39:36 -07:00
dr.max 5dcc0f8641 added tests to `$kn service update ...` and removed required --image (#81)
* added tests for service update with variations of --requests/limits-cpu --requests/limits-memory
* made image optional on service update since that was not the case and image should be optional
2019-05-01 15:36:33 -07:00
Roland Huß 18ae474c77 chore: Update dependencies (#68)
* chore: Update dependency to knative-serving 0.5.1

* chore: Changed deps to released versions where possible

Rebuilt mod deps and vendor dir based on this dependency list

github.com/knative/serving v0.5.
github.com/knative/pkg v0.0.0-20190330001454-aad7a9ad4639
github.com/mitchellh/go-homedir v1.1.0
github.com/spf13/cobra v0.0.3
github.com/spf13/pflag v1.0.3
github.com/spf13/viper v1.3.1
k8s.io/api kubernetes-1.14.1
k8s.io/apimachinery kubernetes-1.14.1
k8s.io/cli-runtime kubernetes-1.14.1
k8s.io/client-go v11.0.0
sigs.k8s.io/yaml v1.1.0

Not sure if all dependencies are required (e.g. is k8s.io/api required
to be specified explicitely or shouldn't we rely on k8s.io/client-go
to bring it this as a transitive dependency which maches always
the cli-runtime's version.

* chore: Update .gitignore to *not* ignore certain vendor files

* chore: Aligned with k8s version from serving 0.5.2

* chore: Run `go mod tidy`

* chore(modules): Update dependencies
2019-04-30 09:48:33 -07:00
dr.max dd4e2a917b Added support for limits and requests of CPU and memory (#78)
* Added support for limits and requests of CPU and memory. Examples:
1. kn service create mysvc --image dev.local/ns/image:latest --request-cpu 100m --requests-memory 64Mi
2. kn service create mysvc --image dev.local/ns/image:latest --limits-cpu 1000m --limits-memory 1024Mi

You can also include and/or omit the requests and limits. So the following should also work:
kn service create mysvc --image dev.local/ns/image:latest  --request-cpu 1000m --limits-memory 1024Mi

* Addressed comments about maintaining existing requests and limits and added more tests
* TestServiceCreateWithRequests
* TestServiceCreateWithLimits
* TestServiceCreateRequestsLimitsCPU
* TestServiceCreateRequestsLimitsMemory
* TestServiceCreateRequestsLimitsCPUMemory

* updating dependencies and formatting tests code
2019-04-25 20:20:29 -07:00
Roland Huß 8caca4589f fix(build.sh): Fix path to built kn when printing out the version (#77)
The final step when printing out the version of the generated kn
binary uses now the proper path, so that this script can be called
from any directory (like when the cwd is hacks/).
2019-04-19 12:47:27 -07:00
Roland Huß 1cbd7138b6 chore(version): Add buildtime and git revision to version command (#76)
* chore(version): Add buildtime and git revision to version command

For that, also updated `hack/build.sh` and `hack/build-binaries.sh` to
set the values from the outside.

The file `hack/NEXT_VERSION` contains the version number of the next
release. A regular build will create version numbers in the format
"0.1.0-20190417" which according to semver.org is a version less
than 0.1.0 (i.e. a pre-release).

A release script should pick up NEXT_VERSION, make the release with
the number found there and then update to the next release, possibly
a minor a release.

* chore(build.sh): Minor cosmetic fixes

* Aligned variable name
* Streamlined console output of build scripts
* Use "2019-04-18 07:40:10" as format for build time as it used as information only

* chore(build.sh): Add GO111MODULE=on

So that the script can be used also when running from within GOPATH

* chore(build.sh): Changed shasum --> sha256sum

... as shasum is not part of coreutils, and sha256sum should be more
generally available. Made the shasum output optional, too.

* chore(build.sh): Changed from BuildTime to BuildDate

... as this better reflects the value, the date when the client was built.

* chore(build.sh): Typo fix
2019-04-18 15:53:26 -07:00
Naomi Seyfer a09bb5201a Basic service update & a test for it. (#74)
* Service update implementation.

* add test

* Update to match new namespace flag handling.
2019-04-15 17:33:00 -07:00