-
Notifications
You must be signed in to change notification settings - Fork 10
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
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this 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. |
There was a problem hiding this comment.
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] === '*') |
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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?
if (isProxied(ent, config)) | ||
ip = config.forward_zones[ent.zone].proxy_addr; |
There was a problem hiding this comment.
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': { |
There was a problem hiding this comment.
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?
There was a problem hiding this 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.
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?