`PushImageStep` with `trustCertificates` generates malformed shell script - export and crane push merged on same line #2783
Alejandro Oton Garcia opened 1 month ago

When using a PushImageStep with the trustCertificates field populated (even with a single certificate), the generated shell script (step-N.sh) concatenates the export SSL_CERT_FILE=... statement and the crane push command onto a single line, causing the step to fail.

  • Error
/onedev-build/command/step-10.sh: export: line 122: /onedev-build/work/oci: bad variable name
Command exited with code 2
Step "push latest" is failed (0 seconds)

The generated script contains export SSL_CERT_FILE=/root/trust-certs.crtcrane push /onedev-build/work/oci .... This appears to be caused by a missing or incorrect newline (\n) between the export SSL_CERT_FILE=... line and the crane push invocation in the script template.

  • Steps to reproduce:
    • Create a PushImageStep targeting a private registry.
    • Populate trustCertificates with any certificate (one or multiple).
    • Run the build.
    • Observe the generated step-N.sh script and the error above.
  • Robin Shen commented 1 month ago

    Are you running this step on Windows? Steps depending on container can only run on Linux and Mac.

  • Alejandro Oton Garcia commented 1 month ago

    OneDev server is running on Windows. The steps are being executed on Linux via the OneDev Agent.

  • OneDev commented 1 month ago

    State changed as build OD-7402 (15.0.8) is successful

  • OneDev changed state to 'Closed' 1 month ago
    Previous Value Current Value
    Open
    Closed
1/1
Type
Bug
Priority
Normal
Assignee
Affected Versions
15.0.7
Labels
No labels
Issue Votes (0)
Watchers (3)
Reference
OD-2783
Please wait...
Connection lost or session expired, reload to recover
Page is in error, reload to recover