openfaas / openfaas/faas-cli

gateway url parameter priority not as described

Open
#600 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

design/review priority/low
Dominant language
Go
Stars
816
Forks
230
Avg merge
6h 4m
Merged PRs (30d)
1

Description

Using faas list in a directory where there is a stack.yml file, the gateway URL is always taken from the yml file. The --gateway parameter and the $OPENFAAS_URL values are not used as is described in the readme

Expected Behaviour

Expect the parameter to always be taken if it is provided as is described in the readme about priority.

Current Behaviour

If a stack.yml is present in the directory where the faas-cli is run, the values in that file will always take precedence

Possible Solution

Adjust the getGatewayURL func to return as soon as it finds a match following the priority listed in the readme
OR
update the readme to indicate that the stack.yml file values, if present, override all other options

Steps to Reproduce (for bugs)

  1. Create stack.yml file
  2. Edit the gateway field to something else
  3. Run faas list, or other command that connects to the gateway
  4. Observe that the command cannot connect and is pointed to the value in the stack.yml
  5. Pass the -g flag to the same command and observe that the value from the stack.yml is still used

Context

Troubleshooting why the cli could not connect to a new cluster when using a directory where previous functions had been developed prior.

Your Environment

  • FaaS-CLI version ( Full output from: faas-cli version ):
$ faas version
CLI:
 commit:  a141dedf94ffeed84412365fd591bdc8999c5a1b
 version: 0.8.3
  • Docker version ( Full output from: docker version ):
$ docker version
Client:
 Version:           18.06.1-ce
 API version:       1.38
 Go version:        go1.10.3
 Git commit:        e68fc7a
 Built:             Tue Aug 21 17:25:03 2018
 OS/Arch:           linux/amd64
 Experimental:      false

Server:
 Engine:
  Version:          18.06.1-ce
  API version:      1.38 (minimum version 1.12)
  Go version:       go1.10.3
  Git commit:       e68fc7a
  Built:            Tue Aug 21 17:23:27 2018
  OS/Arch:          linux/amd64
  Experimental:     false
  • Are you using Docker Swarm (FaaS-swarm ) or Kubernetes (FaaS-netes)?
    Swarm
  • Operating System and version (e.g. Linux, Windows, MacOS):
    Linux Pop!_os 18.06
  • Link to your project or a code example to reproduce issue:
    N/A

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the getGatewayURL function and reviewing the gateway-priority description in the README. Reproduce the issue with a stack.yml file, faas list, and the -g flag, then verify that the implemented precedence matches the documented behavior. Done means the conflicting gateway sources behave consistently with the README.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
cli
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.