jlewi / hydros

hydros automates hydrating and committing configuration
Apache License 2.0
4 stars 0 forks source link

Leading "/" in src doesn't match any paths #69

Closed jlewi closed 7 months ago

jlewi commented 7 months ago

The following yaml successfully pulls in "kustomize" into the context

kind: Image
apiVersion: hydros.sailplane.ai/v1alpha1
metadata:
  name: hydros
  namespace: hydros
spec:
  image: us-west1-docker.pkg.dev/dev-sailplane/images/hydros/hydros
  source:
    - uri: https://github.com/jlewi/hydros.git
      mappings:
      - src: Dockerfile
      # Specify individual directories so we don't include hidden directories
      - src: "go.mod"
      - src: "go.sum"
      - src: "api/**/*.go"
      - src: "cmd/**/*.go"
      - src: "pkg/**/*.go"
      - src: "test/**/*.go"
    # Pull in kustomize from its docker image
    - uri: docker://registry.k8s.io/kustomize/kustomize:v5.0.0
      mappings:
        - src: app/kustomize
          strip: app
  builder:
    gcb:
      project: dev-sailplane
      bucket : builds-sailplane

However if we add a "/" to "/app/kustomize" it doesn't work. Here's an example of the YAML that doesn't work

The following yaml successfully pulls in "kustomize" into the context

kind: Image
apiVersion: hydros.sailplane.ai/v1alpha1
metadata:
  name: hydros
  namespace: hydros
spec:
  image: us-west1-docker.pkg.dev/dev-sailplane/images/hydros/hydros
  source:
    - uri: https://github.com/jlewi/hydros.git
      mappings:
      - src: Dockerfile
      # Specify individual directories so we don't include hidden directories
      - src: "go.mod"
      - src: "go.sum"
      - src: "api/**/*.go"
      - src: "cmd/**/*.go"
      - src: "pkg/**/*.go"
      - src: "test/**/*.go"
    # Pull in kustomize from its docker image
    - uri: docker://registry.k8s.io/kustomize/kustomize:v5.0.0
      mappings:
        - src: /app/kustomize
          strip: app
  builder:
    gcb:
      project: dev-sailplane
      bucket : builds-sailplane
jlewi commented 7 months ago

Should be fixed by #69