Skip to content

Commit b95c427

Browse files
authored
support coredns v1.11.4 and v1.12.0 (#86)
* support coredns v1.11.4 and v1.12.0 Signed-off-by: bzsuni <[email protected]> * Add servfail and disable options missing from cache in CoreDNS 1.9.4 Signed-off-by: bzsuni <[email protected]> --------- Signed-off-by: bzsuni <[email protected]>
1 parent d9cc8b6 commit b95c427

File tree

3 files changed

+94
-17
lines changed

3 files changed

+94
-17
lines changed

corefile-tool/cmd/validversions_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ func TestNewValidVersionsCmd(t *testing.T) {
1515
{
1616
name: "Works without error",
1717
expectedOutput: `The following are valid CoreDNS versions:
18-
1.1.3, 1.1.4, 1.2.0, 1.2.1, 1.2.2, 1.2.3, 1.2.4, 1.2.5, 1.2.6, 1.3.0, 1.3.1, 1.4.0, 1.5.0, 1.5.1, 1.5.2, 1.6.0, 1.6.1, 1.6.2, 1.6.3, 1.6.4, 1.6.5, 1.6.6, 1.6.7, 1.6.9, 1.7.0, 1.7.1, 1.8.0, 1.8.3, 1.8.4, 1.8.5, 1.8.6, 1.8.7, 1.9.0, 1.9.1, 1.9.2, 1.9.3, 1.9.4, 1.10.0, 1.10.1, 1.11.0, 1.11.1, 1.11.3
18+
1.1.3, 1.1.4, 1.2.0, 1.2.1, 1.2.2, 1.2.3, 1.2.4, 1.2.5, 1.2.6, 1.3.0, 1.3.1, 1.4.0, 1.5.0, 1.5.1, 1.5.2, 1.6.0, 1.6.1, 1.6.2, 1.6.3, 1.6.4, 1.6.5, 1.6.6, 1.6.7, 1.6.9, 1.7.0, 1.7.1, 1.8.0, 1.8.3, 1.8.4, 1.8.5, 1.8.6, 1.8.7, 1.9.0, 1.9.1, 1.9.2, 1.9.3, 1.9.4, 1.10.0, 1.10.1, 1.11.0, 1.11.1, 1.11.3, 1.11.4, 1.12.0
1919
`,
2020
expectedError: false,
2121
},

migration/plugins.go

Lines changed: 36 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -311,12 +311,12 @@ var plugins = map[string]map[string]plugin{
311311
},
312312
"v3": plugin{
313313
namedOptions: map[string]option{
314-
"type": {},
315-
"class": {},
316-
"name": {},
317-
"answer name": {},
318-
"edns0": {},
319-
"ttl": {},
314+
"type": {},
315+
"class": {},
316+
"name": {},
317+
"answer name": {},
318+
"edns0": {},
319+
"ttl": {},
320320
"cname_target": {}, // new option
321321
},
322322
},
@@ -351,7 +351,19 @@ var plugins = map[string]map[string]plugin{
351351
"success": {},
352352
"denial": {},
353353
"prefetch": {},
354-
"serve_stale": {},
354+
"serve_stale": {},
355+
"disable": {}, // v1.9.4 new option
356+
"servfail": {}, // v1.9.4 new option
357+
},
358+
},
359+
"v4": plugin{
360+
namedOptions: map[string]option{
361+
"success": {},
362+
"denial": {},
363+
"prefetch": {},
364+
"serve_stale": {},
365+
"disable": {},
366+
"servfail": {},
355367
"keepttl": {}, // new option
356368
},
357369
},
@@ -417,6 +429,21 @@ var plugins = map[string]map[string]plugin{
417429
},
418430
},
419431
},
432+
"v4": plugin{
433+
namedOptions: map[string]option{
434+
"except": {},
435+
"force_tcp": {},
436+
"prefer_udp": {},
437+
"expire": {},
438+
"max_fails": {},
439+
"tls": {},
440+
"tls_servername": {},
441+
"policy": {},
442+
"health_check": {},
443+
"max_concurrent": {},
444+
"next": {}, // new option
445+
},
446+
},
420447
},
421448

