github-action-skaffold icon indicating copy to clipboard operation
github-action-skaffold copied to clipboard

Stop passing default args for unsupported args

Open alaasdk opened this issue 2 years ago • 1 comments

All default values for all args got passed to the Skaffold command, thus some of the commands fails with some of these arguments..

ex. diagnose or deploy fails when receives --cache-file argument and exit with code 127 with error "unknown flag: --cache-file"

root@docker-desktop:/Users/myuser/myrepo# ./bin/skaffold deploy --cache-file=/Users/myuser/myrepo/.skaffold/cache --filename=skaffold.yaml --verbosity=warning
unknown flag: --cache-file
See 'skaffold deploy --help' for usage.

A solution would be extracting all available args from --help and match it with passed+default values, something like...

const command_help = await exec(Binaries.SKAFFOLD, command, '--help')
const argsRegex = /(--\S+|-[a-zA-Z]),?\s?(\S+)?: (.+)/gm;

alaasdk avatar Jan 23 '23 01:01 alaasdk

I am also running into this issue with or without the cache: false configured.

      - name: Run Skaffold Production Rendering
        uses: hiberbee/[email protected]
        with:
          command: render
          profile: production

wonderstim avatar May 03 '23 17:05 wonderstim