Skip to content

Commit

Permalink
fix: some typos in code and comments (#330)
Browse files Browse the repository at this point in the history
  • Loading branch information
helio-frota authored and lholmquist committed Jul 1, 2019
1 parent 529cc59 commit b510e9d
Show file tree
Hide file tree
Showing 17 changed files with 26 additions and 26 deletions.
2 changes: 1 addition & 1 deletion bin/nodeshift
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ yargs
})
.env('NODESHIFT')
.option('quiet', {
describe: 'supress INFO and TRACE lines from output logs',
describe: 'suppress INFO and TRACE lines from output logs',
type: 'boolean'
})
.array('d')
Expand Down
4 changes: 2 additions & 2 deletions lib/build-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ function createBuildConfig (config, options) {
async function removeBuildsAndBuildConfig (config) {
const buildName = config.buildName;

logger.info(`Deleteing build configuration ${buildName}`);
logger.info(`Deleting build configuration ${buildName}`);
// First get the list of builds with the labelselector
// https://URL/oapi/v1/namespaces/NAMESPACE/builds?labelSelector=openshift.io/build-config.name=BUILD_NAME
const buildList = await config.openshiftRestClient.apis.build.v1.ns(config.namespace.name).builds.get({ qs: { labelSelector: `openshift.io/build-config.name=${buildName}` } });
Expand All @@ -68,7 +68,7 @@ async function removeBuildsAndBuildConfig (config) {

// Delete the builds that it finds
for (const items of buildList.body.items) {
logger.info(`Deleteing build ${items.metadata.name}`);
logger.info(`Deleting build ${items.metadata.name}`);
await awaitRequest(config.openshiftRestClient.apis.build.v1.ns(config.namespace.name).builds(items.metadata.name).delete({ body: removeOptions }));
}
// delete build config
Expand Down
2 changes: 1 addition & 1 deletion lib/definitions/object-metadata.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const labels = require('./labels');
// I don't think anything is actually required here, but lets do a name, namespace and labels
function createMetaData (options = {}) {
const metadata = {
name: options.name, // The proejcts name
name: options.name, // The projects name
namespace: options.namespace // The current namespace from the config, not required and should be picked up anyway, but...
};

Expand Down
4 changes: 2 additions & 2 deletions lib/deployment-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ async function undeploy (config, deploymentConfigResource) {
};

// then delete the deploymentconfig
logger.info(`Deleteing Deployment Config ${deploymentConfigResource.metadata.name}`);
logger.info(`Deleting Deployment Config ${deploymentConfigResource.metadata.name}`);
response.deploymentConfig = await awaitRequest(config.openshiftRestClient.apis['apps.openshift.io'].v1.ns(config.namespace.name).deploymentconfigs(deploymentConfigResource.metadata.name).delete({ body: removeOptionsDeploymentConfig }));
// Get the list of replication controllers
const rcList = await config.openshiftRestClient.api.v1.ns(config.namespace.name).replicationcontrollers.get({ qs: { labelSelector: `openshift.io/deployment-config.name=${config.projectName}` } });
Expand All @@ -62,7 +62,7 @@ async function undeploy (config, deploymentConfigResource) {
};
// Delete the builds that it finds
for (const items of rcList.body.items) {
logger.info(`Deleteing replication controller ${items.metadata.name}`);
logger.info(`Deleting replication controller ${items.metadata.name}`);
response.replicationControllers.push(
await awaitRequest(config.openshiftRestClient.api.v1.ns(config.namespace.name).replicationcontrollers(items.metadata.name).delete({ body: removeOptionsReplicationControllers }))
);
Expand Down
2 changes: 1 addition & 1 deletion lib/goals/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const imageStreamConfigurator = require('../image-stream');
const binaryBuild = require('../binary-build');

module.exports = async function build (config) {
// arvhice the application source
// archive the application source
await projectArchiver.archiveAndTar(config);

// create or update the build config
Expand Down
4 changes: 2 additions & 2 deletions lib/resource-loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ function loadYaml (fileLocation) {
}

async function loadJSON (fileLocation) {
const jsonFile = await readFile(fileLocation, { encoding: 'uttf8' });
const jsonFile = await readFile(fileLocation, { encoding: 'utf8' });
return JSON.parse(jsonFile);
}

Expand Down Expand Up @@ -74,7 +74,7 @@ function loadFiles (resourceList, config) {
// Validate that the resrouce type is in our list of supported kinds
kind = kindMappings[resource.type.toLowerCase()];
if (!kind) {
return Promise.reject(new Error(`unknown type: ${resource.type} for filen: ${resource.filename}`));
return Promise.reject(new Error(`unknown type: ${resource.type} for file: ${resource.filename}`));
}
} else {
// lets try the name to see if that is it
Expand Down
8 changes: 4 additions & 4 deletions test/binary-build-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ test('binary build test', (t) => {
t.end();
});

test('binary build test - succesful build', (t) => {
test('binary build test - successful build', (t) => {
const binaryBuild = proxyquire('../lib/binary-build', {
fs: {
createReadStream: () => {
Expand Down Expand Up @@ -65,7 +65,7 @@ test('binary build test - succesful build', (t) => {
};

binaryBuild(config, 'archiveLocation').then((buildStatus) => {
t.pass('succesful complete build');
t.pass('successful complete build');
t.end();
});
});
Expand Down Expand Up @@ -134,7 +134,7 @@ test('binary build test - failed build', (t) => {
});
});

test('binary build test - succesful build - but not write away', (t) => {
test('binary build test - successful build - but not write away', (t) => {
const binaryBuild = proxyquire('../lib/binary-build', {
'./build-watcher': () => {
return Promise.resolve();
Expand Down Expand Up @@ -204,7 +204,7 @@ test('binary build test - succesful build - but not write away', (t) => {
};

binaryBuild(config, 'archiveLocation').then((buildStatus) => {
t.pass('succesful complete build');
t.pass('successful complete build');
t.end();
});
});
2 changes: 1 addition & 1 deletion test/definitions-tests/build-config-spec-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
const test = require('tape');
const proxyquire = require('proxyquire');

test('builc-config-spec', (t) => {
test('build-config-spec', (t) => {
const proxyFunc = () => {};
const buildConfigSpec = proxyquire('../../lib/definitions/build-config-spec', {
'./build-source': proxyFunc,
Expand Down
4 changes: 2 additions & 2 deletions test/definitions-tests/build-strategy-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ 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 latet nodeshift image');
t.equal(result.sourceStrategy.from.name, 'nodeshift/centos7-s2i-nodejs:latest', 'docker image should be latest nodeshift image');
t.equal(result.sourceStrategy.forcePull, undefined, 'no forcePull by default');

t.end();
Expand Down Expand Up @@ -46,7 +46,7 @@ test('strategy with changed incremental to false', (t) => {
test('strategy with change dockerImage', (t) => {
const result = buildStrategy({ dockerImage: 'lholmquist/centos7-s2i-nodejs' });

t.equal(result.sourceStrategy.from.name, 'lholmquist/centos7-s2i-nodejs:latest', 'docker image should be latet lholmquist image');
t.equal(result.sourceStrategy.from.name, 'lholmquist/centos7-s2i-nodejs:latest', 'docker image should be latest lholmquist image');
t.end();
});

Expand Down
2 changes: 1 addition & 1 deletion test/definitions-tests/labels-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ const labels = require('../../lib/definitions/labels');
test('labels test', (t) => {
const l = labels({ label: 'cool thing' });
t.equal(l.provider, 'nodeshift', 'nodeshift provider prop gets added');
t.equal(l.label, 'cool thing', 'orginal label is still there');
t.equal(l.label, 'cool thing', 'original label is still there');
t.end();
});
2 changes: 1 addition & 1 deletion test/definitions-tests/object-metadata-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ test('object-metadata - labels', (t) => {
};

const obj = objectMetadata(options);
t.ok(obj.labels, 'shold have a labels prop');
t.ok(obj.labels, 'should have a labels prop');
t.equal(obj.labels.label1, 'label 1', 'label should be equal');
t.equal(obj.name, 'name', 'name property should be equal');
t.end();
Expand Down
2 changes: 1 addition & 1 deletion test/definitions-tests/route-spec-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,6 @@ test('route spec test', (t) => {
const rs = routeSpec(resource, config);
t.equal(rs.spec.port.targetPort, 3000, 'targetPort should be 3000');
t.equal(rs.spec.to.kind, 'Service', 'should have a kind of Service');
t.equal(rs.spec.to.name, 'Not Project Name', `name should not be overriden and use ${resource.spec.to.name}`);
t.equal(rs.spec.to.name, 'Not Project Name', `name should not be overridden and use ${resource.spec.to.name}`);
t.end();
});
2 changes: 1 addition & 1 deletion test/enrich-resources-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ test('enrich-resource - enricher is not a function', (t) => {
t.ok(p instanceof Promise, 'should return a promise');

p.then(() => {
t.equal(i, 6, 'should have 6 default enrchers');
t.equal(i, 6, 'should have 6 default enrichers');
t.pass('success');
t.end();
});
Expand Down
6 changes: 3 additions & 3 deletions test/enricher-tests/deployment-config-enricher-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ test('deployment config enricher - no deployment', (t) => {
p.then((dce) => {
t.equal(Array.isArray(dce), true, 'should return an array');
t.equal(dce.length, 2, 'array should have 2 things');
t.equal(dce[1].kind, 'DeploymentConfig', 'should have the depoymentConfig type');
t.equal(dce[1].kind, 'DeploymentConfig', 'should have the deploymentConfig type');
t.end();
});
});
Expand Down Expand Up @@ -66,7 +66,7 @@ test('deployment config enricher - deployment', async (t) => {

t.equal(Array.isArray(dce), true, 'should return an array');
t.notEqual(dce, resourceList, 'should not be equal');
t.equal(dce[1].kind, 'DeploymentConfig', 'should have the depoymentConfig type');
t.equal(dce[1].kind, 'DeploymentConfig', 'should have the deploymentConfig type');
t.end();
});

Expand Down Expand Up @@ -94,7 +94,7 @@ test('deployment config enricher - deployment config', async (t) => {

t.equal(Array.isArray(dce), true, 'should return an array');
t.equal(dce.length, 2, 'should have the same length');
t.equal(dce[1].kind, 'DeploymentConfig', 'should have the depoymentConfig type');
t.equal(dce[1].kind, 'DeploymentConfig', 'should have the deploymentConfig type');
t.equal(dce[1].metadata.namespace, config.namespace.name, 'should be enriched with the namespace value');
t.end();
});
2 changes: 1 addition & 1 deletion test/helpers-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ test('test parseMultiOption function', (t) => {
const parsed = helpers.parseMultiOption(arrayOfOptions);

t.equal(Array.isArray(parsed), true, 'should return an array');
t.equal(parsed.length, 3, 'should return an array of lenght 3');
t.equal(parsed.length, 3, 'should return an array of length 3');
t.equal(parsed[0].name, 'NODE_ENV', 'first array with name prop');
t.equal(parsed[0].value, 'development', 'first array wih value');
t.equal(parsed[1].name, 'YARN_ENABLED', 'second array with name prop');
Expand Down
2 changes: 1 addition & 1 deletion test/resource-loader-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ test('test error on kind mapping', (t) => {
};

resourceLoader(config).catch((err) => {
t.equal(err.message, 'unknown type: kind for filen: name-kind.yml', 'should have error message if no kind is found');
t.equal(err.message, 'unknown type: kind for file: name-kind.yml', 'should have error message if no kind is found');
t.end();
});
});
Expand Down
2 changes: 1 addition & 1 deletion test/secrets-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ test('test getsecrets need to create', (t) => {

secrets(config, resource).then((secret) => {
t.equal(secret.body.kind, 'Secret', 'is a secret Kind');
t.equal(secret.body.metadata.name, 'my-database-secret', 'metadata.name should not be overriden');
t.equal(secret.body.metadata.name, 'my-database-secret', 'metadata.name should not be overridden');
t.end();
});
});

0 comments on commit b510e9d

Please sign in to comment.