422449
"k8s_external": {
@@ -428,8 +455,8 @@ var plugins = map[string]map[string]plugin{
428455
},
429456
"v2": plugin{
430457
namedOptions: map[string]option{
431-
"apex": {},
432-
"ttl": {},
458+
"apex": {},
459+
"ttl": {},
433460
"fallthrough": {}, // new option
434461
},
435462
},

migration/versions.go

Lines changed: 57 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,22 +30,34 @@ type release struct {
3030

3131
// Versions holds a map of plugin/option migrations per CoreDNS release (since 1.1.4)
3232
var Versions = map[string]release{
33+
"1.12.0": {
34+
priorVersion: "1.11.4",
35+
dockerImageSHA: "40384aa1f5ea6bfdc77997d243aec73da05f27aed0c5e9d65bfa98933c519d97",
36+
plugins: plugins_1_11_4,
37+
},
38+
"1.11.4": {
39+
nextVersion: "1.12.0",
40+
priorVersion: "1.11.3",
41+
dockerImageSHA: "4190b960ea90e017631e3e1a38eea28e98e057ab60d57d47b3db6e5cf77436f7",
42+
plugins: plugins_1_11_4,
43+
},
3344
"1.11.3": {
45+
nextVersion: "1.11.4",
3446
priorVersion: "1.11.1",
3547
dockerImageSHA: "9caabbf6238b189a65d0d6e6ac138de60d6a1c419e5a341fbbb7c78382559c6e",
36-
plugins: plugins_1_11_0,
48+
plugins: plugins_1_11_0,
3749
},
3850
"1.11.1": {
3951
nextVersion: "1.11.3",
4052
priorVersion: "1.11.0",
4153
dockerImageSHA: "1eeb4c7316bacb1d4c8ead65571cd92dd21e27359f0d4917f1a5822a73b75db1",
42-
plugins: plugins_1_11_0,
54+
plugins: plugins_1_11_0,
4355
},
4456
"1.11.0": {
4557
nextVersion: "1.11.1",
4658
priorVersion: "1.10.1",
4759
dockerImageSHA: "cc3ebb05fbdba439d2d69813f162aa204b027098c8244fb3156e6e7c0f31c548",
48-
plugins: plugins_1_11_0,
60+
plugins: plugins_1_11_0,
4961
},
5062
"1.10.1": {
5163
nextVersion: "1.11.0",
@@ -57,13 +69,13 @@ var Versions = map[string]release{
5769
nextVersion: "1.10.1",
5870
priorVersion: "1.9.4",
5971
dockerImageSHA: "017727efcfeb7d053af68e51436ce8e65edbc6ca573720afb4f79c8594036955",
60-
plugins: plugins_1_9_3,
72+
plugins: plugins_1_9_4,
6173
},
6274
"1.9.4": {
6375
nextVersion: "1.10.0",
6476
priorVersion: "1.9.3",
6577
dockerImageSHA: "b82e294de6be763f73ae71266c8f5466e7e03c69f3a1de96efd570284d35bb18",
66-
plugins: plugins_1_9_3,
78+
plugins: plugins_1_9_4,
6779
},
6880
"1.9.3": {
6981
nextVersion: "1.9.4",
@@ -763,6 +775,25 @@ var Versions = map[string]release{
763775
}`},
764776
}
765777

778+
var plugins_1_11_4 = map[string]plugin{
779+
"errors": plugins["errors"]["v3"],
780+
"log": plugins["log"]["v1"],
781+
"health": plugins["health"]["v1"],
782+
"ready": {},
783+
"autopath": {},
784+
"kubernetes": plugins["kubernetes"]["v8"],
785+
"k8s_external": plugins["k8s_external"]["v2"],
786+
"prometheus": {},
787+
"forward": plugins["forward"]["v4"], // add next option
788+
"cache": plugins["cache"]["v4"],
789+
"loop": {},
790+
"reload": {},
791+
"loadbalance": {},
792+
"hosts": plugins["hosts"]["v1"],
793+
"rewrite": plugins["rewrite"]["v3"],
794+
"transfer": plugins["transfer"]["v1"],
795+
}
796+
766797
var plugins_1_11_0 = map[string]plugin{
767798
"errors": plugins["errors"]["v3"],
768799
"log": plugins["log"]["v1"],
@@ -773,7 +804,7 @@ var plugins_1_11_0 = map[string]plugin{
773804
"k8s_external": plugins["k8s_external"]["v2"], //add fallthrough option
774805
"prometheus": {},
775806
"forward": plugins["forward"]["v3"],
776-
"cache": plugins["cache"]["v2"],
807+
"cache": plugins["cache"]["v4"],
777808
"loop": {},
778809
"reload": {},
779810
"loadbalance": {},
@@ -792,7 +823,26 @@ var plugins_1_10_1 = map[string]plugin{
792823
"k8s_external": plugins["k8s_external"]["v1"],
793824
"prometheus": {},
794825
"forward": plugins["forward"]["v3"],
795-
"cache": plugins["cache"]["v2"], // add keepttl option
826+
"cache": plugins["cache"]["v4"], // add keepttl option
827+
"loop": {},
828+
"reload": {},
829+
"loadbalance": {},
830+
"hosts": plugins["hosts"]["v1"],
831+
"rewrite": plugins["rewrite"]["v2"],
832+
"transfer": plugins["transfer"]["v1"],
833+
}
834+
835+
var plugins_1_9_4 = map[string]plugin{
836+
"errors": plugins["errors"]["v3"], // stacktrace option added
837+
"log": plugins["log"]["v1"],
838+
"health": plugins["health"]["v1"],
839+
"ready": {},
840+
"autopath": {},
841+
"kubernetes": plugins["kubernetes"]["v8"],
842+
"k8s_external": plugins["k8s_external"]["v1"],
843+
"prometheus": {},
844+
"forward": plugins["forward"]["v3"],
845+
"cache": plugins["cache"]["v3"], // add disable and servfail options
796846
"loop": {},
797847
"reload": {},
798848
"loadbalance": {},

0 commit comments

Comments
 (0)