-
Notifications
You must be signed in to change notification settings - Fork 98
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
Shrink NS names #490
Shrink NS names #490
Conversation
9e8fb85
to
43af203
Compare
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.
Just a minor inline enhancement, otherwise looks great!
closes #456 `nsServerName` and `nsExtServerNames` - shortly nsnames are calculated from ClusterGeoTag and ExtClusterGeoTags. - DNS_ZONE k8gb-test.gslb.cloud.example.com - EDGE_DNS_ZONE: cloud.example.com - CLUSTER_GEOTAG: us will generate **gslb-ns-us-k8gb-test-gslb.cloud.example.com** Nsnames are provided by depresolver config via functions `(c *Config) GetExternalClusterNSNames() (m map[string]string)` and `(c *Config) GetClusterNSName() string` and are validated during k8gb initialization. Regarding [RFC1035](https://www.ietf.org/rfc/rfc1035.txt), particular DNS labels are validated on max length 63 characters and whole domain is validated on max length 253 characters [1](https://stackoverflow.com/questions/32290167/what-is-the-maximum-length-of-a-dns-name). Such behavior is covered by unit tests. Because nsnames are provided via config, `nsServerName(...)` and `nsServerNameExt(...)` were removed including tests. Because nsname structure had changed I had to fix `controller_tests`, `infoblox_tests`, `values.yaml` and `Makefile`. I also moved to configuration `GetExternalClusterHeartbeatFQDNs(gslbName string) (m map[string]string)` and `GetClusterHeartbeatFQDN(gslbName string) string` which are used in parallel with `GetExternalClusterNSNames()` and are also calculated from the configuration data. Signed-off-by: kuritka <kuritka@gmail.com>
43af203
to
0f4042e
Compare
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.
LGTM
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.
LGTM
closes #456
nsServerName
andnsExtServerNames
- shortly, we calculate nsnames from ClusterGeoTag and ExtClusterGeoTags.DNS_ZONE
k8gb-test.gslb.cloud.example.comEDGE_DNS_ZONE
: cloud.example.comCLUSTER_GEOTAG
: uswill generate gslb-ns-us-k8gb-test-gslb.cloud.example.com
Nsnames are provided by depresolver config via functions
(c *Config) GetExternalClusterNSNames() (m map[string]string)
and(c *Config) GetClusterNSName() string
and are validated during k8gb initialization. Regarding RFC1035, particular DNS labels are validated on max length 63 characters and whole domain is validated on max length 253 characters [1]. We cover that by unit tests.Because nsnames are provided via config,
nsServerName(...)
andnsServerNameExt(...)
were removed including tests.Because nsname structure had changed I had to fix
controller_tests
,infoblox_tests
,values.yaml
andMakefile
.I also moved to configuration
GetExternalClusterHeartbeatFQDNs(gslbName string) (m map[string]string)
andGetClusterHeartbeatFQDN(gslbName string) string
which are used in parallel withGetExternalClusterNSNames()
and are also calculated from the configuration data.For testing I'm using gomock, which creates mock objects and asserts intermediate results. Thanks to that I'm able to assert endpoint before we save it, see
TestCreateZoneDelegationOnExternalDNS
inexternal_test.go
. GoMock generates mock files based on the interface. Eachmake mocks
will regenerate mock files without license. That's why golic runs for each *_mock.go.Signed-off-by: kuritka kuritka@gmail.com