anomaly in dealing with SharedDomains


Nima Kaviani <nima.kaviani@...>
 

Hi,

I am trying to understand the expected behaviour when an already existing
SharedDomain is redefined as either a shared or a private domain in
CloudController.

I have added the following test to *domain_validation.rb ... *note the
validation part of the test which is highlighted. The following test does
not pass in *private_domain_spec.rb* but it does pass for
*shared_domain_spec.rb.*

*context 'when the domains are exact match and it is already a shared
domain' do*
* before do*
* SharedDomain.make name: 'foo.com <http://foo.com>'*
* subject.name <http://subject.name> = 'foo.com <http://foo.com>'*
* end*
* it { is_expected.not_to be_valid }*
*end*

Now if I change the test to the following it passes in
*private_domain_spec.rb* but it does not pass in* shared_domain_spec.rb*.

*context 'when the domains are exact match and it is already a shared
domain' do*
* before do*
* SharedDomain.make name: 'foo.com <http://foo.com>'*
* subject.name <http://subject.name> = 'foo.com <http://foo.com>'*
* end*
* it { is_expected.to <http://is_expected.to> be_valid }*
*end*

so, what is the expected behaviour with regards to an already existing
SharedDomain? does it allow for private domains to take over the name but
not for other SharedDomains to not take over the name, or vice verse? or is
it a bug in the way domain names get validated?

thanks,
-nima


--
http://nima.magic.ubc.ca


Mike Youngstrom <youngm@...>
 

I think it is a bug.

The intended functionality is that a sub domain of a shared domain can be
made private. But if the domain currently exists, private or shared
doesn't matter, should fail.

Mike

On Thu, Aug 6, 2015 at 5:43 PM, Nima Kaviani <nima.kaviani(a)gmail.com> wrote:

Hi,

I am trying to understand the expected behaviour when an already existing
SharedDomain is redefined as either a shared or a private domain in
CloudController.

I have added the following test to *domain_validation.rb ... *note the
validation part of the test which is highlighted. The following test does
not pass in *private_domain_spec.rb* but it does pass for
*shared_domain_spec.rb.*

*context 'when the domains are exact match and it is already a shared
domain' do*
* before do*
* SharedDomain.make name: 'foo.com <http://foo.com>'*
* subject.name <http://subject.name> = 'foo.com <http://foo.com>'*
* end*
* it { is_expected.not_to be_valid }*
*end*

Now if I change the test to the following it passes in
*private_domain_spec.rb* but it does not pass in* shared_domain_spec.rb*.

*context 'when the domains are exact match and it is already a shared
domain' do*
* before do*
* SharedDomain.make name: 'foo.com <http://foo.com>'*
* subject.name <http://subject.name> = 'foo.com <http://foo.com>'*
* end*
* it { is_expected.to <http://is_expected.to> be_valid }*
*end*

so, what is the expected behaviour with regards to an already existing
SharedDomain? does it allow for private domains to take over the name but
not for other SharedDomains to not take over the name, or vice verse? or is
it a bug in the way domain names get validated?

thanks,
-nima


--
http://nima.magic.ubc.ca


Nima Kaviani <nima.kaviani@...>
 

yes, I think the issue is with the validate method in private_domain.rb
excluding shared domains prior to doing the validation, which results in
the first test in the above to not fail.

On Thu, Aug 6, 2015 at 5:01 PM, Mike Youngstrom <youngm(a)gmail.com> wrote:

I think it is a bug.

The intended functionality is that a sub domain of a shared domain can be
made private. But if the domain currently exists, private or shared
doesn't matter, should fail.

Mike

On Thu, Aug 6, 2015 at 5:43 PM, Nima Kaviani <nima.kaviani(a)gmail.com>
wrote:

Hi,

I am trying to understand the expected behaviour when an already existing
SharedDomain is redefined as either a shared or a private domain in
CloudController.

I have added the following test to *domain_validation.rb ... *note the
validation part of the test which is highlighted. The following test does
not pass in *private_domain_spec.rb* but it does pass for
*shared_domain_spec.rb.*

*context 'when the domains are exact match and it is already a shared
domain' do*
* before do*
* SharedDomain.make name: 'foo.com <http://foo.com>'*
* subject.name <http://subject.name> = 'foo.com <http://foo.com>'*
* end*
* it { is_expected.not_to be_valid }*
*end*

Now if I change the test to the following it passes in
*private_domain_spec.rb* but it does not pass in* shared_domain_spec.rb*.

*context 'when the domains are exact match and it is already a shared
domain' do*
* before do*
* SharedDomain.make name: 'foo.com <http://foo.com>'*
* subject.name <http://subject.name> = 'foo.com <http://foo.com>'*
* end*
* it { is_expected.to <http://is_expected.to> be_valid }*
*end*

so, what is the expected behaviour with regards to an already existing
SharedDomain? does it allow for private domains to take over the name but
not for other SharedDomains to not take over the name, or vice verse? or is
it a bug in the way domain names get validated?

thanks,
-nima


--
http://nima.magic.ubc.ca


Mike Youngstrom <youngm@...>
 

On Thu, Aug 6, 2015 at 6:08 PM, Nima Kaviani <nima.kaviani(a)gmail.com> wrote:

yes, I think the issue is with the validate method in private_domain.rb
excluding shared domains prior to doing the validation, which results in
the first test in the above to not fail.

On Thu, Aug 6, 2015 at 5:01 PM, Mike Youngstrom <youngm(a)gmail.com> wrote:

I think it is a bug.

The intended functionality is that a sub domain of a shared domain can be
made private. But if the domain currently exists, private or shared
doesn't matter, should fail.

Mike

On Thu, Aug 6, 2015 at 5:43 PM, Nima Kaviani <nima.kaviani(a)gmail.com>
wrote:

Hi,

I am trying to understand the expected behaviour when an already
existing SharedDomain is redefined as either a shared or a private domain
in CloudController.

I have added the following test to *domain_validation.rb ... *note the
validation part of the test which is highlighted. The following test does
not pass in *private_domain_spec.rb* but it does pass for
*shared_domain_spec.rb.*

*context 'when the domains are exact match and it is already a shared
domain' do*
* before do*
* SharedDomain.make name: 'foo.com <http://foo.com>'*
* subject.name <http://subject.name> = 'foo.com <http://foo.com>'*
* end*
* it { is_expected.not_to be_valid }*
*end*

Now if I change the test to the following it passes in
*private_domain_spec.rb* but it does not pass in* shared_domain_spec.rb*
.

*context 'when the domains are exact match and it is already a shared
domain' do*
* before do*
* SharedDomain.make name: 'foo.com <http://foo.com>'*
* subject.name <http://subject.name> = 'foo.com <http://foo.com>'*
* end*
* it { is_expected.to <http://is_expected.to> be_valid }*
*end*

so, what is the expected behaviour with regards to an already existing
SharedDomain? does it allow for private domains to take over the name but
not for other SharedDomains to not take over the name, or vice verse? or is
it a bug in the way domain names get validated?

thanks,
-nima


--
http://nima.magic.ubc.ca

--
http://nima.magic.ubc.ca


Nima Kaviani <nima.kaviani@...>
 

Not exactly sure why, but it seems like it doesn't cross validate between
SharedDomains and PrivateDomains.

On Thu, Aug 6, 2015 at 5:13 PM, Mike Youngstrom <youngm(a)gmail.com> wrote:

Hmm...wouldn't the super call [0] validate uniqueness[1]?

[0]
https://github.com/cloudfoundry/cloud_controller_ng/blob/master/app/models/runtime/private_domain.rb#L41
[1]
https://github.com/cloudfoundry/cloud_controller_ng/blob/master/app/models/runtime/domain.rb#L74



On Thu, Aug 6, 2015 at 6:08 PM, Nima Kaviani <nima.kaviani(a)gmail.com>
wrote:

yes, I think the issue is with the validate method in private_domain.rb
excluding shared domains prior to doing the validation, which results in
the first test in the above to not fail.

On Thu, Aug 6, 2015 at 5:01 PM, Mike Youngstrom <youngm(a)gmail.com> wrote:

I think it is a bug.

The intended functionality is that a sub domain of a shared domain can
be made private. But if the domain currently exists, private or shared
doesn't matter, should fail.

Mike

On Thu, Aug 6, 2015 at 5:43 PM, Nima Kaviani <nima.kaviani(a)gmail.com>
wrote:

Hi,

I am trying to understand the expected behaviour when an already
existing SharedDomain is redefined as either a shared or a private domain
in CloudController.

I have added the following test to *domain_validation.rb ... *note the
validation part of the test which is highlighted. The following test does
not pass in *private_domain_spec.rb* but it does pass for
*shared_domain_spec.rb.*

*context 'when the domains are exact match and it is already a shared
domain' do*
* before do*
* SharedDomain.make name: 'foo.com <http://foo.com>'*
* subject.name <http://subject.name> = 'foo.com <http://foo.com>'*
* end*
* it { is_expected.not_to be_valid }*
*end*

Now if I change the test to the following it passes in
*private_domain_spec.rb* but it does not pass in
* shared_domain_spec.rb*.

*context 'when the domains are exact match and it is already a shared
domain' do*
* before do*
* SharedDomain.make name: 'foo.com <http://foo.com>'*
* subject.name <http://subject.name> = 'foo.com <http://foo.com>'*
* end*
* it { is_expected.to <http://is_expected.to> be_valid }*
*end*

so, what is the expected behaviour with regards to an already existing
SharedDomain? does it allow for private domains to take over the name but
not for other SharedDomains to not take over the name, or vice verse? or is
it a bug in the way domain names get validated?

thanks,
-nima


--
http://nima.magic.ubc.ca

--
http://nima.magic.ubc.ca


Dieu Cao <dcao@...>
 

Thanks NIma. I'll have someone on the team take a look.

-Dieu
CF CAPI PM

On Thu, Aug 6, 2015 at 5:38 PM, Nima Kaviani <nima.kaviani(a)gmail.com> wrote:

Not exactly sure why, but it seems like it doesn't cross validate between
SharedDomains and PrivateDomains.

On Thu, Aug 6, 2015 at 5:13 PM, Mike Youngstrom <youngm(a)gmail.com> wrote:

Hmm...wouldn't the super call [0] validate uniqueness[1]?

[0]
https://github.com/cloudfoundry/cloud_controller_ng/blob/master/app/models/runtime/private_domain.rb#L41
[1]
https://github.com/cloudfoundry/cloud_controller_ng/blob/master/app/models/runtime/domain.rb#L74



On Thu, Aug 6, 2015 at 6:08 PM, Nima Kaviani <nima.kaviani(a)gmail.com>
wrote:

yes, I think the issue is with the validate method in private_domain.rb
excluding shared domains prior to doing the validation, which results in
the first test in the above to not fail.

On Thu, Aug 6, 2015 at 5:01 PM, Mike Youngstrom <youngm(a)gmail.com>
wrote:

I think it is a bug.

The intended functionality is that a sub domain of a shared domain can
be made private. But if the domain currently exists, private or shared
doesn't matter, should fail.

Mike

On Thu, Aug 6, 2015 at 5:43 PM, Nima Kaviani <nima.kaviani(a)gmail.com>
wrote:

Hi,

I am trying to understand the expected behaviour when an already
existing SharedDomain is redefined as either a shared or a private domain
in CloudController.

I have added the following test to *domain_validation.rb ... *note
the validation part of the test which is highlighted. The following test
does not pass in *private_domain_spec.rb* but it does pass for
*shared_domain_spec.rb.*

*context 'when the domains are exact match and it is already a shared
domain' do*
* before do*
* SharedDomain.make name: 'foo.com <http://foo.com>'*
* subject.name <http://subject.name> = 'foo.com <http://foo.com>'*
* end*
* it { is_expected.not_to be_valid }*
*end*

Now if I change the test to the following it passes in
*private_domain_spec.rb* but it does not pass in
* shared_domain_spec.rb*.

*context 'when the domains are exact match and it is already a shared
domain' do*
* before do*
* SharedDomain.make name: 'foo.com <http://foo.com>'*
* subject.name <http://subject.name> = 'foo.com <http://foo.com>'*
* end*
* it { is_expected.to <http://is_expected.to> be_valid }*
*end*

so, what is the expected behaviour with regards to an already existing
SharedDomain? does it allow for private domains to take over the name but
not for other SharedDomains to not take over the name, or vice verse? or is
it a bug in the way domain names get validated?

thanks,
-nima


--
http://nima.magic.ubc.ca

--
http://nima.magic.ubc.ca

--
http://nima.magic.ubc.ca