Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

joyent/triton-cns#22 Want support for reverse proxy zones #23

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

arekinath
Copy link
Contributor

See #22.

Tested on CoaL and by running auto-tests. Not sure about documentation for this, maybe we should visit that as a separate commit?

Copy link

@kusor kusor left a comment

Choose a reason for hiding this comment

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

@arekinath other than minor copyright issues and a suggestion to use braces, looks good to me. Btw, feel free to ping me directly when you need a CR.

@@ -5,6 +5,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* Copyright (c) 2018, Joyent, Inc.
Copy link

Choose a reason for hiding this comment

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

This will give us build issues if you don't modify to Copyright 2020 Joyent, Inc. Mind to change that line too?

type: 'string'},
{field: 'proxy_networks', stringify: function (v) {
v = v || [];
if (v.length === 1 && v[0] === '*')
Copy link

Choose a reason for hiding this comment

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

Nit: can we use braces for conditionals?

@@ -4,6 +4,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* Copyright (c) 2018, Joyent, Inc.
Copy link

Choose a reason for hiding this comment

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

Same copyright issue than above

@@ -4,6 +4,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* Copyright (c) 2018, Joyent, Inc.
* Copyright 2016, 2020, The University of Queensland
Copy link

Choose a reason for hiding this comment

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

2016?. Shouldn't this just be 2020?

@@ -151,16 +154,37 @@ function isNetOwned(vm, netw) {
return ((netw.owner_uuids || []).indexOf(vm.owner.uuid) !== -1);
}

function isProxied(ent, config) {
var zoneConfig = config.forward_zones[ent.zone];
if (!zoneConfig.proxy_networks)
Copy link

Choose a reason for hiding this comment

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

Same braces thing than above. Also, why parentheses around the boolean keywords?

Comment on lines +304 to +305
if (isProxied(ent, config))
ip = config.forward_zones[ent.zone].proxy_addr;
Copy link

Choose a reason for hiding this comment

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

Braces please :-)

@@ -113,7 +113,11 @@ test('with use_alias', function (t) {
var config = {
use_alias: true,
forward_zones: {
'foo': { networks: ['*'] }
'foo': {
Copy link

Choose a reason for hiding this comment

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

Can we bump Joyent Copyright notice of this file too, please?

Copy link
Member

@bahamat bahamat left a comment

Choose a reason for hiding this comment

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

I'd also like to see some documentation as to how this gets used.

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.

3 participants