Skip to content

Commit

Permalink
src: using ubi7/nodejs-10 as default image (#372)
Browse files Browse the repository at this point in the history
BREAKING CHANGE: Changing the base s2i images

This removes the deprecated nodeshift/centos7-s2i-nodejs images and replaces then with the UBI based Node images from Red Hat Software Collections
  • Loading branch information
helio-frota authored and lholmquist committed Oct 29, 2019
1 parent 724695b commit 0bc82bd
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 29 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -150,10 +150,11 @@ Changes the default location of where to look for your project. Defaults to your
This option is passed through to the [Openshift Config Loader](https://www.npmjs.com/package/openshift-config-loader). Defaults to the `~/.kube/config`
#### imageTag
Specify the tag of the docker image to use for the deployed application. defaults to latest. These version tags correspond to the docker hub tags of the [nodeshift s2i images](https://hub.docker.com/r/nodeshift/centos7-s2i-nodejs/tags/)
Specify the tag of the docker image to use for the deployed application. defaults to latest.
These version tags correspond to the RHSCL tags of the [ubi7/nodejs s2i images](https://access.redhat.com/containers/#/registry.access.redhat.com/ubi7/nodejs-10)
#### dockerImage
Specify the s2i builder image of Node.js to use for the deployed applications. Defaults to [nodeshift/centos7-s2i-nodejs](https://hub.docker.com/r/nodeshift/centos7-s2i-nodejs)
Specify the s2i builder image of Node.js to use for the deployed applications. Defaults to [ubi7/nodejs s2i images](https://access.redhat.com/containers/#/registry.access.redhat.com/ubi7/nodejs-10)
#### outputImageStream
The name of the ImageStream to output to. Defaults to project name from package.json
Expand Down
2 changes: 1 addition & 1 deletion bin/nodeshift
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ yargs
type: 'string'
})
.options('dockerImage', {
describe: 'the s2i image to use, defaults to nodeshift/centos7-s2i-nodejs',
describe: 'the s2i image to use, defaults to registry.access.redhat.com/ubi7/nodejs-10',
type: 'string'
})
.options('imageTag', {
Expand Down
27 changes: 14 additions & 13 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ <h2 id='readme' class='mt0'>
<h1>Nodeshift <a href="https://circleci.com/gh/nodeshift/nodeshift"><img src="https://circleci.com/gh/nodeshift/nodeshift.svg?style=svg" alt="CircleCI"></a></h1>
<p><a href="https://travis-ci.org/nodeshift/nodeshift"><img src="https://travis-ci.org/nodeshift/nodeshift.svg?branch=master" alt="Build Status"></a> <a href="https://coveralls.io/github/nodeshift/nodeshift?branch=master"><img src="https://coveralls.io/repos/github/nodeshift/nodeshift/badge.svg?branch=master" alt="Coverage Status"></a> <a href="https://greenkeeper.io/"><img src="https://badges.greenkeeper.io/nodeshift/nodeshift.svg" alt="Greenkeeper badge"></a></p>
<h2>What is it</h2>
<p>Nodeshift is an opinionated command line application and programmable API that you can use to deploy Node.js projects to OpenShift. It's currently under heavy development and APIs are still shifting a bit. However, in spite of its beta nature, you can use nodeshift today to deploy Node.js applications to OpenShift.</p>
<p>Nodeshift is an opinionated command line application and programmable API that you can use to deploy Node.js projects to OpenShift. </p>
<h2>Prerequisites</h2>
<ul>
<li>Node.js - version 8.x or greater</li>
Expand Down Expand Up @@ -215,9 +215,10 @@ <h4>projectLocation</h4>
<h4>configLocation</h4>
<p>This option is passed through to the <a href="https://www.npmjs.com/package/openshift-config-loader">Openshift Config Loader</a>. Defaults to the <code>~/.kube/config</code></p>
<h4>imageTag</h4>
<p>Specify the tag of the docker image to use for the deployed application. defaults to latest. These version tags correspond to the docker hub tags of the <a href="https://hub.docker.com/r/nodeshift/centos7-s2i-nodejs/tags/">nodeshift s2i images</a></p>
<p>Specify the tag of the docker image to use for the deployed application. defaults to latest.<br>
These version tags correspond to the RHSCL tags of the <a href="https://access.redhat.com/containers/#/registry.access.redhat.com/ubi7/nodejs-10">ubi7/nodejs s2i images</a></p>
<h4>dockerImage</h4>
<p>Specify the s2i builder image of Node.js to use for the deployed applications. Defaults to <a href="https://hub.docker.com/r/nodeshift/centos7-s2i-nodejs">nodeshift/centos7-s2i-nodejs</a></p>
<p>Specify the s2i builder image of Node.js to use for the deployed applications. Defaults to <a href="https://access.redhat.com/containers/#/registry.access.redhat.com/ubi7/nodejs-10">ubi7/nodejs s2i images</a></p>
<h4>outputImageStream</h4>
<p>The name of the ImageStream to output to. Defaults to project name from package.json</p>
<h4>outputImageStreamTag</h4>
Expand Down Expand Up @@ -412,8 +413,8 @@ <h3 class='fl m0' id='deploy'>
<tr>
<td class='break-word'><span class='code bold'>options.imageTag</span> <code class='quiet'><a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>?</code>
</td>
<td class='break-word'><span>set the version to use for the nodeshift/centos7-s2i-image. Versions are docker hub tags:
<a href="https://hub.docker.com/r/nodeshift/centos7-s2i-nodejs/tags/">https://hub.docker.com/r/nodeshift/centos7-s2i-nodejs/tags/</a>
<td class='break-word'><span>set the version to use for the ubi7/nodejs-10. Versions are ubi7/nodejs-10 tags:
<a href="https://access.redhat.com/containers/?tab=tags#/registry.access.redhat.com/ubi7/nodejs-10">https://access.redhat.com/containers/?tab=tags#/registry.access.redhat.com/ubi7/nodejs-10</a>
</span></td>
</tr>

Expand Down Expand Up @@ -663,8 +664,8 @@ <h3 class='fl m0' id='resource'>
<tr>
<td class='break-word'><span class='code bold'>options.imageTag</span> <code class='quiet'><a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>?</code>
</td>
<td class='break-word'><span>set the version to use for the nodeshift/centos7-s2i-image. Versions are docker hub tags:
<a href="https://hub.docker.com/r/nodeshift/centos7-s2i-nodejs/tags/">https://hub.docker.com/r/nodeshift/centos7-s2i-nodejs/tags/</a>
<td class='break-word'><span>set the version to use for the ubi7/nodejs-10. Versions are ubi7/nodejs-10 tags:
<a href="https://access.redhat.com/containers/?tab=tags#/registry.access.redhat.com/ubi7/nodejs-10">https://access.redhat.com/containers/?tab=tags#/registry.access.redhat.com/ubi7/nodejs-10</a>
</span></td>
</tr>

Expand Down Expand Up @@ -882,8 +883,8 @@ <h3 class='fl m0' id='applyresource'>
<tr>
<td class='break-word'><span class='code bold'>options.imageTag</span> <code class='quiet'><a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>?</code>
</td>
<td class='break-word'><span>set the version to use for the nodeshift/centos7-s2i-image. Versions are docker hub tags:
<a href="https://hub.docker.com/r/nodeshift/centos7-s2i-nodejs/tags/">https://hub.docker.com/r/nodeshift/centos7-s2i-nodejs/tags/</a>
<td class='break-word'><span>set the version to use for the ubi7/nodejs-10. Versions are ubi7/nodejs-10 tags:
<a href="https://access.redhat.com/containers/?tab=tags#/registry.access.redhat.com/ubi7/nodejs-10">https://access.redhat.com/containers/?tab=tags#/registry.access.redhat.com/ubi7/nodejs-10</a>
</span></td>
</tr>

Expand Down Expand Up @@ -1122,8 +1123,8 @@ <h3 class='fl m0' id='undeploy'>
<tr>
<td class='break-word'><span class='code bold'>options.imageTag</span> <code class='quiet'><a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>?</code>
</td>
<td class='break-word'><span>set the version to use for the nodeshift/centos7-s2i-image. Versions are docker hub tags:
<a href="https://hub.docker.com/r/nodeshift/centos7-s2i-nodejs/tags/">https://hub.docker.com/r/nodeshift/centos7-s2i-nodejs/tags/</a>
<td class='break-word'><span>set the version to use for the ubi7/nodejs-10. Versions are ubi7/nodejs-10 tags:
<a href="https://access.redhat.com/containers/?tab=tags#/registry.access.redhat.com/ubi7/nodejs-10">https://access.redhat.com/containers/?tab=tags#/registry.access.redhat.com/ubi7/nodejs-10</a>
</span></td>
</tr>

Expand Down Expand Up @@ -1371,8 +1372,8 @@ <h3 class='fl m0' id='build'>
<tr>
<td class='break-word'><span class='code bold'>options.imageTag</span> <code class='quiet'><a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>?</code>
</td>
<td class='break-word'><span>set the version to use for the nodeshift/centos7-s2i-image. Versions are docker hub tags:
<a href="https://hub.docker.com/r/nodeshift/centos7-s2i-nodejs/tags/">https://hub.docker.com/r/nodeshift/centos7-s2i-nodejs/tags/</a>
<td class='break-word'><span>set the version to use for the ubi7/nodejs-10. Versions are ubi7/nodejs-10 tags:
<a href="https://access.redhat.com/containers/?tab=tags#/registry.access.redhat.com/ubi7/nodejs-10">https://access.redhat.com/containers/?tab=tags#/registry.access.redhat.com/ubi7/nodejs-10</a>
</span></td>
</tr>

Expand Down
10 changes: 5 additions & 5 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const cli = require('./bin/cli');
@param {string} [options.namespace.displayName] - flag to specify the project namespace display name to build/deploy into. Overwrites any namespace settings in your OpenShift or Kubernetes configuration files
@param {boolean} [options.namespace.create] - flag to create the namespace if it does not exist. Only applicable for the build and deploy command. Must be used with namespace.name
@param {string} [options.namespace.name] - flag to specify the project namespace name to build/deploy into. Overwrites any namespace settings in your OpenShift or Kubernetes configuration files
@param {string} [options.imageTag] - set the version to use for the nodeshift/centos7-s2i-image. Versions are docker hub tags: https://hub.docker.com/r/nodeshift/centos7-s2i-nodejs/tags/
@param {string} [options.imageTag] - set the version to use for the ubi7/nodejs-10. Versions are ubi7/nodejs-10 tags: https://access.redhat.com/containers/?tab=tags#/registry.access.redhat.com/ubi7/nodejs-10
@param {string} [options.outputImageStream] - the name of the ImageStream to output to. Defaults to project name from package.json
@param {string} [options.outputImageTag] - The tag of the ImageStream to output to. Defaults to latest
@param {boolean} [options.quiet] - suppress INFO and TRACE lines from output logs
Expand Down Expand Up @@ -46,7 +46,7 @@ function deploy (options = {}) {
@param {object} [options.namespace] -
@param {string} [options.namespace.displayName] - flag to specify the project namespace display name to build/deploy into. Overwrites any namespace settings in your OpenShift or Kubernetes configuration files
@param {string} [options.namespace.name] - flag to specify the project namespace name to build/deploy into. Overwrites any namespace settings in your OpenShift or Kubernetes configuration files
@param {string} [options.imageTag] - set the version to use for the nodeshift/centos7-s2i-image. Versions are docker hub tags: https://hub.docker.com/r/nodeshift/centos7-s2i-nodejs/tags/
@param {string} [options.imageTag] - set the version to use for the ubi7/nodejs-10. Versions are ubi7/nodejs-10 tags: https://access.redhat.com/containers/?tab=tags#/registry.access.redhat.com/ubi7/nodejs-10
@param {string} [options.outputImageStream] - the name of the ImageStream to output to. Defaults to project name from package.json
@param {string} [options.outputImageTag] - The tag of the ImageStream to output to. Defaults to latest
@param {boolean} [options.quiet] - suppress INFO and TRACE lines from output logs
Expand All @@ -71,7 +71,7 @@ function resource (options = {}) {
@param {string} [options.namespace.displayName] - flag to specify the project namespace display name to build/deploy into. Overwrites any namespace settings in your OpenShift or Kubernetes configuration files
@param {boolean} [options.namespace.create] - flag to create the namespace if it does not exist. Only applicable for the build and deploy command. Must be used with namespace.name
@param {string} [options.namespace.name] - flag to specify the project namespace name to build/deploy into. Overwrites any namespace settings in your OpenShift or Kubernetes configuration files
@param {string} [options.imageTag] - set the version to use for the nodeshift/centos7-s2i-image. Versions are docker hub tags: https://hub.docker.com/r/nodeshift/centos7-s2i-nodejs/tags/
@param {string} [options.imageTag] - set the version to use for the ubi7/nodejs-10. Versions are ubi7/nodejs-10 tags: https://access.redhat.com/containers/?tab=tags#/registry.access.redhat.com/ubi7/nodejs-10
@param {string} [options.outputImageStream] - the name of the ImageStream to output to. Defaults to project name from package.json
@param {string} [options.outputImageTag] - The tag of the ImageStream to output to. Defaults to latest
@param {boolean} [options.quiet] - suppress INFO and TRACE lines from output logs
Expand All @@ -98,7 +98,7 @@ function applyResource (options = {}) {
@param {string} [options.namespace.displayName] - flag to specify the project namespace display name to build/deploy into. Overwrites any namespace settings in your OpenShift or Kubernetes configuration files
@param {boolean} [options.namespace.remove] - flag to remove the user created namespace. Only applicable for the undeploy command. Must be used with namespace.name
@param {string} [options.namespace.name] - flag to specify the project namespace name to build/deploy into. Overwrites any namespace settings in your OpenShift or Kubernetes configuration files
@param {string} [options.imageTag] - set the version to use for the nodeshift/centos7-s2i-image. Versions are docker hub tags: https://hub.docker.com/r/nodeshift/centos7-s2i-nodejs/tags/
@param {string} [options.imageTag] - set the version to use for the ubi7/nodejs-10. Versions are ubi7/nodejs-10 tags: https://access.redhat.com/containers/?tab=tags#/registry.access.redhat.com/ubi7/nodejs-10
@param {string} [options.outputImageStream] - the name of the ImageStream to output to. Defaults to project name from package.json
@param {string} [options.outputImageTag] - The tag of the ImageStream to output to. Defaults to latest
@param {boolean} [options.quiet] - suppress INFO and TRACE lines from output logs
Expand Down Expand Up @@ -126,7 +126,7 @@ function undeploy (options = {}) {
@param {string} [options.namespace.displayName] - flag to specify the project namespace display name to build/deploy into. Overwrites any namespace settings in your OpenShift or Kubernetes configuration files
@param {boolean} [options.namespace.create] - flag to create the namespace if it does not exist. Only applicable for the build and deploy command. Must be used with namespace.name
@param {string} [options.namespace.name] - flag to specify the project namespace name to build/deploy into. Overwrites any namespace settings in your OpenShift or Kubernetes configuration files
@param {string} [options.imageTag] - set the version to use for the nodeshift/centos7-s2i-image. Versions are docker hub tags: https://hub.docker.com/r/nodeshift/centos7-s2i-nodejs/tags/
@param {string} [options.imageTag] - set the version to use for the ubi7/nodejs-10. Versions are ubi7/nodejs-10 tags: https://access.redhat.com/containers/?tab=tags#/registry.access.redhat.com/ubi7/nodejs-10
@param {string} [options.outputImageStream] - the name of the ImageStream to output to. Defaults to project name from package.json
@param {string} [options.outputImageTag] - The tag of the ImageStream to output to. Defaults to latest
@param {boolean} [options.quiet] - suppress INFO and TRACE lines from output logs
Expand Down
2 changes: 1 addition & 1 deletion lib/definitions/build-strategy.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
const logger = require('../common-log')();

// Perhaps we should define this in another location
const DEFAULT_DOCKER_IMAGE = 'nodeshift/centos7-s2i-nodejs';
const DEFAULT_DOCKER_IMAGE = 'registry.access.redhat.com/ubi7/nodejs-10';
const DEFAULT_DOCKER_TAG = 'latest';

// https://docs.openshift.com/online/rest_api/openshift_v1.html#v1-buildstrategy
Expand Down
8 changes: 4 additions & 4 deletions test/build-strategy-test.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
const test = require('tape');
const BuildStrategy = require('../lib/definitions/build-strategy');

test('defaults to using the latest nodeshift s2i builder image', t => {
test('defaults to using latest ubi7/nodejs-10 s2i builder image', t => {
const buildStrategy = BuildStrategy();
t.equals(buildStrategy.sourceStrategy.from.name, 'nodeshift/centos7-s2i-nodejs:latest');
t.equals(buildStrategy.sourceStrategy.from.name, 'registry.access.redhat.com/ubi7/nodejs-10:latest');
t.end();
});

test('accepts a node version using imageTag option', t => {
const buildStrategy = BuildStrategy({ imageTag: '8.x' });
t.equals(buildStrategy.sourceStrategy.from.name, 'nodeshift/centos7-s2i-nodejs:8.x');
const buildStrategy = BuildStrategy({ imageTag: '1-20' });
t.equals(buildStrategy.sourceStrategy.from.name, 'registry.access.redhat.com/ubi7/nodejs-10:1-20');
t.end();
});
6 changes: 3 additions & 3 deletions test/definitions-tests/build-strategy-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ test('default strategy', (t) => {
const result = buildStrategy();

t.equal(result.type, 'Source', 'default is Source type');
t.equal(result.sourceStrategy.from.name, 'nodeshift/centos7-s2i-nodejs:latest', 'docker image should be latest nodeshift image');
t.equal(result.sourceStrategy.from.name, 'registry.access.redhat.com/ubi7/nodejs-10:latest', 'docker image should be ubi7/nodejs-10:latest image');
t.equal(result.sourceStrategy.forcePull, undefined, 'no forcePull by default');

t.end();
});

test('strategy with changed dockerTag', (t) => {
const result = buildStrategy({ imageTag: '8.x' });
t.equal(result.sourceStrategy.from.name, 'nodeshift/centos7-s2i-nodejs:8.x', 'docker image should be 8.x nodeshift image');
const result = buildStrategy({ imageTag: '1-20' });
t.equal(result.sourceStrategy.from.name, 'registry.access.redhat.com/ubi7/nodejs-10:1-20', 'docker image should be 1-20 ubi7/nodejs-10 image');
t.end();
});

Expand Down

0 comments on commit 0bc82bd

Please sign in to comment.