Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

push2cloud-cf-adapter

Package Overview
Dependencies
Maintainers
3
Versions
46
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

push2cloud-cf-adapter - npm Package Compare versions

Comparing version 1.7.2 to 1.7.3

6

fns/deleteApp.js
const _ = require('lodash');
const APP_NOT_FOUND = 100004;
module.exports = (api) => {

@@ -23,3 +25,3 @@ return (options, callback) => {

var appIdx = -1;
if (result && result.code === 100004) {
if (result && result.code === APP_NOT_FOUND) {
appIdx = _.findIndex(api.actualDeploymentConfig.apps, { guid: options.appGuid });

@@ -34,3 +36,3 @@ if (appIdx >= 0) {

if (err && !(result && result.code === 100004)) {
if (err && !(result && result.code === APP_NOT_FOUND)) {
return callback(err);

@@ -37,0 +39,0 @@ }

const _ = require('lodash');
const asyncOperationInProgressCheck = require('../lib/graceRequestHandler/asyncOperationInProgress');
const debug = require('debug')('push2cloud-cf-adapter:waitForServiceUnbound');

@@ -29,10 +30,9 @@ module.exports = (api) => {

api.getServiceBinding({ serviceBindingGuid: options.serviceBindingGuid }, (newError, result) => {
if (newError) {
return callback(newError);
}
if (!result) {
debug(`Unable to find service binding ${options.name || options.serviceBindingGuid}`);
return callback(err);
}
debug(`Retrying to delete ${options.name || options.serviceBindingGuid}`);
api.graceRequest({

@@ -46,7 +46,3 @@ method: 'DELETE',

if (api.actualDeploymentConfig) {
_.remove(api.actualDeploymentConfig.serviceBindings, { guid: options.serviceBindingGuid });
}
callback(null, result);
waitForServiceUnbound(options.serviceBindingGuid, result);
});

@@ -56,13 +52,36 @@ });

if (err) {
return callback(err);
}
waitForServiceUnbound(options.serviceBindingGuid, result);
});
if (api.actualDeploymentConfig) {
_.remove(api.actualDeploymentConfig.serviceBindings, { guid: options.serviceBindingGuid });
}
let attempt = 0;
const retryOptions = {
maxRetries: 15,
interval: 3
};
function waitForServiceUnbound(serviceBindingGuid, originalResult) {
setTimeout(function() {
api.getServiceBinding({ serviceBindingGuid: serviceBindingGuid }, (newError, result) => {
callback(null, result);
});
attempt++;
debug(`${attempt}. attempt to check if service was successfully unbound ${options.name || options.serviceBindingGuid}`);
// apparently an undefined result from the api.getServiceBinding means that
// the service binding wasn't found -> we can assume that it was successfully unbound.
if (!result) {
debug(`Service ${options.name || options.serviceBindingGuid} was successfully unbound after ${attempt} retries`);
if (api.actualDeploymentConfig) {
_.remove(api.actualDeploymentConfig.serviceBindings, { guid: options.serviceBindingGuid });
}
return callback(null, originalResult);
}
if (attempt >= retryOptions.maxRetries) {
return callback(new Error(`Check if service was successfully unbound ${options.name || options.serviceBindingGuid} timed out! Most likely a swisscom issue.`));
}
waitForServiceUnbound(serviceBindingGuid, originalResult);
});
}, retryOptions.interval * 1000);
}
};
};

@@ -35,3 +35,3 @@ const debug = require('debug')('push2cloud-cf-adapter:waitForAllInstances');

if (attempt >= options.maxRetries) {
return callback(new Error(`${options.name || options.appGuid} timeouted!`));
return callback(new Error(`${options.name || options.appGuid} timed out!`));
}

@@ -38,0 +38,0 @@

@@ -22,3 +22,3 @@ const debug = require('debug')('push2cloud-cf-adapter:waitForServiceInstance');

if (attempt >= options.maxRetries) {
return callback(new Error(`Waiting for service ${options.name || options.serviceInstanceGuid} timeouted!`));
return callback(new Error(`Waiting for service ${options.name || options.serviceInstanceGuid} timed out!`));
}

@@ -25,0 +25,0 @@

{
"name": "push2cloud-cf-adapter",
"version": "1.7.2",
"version": "1.7.3",
"description": "abstracts cloud foundry api",

@@ -5,0 +5,0 @@ "main": "index.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc