Bug 1693533 - Jenkins Install plugin script missing curl -k (--insecure) flag for downloading plugins
Summary: Jenkins Install plugin script missing curl -k (--insecure) flag for downloadi...
Keywords:
Status: CLOSED DEFERRED
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: RFE
Version: 3.11.0
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
: ---
Assignee: Adam Kaplan
QA Contact: Xiaoli Tian
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-03-28 06:27 UTC by Ravi Trivedi
Modified: 2023-12-15 16:24 UTC (History)
8 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-05-29 17:53:35 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Ravi Trivedi 2019-03-28 06:27:05 UTC
Description of problem:

In Jenkins, script at /usr/local/bin/install_plugins.sh is used to install plugins. In this script it uses curl to download plugins. We have plugins at internal repository, which we are trying to install. Since it is missing -k flag, it can't download plugins.

Where are you experiencing the behavior?  What environment?

We should use environment variable CURL_OPTIONS, which can be overwritten as per customers need.

Version-Release number of selected component (if applicable):

registry.redhat.io/openshift3/jenkins-2-rhel7

How reproducible:

Always

Steps to Reproduce:
1. Instantiate registry.redhat.io/openshift3/jenkins-2-rhel7 and install plugins from private repo with insecure url (curl -k)

Actual results:

Not supported for now.

Expected results:

To be able to pass additional flags to curl command as required

Additional info:

So when I referred the upstream content from Openshift repository I came across [1] where there are no such options set. Example,

~~~
curl --connect-timeout "${CURL_CONNECTION_TIMEOUT:-20}" --retry "${CURL_RETRY:-5}" --retry-delay "${CURL_RETRY_DELAY:-0}" --retry-max-time "${CURL_RETRY_MAX_TIME:-60}" -s -f -L "$url" -o "$jpi"
~~~

However, I came across a similar content from Jenkins upstream repository [2], I see such an option available which would elaborate the requirement/concern. Example,

~~~
retry_command curl ${CURL_OPTIONS:--sSfL} --connect-timeout "${CURL_CONNECTION_TIMEOUT:-20}" --retry "${CURL_RETRY:-3}" --retry-delay "${CURL_RETRY_DELAY:-0}" --retry-max-time "${CURL_RETRY_MAX_TIME:-60}" "$url" -o "$jpi"
~~~

[1] - https://github.com/openshift/jenkins/blob/master/2/contrib/jenkins/install-plugins.sh#L229
[2] - https://github.com/jenkinsci/docker/blob/master/install-plugins.sh#L93

NOTE:
Since the requirement is to install plugin from "insecure" URL, I understand that it wouldn't be advisable and supported as best practice but the provision to have additional flag to override curl options (CURL_OPTIONS) can help customization.

Comment 1 Paul Weil 2019-03-28 12:31:35 UTC
Moving to RFE for ability to pass arbitrary flags to the curl command.  

Adding -k to curl should not be supported out of the box as the flag allows SSL to be used even for connections considered insecure.  The best way to avoid using this flag is to use valid, trusted certificates.


Note You need to log in before you can comment on or make changes to this bug.