nodeshift
Advanced tools
Comparing version 6.1.0 to 6.2.0
@@ -5,2 +5,9 @@ # Changelog | ||
## [6.2.0](https://github.com/nodeshift/nodeshift/compare/v6.1.0...v6.2.0) (2020-06-05) | ||
### Features | ||
* Knative Serving Deployment ([#454](https://github.com/nodeshift/nodeshift/issues/454)) ([88eed5d](https://github.com/nodeshift/nodeshift/commit/88eed5d3ee0870036c34ff30b62862704f284eeb)) | ||
## [6.1.0](https://github.com/nodeshift/nodeshift/compare/v6.0.2...v6.1.0) (2020-05-13) | ||
@@ -7,0 +14,0 @@ |
@@ -33,2 +33,3 @@ 'use strict'; | ||
@param {array} [options.definedProperties] - Array of objects with the format { key: value }. Used for template substitution | ||
@param {boolean} [options.knative] - EXPERIMENTAL. flag to deploy an application as a Knative Serving Service. Defaults to false | ||
@returns {Promise<object>} - Returns a JSON Object | ||
@@ -59,2 +60,3 @@ */ | ||
@param {array} [options.definedProperties] - Array of objects with the format { key: value }. Used for template substitution | ||
@param {boolean} [options.knative] - EXPERIMENTAL. flag to deploy an application as a Knative Serving Service. Defaults to false | ||
@returns {Promise<object>} - Returns a JSON Object | ||
@@ -88,2 +90,3 @@ */ | ||
@param {array} [options.definedProperties] - Array of objects with the format { key: value }. Used for template substitution | ||
@param {boolean} [options.knative] - EXPERIMENTAL. flag to deploy an application as a Knative Serving Service. Defaults to false | ||
@returns {Promise<object>} - Returns a JSON Object | ||
@@ -117,2 +120,3 @@ */ | ||
@param {array} [options.definedProperties] - Array of objects with the format { key: value }. Used for template substitution | ||
@param {boolean} [options.knative] - EXPERIMENTAL. flag to deploy an application as a Knative Serving Service. Defaults to false | ||
@returns {Promise<object>} - Returns a JSON Object | ||
@@ -119,0 +123,0 @@ */ |
@@ -23,3 +23,7 @@ /* | ||
const defaultEnrichers = require('./resource-enrichers/default-enrichers.json'); | ||
const knativeEnrichers = require('./resource-enrichers/knative-enrichers.json'); | ||
// TODO: Add Knative Serving Enrichers to run instead? | ||
// Split the defaults to be "normal" and "knative"? | ||
module.exports = async (config, resourceList) => { | ||
@@ -32,3 +36,3 @@ // Load a list of enrichers | ||
// the defaultEnrichers list will have the correct order | ||
for (const enricher of defaultEnrichers) { | ||
for (const enricher of (config.knative ? knativeEnrichers : defaultEnrichers)) { | ||
const fn = loadedEnrichers[enricher]; | ||
@@ -35,0 +39,0 @@ if (typeof fn === 'function') { |
@@ -22,2 +22,3 @@ /* | ||
const services = require('../services'); | ||
const knativeServingService = require('../knative-serving-service'); | ||
const routes = require('../routes'); | ||
@@ -33,2 +34,5 @@ const deploymentConfig = require('../deployment-config').deploy; | ||
case 'Service': | ||
if (r.apiVersion.includes('serving.knative.dev')) { | ||
return knativeServingService(config, r); | ||
} | ||
return services(config, r); | ||
@@ -35,0 +39,0 @@ case 'Route': |
@@ -35,5 +35,7 @@ /* | ||
// Load Resources. This looks at the .nodeshift directory and loads those files | ||
const loadedResources = await resourceLoader(config); | ||
// TODO: figure out how to load only the resource we want | ||
const resourceToEnrich = await resourceLoader(config); | ||
// "Enrich" them. This should add stuff that needs to be added | ||
const enrichedResources = await enrichResources(config, loadedResources); | ||
const enrichedResources = await enrichResources(config, resourceToEnrich); | ||
@@ -40,0 +42,0 @@ // Write to file |
@@ -62,3 +62,7 @@ /* | ||
case 'Service': | ||
response.service = await awaitRequest(config.openshiftRestClient.api.v1.ns(config.namespace.name).service(item.metadata.name).delete({ body: removeOptions })); | ||
if (item.apiVersion.includes('serving.knative.dev')) { | ||
response.knativeServingService = await awaitRequest(config.openshiftRestClient.apis['serving.knative.dev'].v1.ns(config.namespace.name).service(item.metadata.name).delete({ body: removeOptions })); | ||
} else { | ||
response.service = await awaitRequest(config.openshiftRestClient.api.v1.ns(config.namespace.name).service(item.metadata.name).delete({ body: removeOptions })); | ||
} | ||
break; | ||
@@ -65,0 +69,0 @@ case 'DeploymentConfig': |
@@ -32,6 +32,13 @@ /* | ||
if (options.knative) { | ||
logger.warning('Using the EXPERMINTAL knative flag.'); | ||
} | ||
logger.info('loading configuration'); | ||
const projectPackage = JSON.parse(await readFile(`${options.projectLocation}/package.json`, { encoding: 'utf8' })); | ||
// If there is a configLocation string, pass it in | ||
const restClient = await openshiftRestClient({ config: options.configLocation }); | ||
const restClient = await openshiftRestClient({ config: options.configLocation, loadSpecFromCluster: options.knative }); | ||
// TODO(lholmquist): If knative is flagged, lets check that they have the API we need to use | ||
const kubeConfig = restClient.kubeconfig; | ||
@@ -38,0 +45,0 @@ |
@@ -39,3 +39,4 @@ /* | ||
ingress: 'Ingress', | ||
config: 'ConfigMap' | ||
config: 'ConfigMap', | ||
ksvc: 'Service' | ||
}; | ||
@@ -122,3 +123,15 @@ | ||
return Promise.all(resourcePromises); | ||
return Promise.all(resourcePromises).then((loadedResources) => { | ||
// Filter out the non-knative items if we are working with Knative | ||
if (config.knative) { | ||
return loadedResources.filter((r) => { | ||
if (r.apiVersion && r.apiVersion.includes('serving.knative.dev')) { | ||
return true; | ||
} | ||
return false; | ||
}); | ||
} else { | ||
return loadedResources; | ||
} | ||
}); | ||
} | ||
@@ -125,0 +138,0 @@ |
{ | ||
"name": "nodeshift", | ||
"version": "6.1.0", | ||
"version": "6.2.0", | ||
"description": "Plugin for running openshift deployments", | ||
@@ -26,5 +26,2 @@ "bin": { | ||
"files": [ | ||
"package.json", | ||
"README.md", | ||
"LICENSE", | ||
"index.js", | ||
@@ -60,8 +57,8 @@ "example.js", | ||
"mkdirp": "^1.0.3", | ||
"openshift-rest-client": "4.0.1", | ||
"tar": "~6.0.1", | ||
"openshift-rest-client": "~4.1.1", | ||
"tar": "~6.0.2", | ||
"yargs": "^15.2.0" | ||
}, | ||
"devDependencies": { | ||
"coveralls": "~3.0.13", | ||
"coveralls": "~3.1.0", | ||
"cross-env": "^7.0.1", | ||
@@ -68,0 +65,0 @@ "documentation": "~12.3.0", |
# Nodeshift [![CircleCI](https://circleci.com/gh/nodeshift/nodeshift.svg?style=svg)](https://circleci.com/gh/nodeshift/nodeshift) | ||
[![Build Status](https://travis-ci.org/nodeshift/nodeshift.svg?branch=master)](https://travis-ci.org/nodeshift/nodeshift) [![Coverage Status](https://coveralls.io/repos/github/nodeshift/nodeshift/badge.svg?branch=master)](https://coveralls.io/github/nodeshift/nodeshift?branch=master) [![Greenkeeper badge](https://badges.greenkeeper.io/nodeshift/nodeshift.svg)](https://greenkeeper.io/) | ||
[![Build Status](https://travis-ci.org/nodeshift/nodeshift.svg?branch=master)](https://travis-ci.org/nodeshift/nodeshift) [![Coverage Status](https://coveralls.io/repos/github/nodeshift/nodeshift/badge.svg?branch=master)](https://coveralls.io/github/nodeshift/nodeshift?branch=master) | ||
@@ -10,3 +10,3 @@ ## What is it | ||
* Node.js - version 8.x or greater | ||
* Node.js - version 10.x or greater | ||
@@ -17,2 +17,4 @@ ## Install | ||
Use with npx: `npx nodeshift` | ||
or to use in an npm script | ||
@@ -200,2 +202,6 @@ | ||
#### knative | ||
EXPERIMENTAL. Flag to deploy an application as a Knative Serving Service. Defaults to false | ||
Since this feature is experimental, it is subject to change without a Major version release until it is fully stable. | ||
#### help | ||
@@ -258,2 +264,5 @@ Shows the below help | ||
[string] [choices: "stdout", "ignore", "<filename>"] [default: "ignore"] | ||
--knative EXPERIMENTAL. flag to deploy an application | ||
as a Knative Serving Service | ||
[boolean] [choices: true, false] [default: false] | ||
--help Show help [boolean] | ||
@@ -260,0 +269,0 @@ --cmd [default: "deploy"] |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
165433
56
2693
272
+ Addedopenshift-rest-client@4.1.1(transitive)
- Removedopenshift-rest-client@4.0.1(transitive)
Updatedopenshift-rest-client@~4.1.1
Updatedtar@~6.0.2