Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Lance Ball <lball@redhat.com>
  • Loading branch information
zroubalik and lance committed Oct 7, 2020
1 parent 0cb77b8 commit 7e2a57b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 15 deletions.
9 changes: 2 additions & 7 deletions cmd/deploy.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ var deployCmd = &cobra.Command{
Builds and Deploys the Function project in the current directory. A path to the project
directory may be provided using the --path or -p flag. Reads the faas.yaml configuration file
to determine the image name. An image and repository may be specified on the command line using the --image or -i
and --repository or -r flag.
to determine the image name. An image and repository may be specified on the command line
using the --image or -i and --repository or -r flag.
If the Function is already deployed, it is updated with a new container image that is pushed to a
container image repository, and the Knative Service is updated.
Expand All @@ -53,11 +53,6 @@ func runDeploy(cmd *cobra.Command, _ []string) (err error) {

config := newDeployConfig().Prompt()

// Load Function from the config
// function, err := faas.NewFunction(config.Path)
// if err != nil {
// return
// }
function, err := functionWithOverrides(config.Path, functionOverrides{Namespace: config.Namespace, Image: config.Image})
if err != nil {
return
Expand Down
11 changes: 3 additions & 8 deletions docs/commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,19 +52,14 @@ kn faas run

## `deploy`

Builds and deploys the Function project in the current directory. The user may specify a path to the project directory using the `--path` or `-p` flag. Reads the `faas.yaml` configuration file to determine the image name. An image and repository may be specified on the command line using the `--image` or `-i`
and `--repository` or `-r` flag.
Builds and deploys the Function project in the current directory. The user may specify a path to the project directory using the `--path` or `-p` flag. Reads the `faas.yaml` configuration file to determine the image name. An image and repository may be specified on the command line using the `--image` or `-i` and `--repository` or `-r` flag.

Derives the service name from the project name. There is no mechanism by which the user can specify the service name. The user must have already initialize the function using `faas init` or they will encounter an error.
Derives the service name from the project name. There is no mechanism by which the user can specify the service name. The user must have already initialized the function using `faas init` or they will encounter an error.

If the Function is already deployed, it is updated with a new container image that is pushed to a
container image repository, and the Knative Service is updated.

The namespace into which the project is deployed defaults to the value in the
`faas.yaml` configuration file. If `NAMESPACE` is not set in the configuration,
the namespace currently active in the Kubernetes configuration file will be
used. The namespace may be specified on the command line using the `--namespace`
or `-n` flag, and if so this will overwrite the value in the `faas.yaml` file.
The namespace into which the project is deployed defaults to the value in the `faas.yaml` configuration file. If `NAMESPACE` is not set in the configuration, the namespace currently active in the Kubernetes configuration file will be used. The namespace may be specified on the command line using the `--namespace` or `-n` flag, and if so this will overwrite the value in the `faas.yaml` file.

Similar `kn` command: `kn service create NAME --image IMAGE [flags]`. This command allows a user to deploy a Knative Service by specifying an image, typically one hosted on a public container registry such as docker.io. The deployment options which the `kn` command affords the user are quite broad. The `kn` command in this case is quite effective for a power user. The `faas deploy` command has a similar end result, but is definitely easier for a user just getting started to be successful with.

Expand Down

0 comments on commit 7e2a57b

Please sign in to comment.