Skip to content

Conversation

@Nathan219
Copy link
Member

Charon calls GET instance/id/dependencies/hostname
Check if the incoming hostname is an alias, if it's not, do the normal dep logic

Check if the incoming hostname is an alias, if it's not, do the normal dep logic
@Nathan219 Nathan219 requested a review from Myztiq February 27, 2017 23:41
@Nathan219 Nathan219 self-assigned this Feb 27, 2017
params = {}
}
var self = this
return Instance.findByIdAsync(this._id)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we not add .bind(this) here and not use self?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Copy link
Contributor

@Myztiq Myztiq left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor nits

throw new Instance.NotFoundError('Not masterpod and not isolated!')
}
return Instance.findOneBy(query)
.then(instance => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tap

// Annotate dependencies with additional instance information (currently
// only adding network information for charon)
return Promise
.map(dependencies, dep => Instance.findByIdAsync(dep.instanceId))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we batch this into one fetch? This is going to be called a bunch from charon I'm guessing and speed of this is important. Unless we don't think it's a concern for the moment.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

charon only calls it with the hostname, the UI calls for all of them, so it should only ever be 1 call.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see. So it's the UI call that'll be slow? Otherwise what's up with the else on line 1182, and what's the scenario it'd be ran and how that'd only be 1 array item.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was when instances had deps of themselves. This was a to remove them from showing up in the UI. I'm not sure what you mean about the 1 item array

REDIS_PORT=6379
S3_CONTEXT_RESOURCE_BUCKET=runnable.context.resources.development
ALLOW_ALL_CORS=true
AWS_ALIAS_HOST=us-west-2.compute.internal
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

newline

method: 'InstanceSchema.methods.convertAliasesToDeps'
})
log.info('called')
return Promise.try(() => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Promise.method instead of .try

Copy link
Contributor

@Myztiq Myztiq left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nits, please change those 2 things and we should be good.

@Nathan219 Nathan219 merged commit 566501f into master Mar 21, 2017
@Nathan219 Nathan219 deleted the SAN-5803-charon-aliases branch March 21, 2017 01:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants