GoogleContainerTools / skaffold

Easy and Repeatable Kubernetes Development
https://skaffold.dev/
Apache License 2.0
15.08k stars 1.63k forks source link

kubectl manifests do not support URL references #6142

Open levtomer66 opened 3 years ago

levtomer66 commented 3 years ago

Expected behavior

Successfully deploy URL manifests

Actual behavior

invalid skaffold config: skaffold config named "/Users/USERNAME/dep1/skaffold.yaml" referenced file "/Users/USERNAME/dep1/https:/exmaple.com/deployer.yaml" that could not be found. Verify that file "/Users/USERNAME/dep1/https:/exmaple.com/deployer.yaml" referenced in config "/Users/USERNAME/dep1/skaffold.yaml" exists and the path and naming are correct.

Information

apiVersion: skaffold/v2beta19
kind: Config
requires:
- path: ../dep1/skaffold.yaml
build:
  artifacts:
  - image: myimage
    kaniko:
      cache: {}
      verbosity: info
  - image: helm-deployer-myimage
    custom:
      buildCommand: ./build.sh
    requires:
    - image: myimage
      alias: BUILT_IMAGE
  tagPolicy:
    gitCommit: {}
  cluster:
    dockerConfig:
      secretName: mysecret
deploy:
  kubectl:
    manifests:
    - https://exmaple.com/deployer.yaml

Steps to reproduce the behavior

  1. Create 2 skaffold yaml manifests
  2. In first manifest specify a requirement (dependency) to the seconds one
  3. on seconds manifest specify deploy.kubectl.manifests to URL manifest

invalid skaffold config: skaffold config named "/Users/USERNAME/dep1/skaffold.yaml" referenced file "/Users/USERNAME/dep1/https:/exmaple.com/deployer.yaml" that could not be found. Verify that file "/Users/USERNAME/dep1/https:/exmaple.com/deployer.yaml" referenced in config "/Users/USERNAME/dep1/skaffold.yaml" exists and the path and naming are correct.

briandealwis commented 3 years ago

Hi @levtomer66. We don't support specifying manifests using a URL. I've marked this as a feature request.

thaskell commented 2 years ago

In 1.38.0 supplying manifests using URLs works in the local skaffold config. However if you supply a URL in a configuration that is then required it fails like described in the initial report. It looks like the bug is in how the list of manifests are modified to prepend the absolute path to the required skaffold config, rather than skipping a manifest if it is a URL, the modification happens to all of them.

Including a URL manifest however is broken now in main. Looks to be due to recent refactors. Is it intended that URLs cannot be supplied in manifests? If so this seems like a breaking change from the behavior in 1.38.0.

MarlonGamez commented 2 years ago

hey @thaskell this feature is intended for our next release, we just have to port it over still since as you've noticed we've done some large refactors. Thanks for pointing out the issues with the paths