-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
ns1: add minttlseconds #1576
ns1: add minttlseconds #1576
Conversation
Welcome @dennisme! |
Happy to squash commits, post review :) |
Hi @dennisme ! I'm not sure I understand why we would need this. To me, it looks like you want to protect from a TTL that is too low, but this is just another setting and thus subject to the same considerations: it needs to be tested / audited to be considered good. Is there anything I'm missing here? |
@Raffo hey, good questions. I am trying to just make it easier to control the ttl of ns1 records created by external-dns. Default of 10 is quite low. Yes its possible to add I am cool doing the testing and even adding more validation. |
@Raffo thoughts on the above? |
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.
Thanks for the PR. Ok to me only a nit but you may want to add a test for pkg/apis/externaldns/types.go. To see if ttl get's overwritten.
NS1Endpoint: cfg.NS1Endpoint, | ||
NS1IgnoreSSL: cfg.NS1IgnoreSSL, | ||
DryRun: cfg.DryRun, | ||
MinTTLSeconds: cfg.NS1MinTTLSeconds, |
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.
Why not N1TTLSeconds? Same for the flag ns1-min-ttl -> ns1-ttl
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 like your name, I can update
@@ -361,6 +362,7 @@ func (cfg *Config) ParseFlags(args []string) error { | |||
app.Flag("pdns-tls-enabled", "When using the PowerDNS/PDNS provider, specify whether to use TLS (default: false, requires --tls-ca, optionally specify --tls-client-cert and --tls-client-cert-key)").Default(strconv.FormatBool(defaultConfig.PDNSTLSEnabled)).BoolVar(&cfg.PDNSTLSEnabled) | |||
app.Flag("ns1-endpoint", "When using the NS1 provider, specify the URL of the API endpoint to target (default: https://api.nsone.net/v1/)").Default(defaultConfig.NS1Endpoint).StringVar(&cfg.NS1Endpoint) | |||
app.Flag("ns1-ignoressl", "When using the NS1 provider, specify whether to verify the SSL certificate (default: false)").Default(strconv.FormatBool(defaultConfig.NS1IgnoreSSL)).BoolVar(&cfg.NS1IgnoreSSL) | |||
app.Flag("ns1-min-ttl", "Minimal TTL (in seconds) for records. This value will be used if the provided TTL for a service/ingress is lower than this.").IntVar(&cfg.NS1MinTTLSeconds) |
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.
Another suggestion you could add a default TTL if you want, IIIRC we use is in different providers already
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.
As an example:
app.Flag("rfc2136-min-ttl", "When using the RFC2136 provider, specify minimal TTL (in duration format) for records. This value will be used if the provided TTL for a service/ingress is lower than this").Default(defaultConfig.RFC2136MinTTL.String()).DurationVar(&cfg.RFC2136MinTTL)
@dennisme in case you're still interested in merging this PR, please run another rebase and please add you PR into the CHANGELOG.md. |
Still interested just need to find some cycles. |
/kind feature |
@dennisme could you please update the CHANGELOG.md? |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: dennisme, Raffo The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
@seanmalloy yes happy to open a second PR for that. thanks @Raffo, sorry for the delay here I was taking a bit of a break from after hours work :) |
This PR adds the ability to set a
ns1-min-ttl
for the ns1 provider.