project-stacker / stacker

Build OCI images natively from a declarative format
https://stackerbuild.io
Apache License 2.0
199 stars 34 forks source link

Bug: import when path is a (http/https) url does not allow renaming #456

Open smoser opened 1 year ago

smoser commented 1 year ago

stacker version

v1.0.0-rc4-8e267fc

Describe the bug

stacker cannot rename an import when the 'path' is a http or https url. the imported path will be the basename of the url.

To reproduce

  1. Configuration stacker.yaml

    
    build:
    build_only: true
    from: 
    type: docker
    url: ${{DOCKER_BASE:docker://docker.io/library}}/busybox
    import:
    - path: /etc/passwd
      dest: /imports/host-file
    - path: https://www.cisco.com/favicon.ico
      dest: /imports/http-file
    run: |
    #!/bin/sh
    set +e
    
    ERRS=0
    err() { echo "$@"; ERRS=$((ERRS+1)); }
    assertFile() {
      [ -f "$1" ] || {
        err "$1: not a file"
        return 1
      }
      return 0
    }
    
    ls -l /imports
    assertFile /imports/host-file
    assertFile /imports/http-file
    
    [ "$ERRS" = "0" ]

3. Client tool used: stacker build
4. Seen error


### Expected behavior

_No response_

### Screenshots

_No response_

### Additional context

_No response_
rchincha commented 1 year ago
 - path: https://www.cisco.com/favicon.ico
      dest: /imports/http-file
smoser commented 1 year ago
 - path: https://www.cisco.com/favicon.ico
   dest: /imports/http-file

thats what i had, right?

    - path: https://www.cisco.com/favicon.ico
      dest: /imports/http-file

I'm confused.