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

Add 'domains' endpoint request. #74

Merged
merged 4 commits into from
May 21, 2018

Conversation

ExternalReality
Copy link

@ExternalReality ExternalReality commented May 20, 2018

This PR adds MAAS 2.0's Domains endpoint. The only thing one can do with a Domain right now is query its name since this is all Juju wants from it thus far.

Copy link
Contributor

@howbazaar howbazaar left a comment

Choose a reason for hiding this comment

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

Generally good. A few header comment issues.

I'd like a second opinion for @jameinel about the int vs. *int issue.

domain.go Outdated
name string
}

// implements Domain
Copy link
Contributor

Choose a reason for hiding this comment

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

Commend should start with the name of the function.

domain.go Outdated

// ttl live is going to be the zero value if it is null. Thus the time
// to live will be zero. Would rather user's check for zero or for nil?
ttl, _ := valid["ttl"].(int)
Copy link
Contributor

Choose a reason for hiding this comment

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

I do wonder if we should just mirror the MAAS behaviour and have *int.

Copy link
Member

Choose a reason for hiding this comment

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

Just to clarify, TTL = 0 has a valid meaning in DNS (it means don't cache) rather than no TTL meaning use the default value for caching.

I don't think Juju is using the TTL right now, but we should track the data correctly.

domain.go Outdated
@@ -0,0 +1,83 @@
// Copyright 2018 Canonical Ltd.
// Licensed under the AGPLv3, see LICENCE file for details.
Copy link
Contributor

Choose a reason for hiding this comment

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

LGPL

domain_test.go Outdated
@@ -0,0 +1,46 @@
// Copyright 2016 Canonical Ltd.
Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Member

@jameinel jameinel left a comment

Choose a reason for hiding this comment

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

aside from TTL, everything looks good (beyond Tim's comments on some of the copyright headers)

domain.go Outdated

// ttl live is going to be the zero value if it is null. Thus the time
// to live will be zero. Would rather user's check for zero or for nil?
ttl, _ := valid["ttl"].(int)
Copy link
Member

Choose a reason for hiding this comment

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

Just to clarify, TTL = 0 has a valid meaning in DNS (it means don't cache) rather than no TTL meaning use the default value for caching.

I don't think Juju is using the TTL right now, but we should track the data correctly.

@ExternalReality
Copy link
Author

$$MERGE$$

@jujubot jujubot merged commit abe1190 into juju:master May 21, 2018
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