diff --git a/app/apollo/test/channel.remote.spec.js b/app/apollo/test/channel.remote.spec.js index a63ee00ae..50029abc4 100644 --- a/app/apollo/test/channel.remote.spec.js +++ b/app/apollo/test/channel.remote.spec.js @@ -691,7 +691,7 @@ describe('channel remote graphql test suite', () => { }, ], }, - } + }, }); console.log( `addSubscription result: ${JSON.stringify( result.data, null, 2 )}` ); const addSubscription = result.data.data.addSubscription; @@ -723,7 +723,8 @@ describe('channel remote graphql test suite', () => { expect(sub01).to.be.an('object'); expect(sub01.remote).to.be.an('object'); expect(sub01.remote.remoteType).to.equal('github'); - expect(sub01.remote.parameters.length).to.equal(3); // One from the Config, one from the Version created with the channel, one from the new subscription + console.log( `PLC sub01.remote.parameters: ${JSON.stringify( sub01.remote.parameters, null, 2 )}` ); + expect(sub01.remote.parameters.length).to.equal(2); // One from the Config merged with one from the Version } catch (error) { if (error.response) { console.error('error encountered: ', error.response.data); diff --git a/app/utils/subscriptions.js b/app/utils/subscriptions.js index ed02a5285..c4d9cd88a 100644 --- a/app/utils/subscriptions.js +++ b/app/utils/subscriptions.js @@ -37,7 +37,7 @@ const getSubscriptionDetails = async(orgId, matchingSubscriptions, cluster) => { else if( channel.contentType === CHANNEL_CONSTANTS.CONTENTTYPES.REMOTE ) { sub.remote = { remoteType: channel.remote.remoteType, - parameters: channel.remote.parameters || [], + parameters: channel.remote.parameters ? _.cloneDeep(channel.remote.parameters) : [], // cloning channel params prevents incorrect behavior if a cluster is subscribed to multiple versions of the same channel }; // Find version (avoid using deprecated/ignored `versions` attribute on the channel) const version = await models.DeployableVersion.findOne( { org_id: orgId, uuid: subscription.version_uuid } );