Skip to content

Commit

Permalink
support coredns v1.11.4 and v1.12.0
Browse files Browse the repository at this point in the history
Signed-off-by: bzsuni <[email protected]>
  • Loading branch information
bzsuni committed Nov 22, 2024
1 parent d9cc8b6 commit 1897e8e
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 13 deletions.
2 changes: 1 addition & 1 deletion corefile-tool/cmd/validversions_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ func TestNewValidVersionsCmd(t *testing.T) {
{
name: "Works without error",
expectedOutput: `The following are valid CoreDNS versions:
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.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
`,
expectedError: false,
},
Expand Down
33 changes: 24 additions & 9 deletions migration/plugins.go
Original file line number Diff line number Diff line change
Expand Up @@ -311,12 +311,12 @@ var plugins = map[string]map[string]plugin{
},
"v3": plugin{
namedOptions: map[string]option{
"type": {},
"class": {},
"name": {},
"answer name": {},
"edns0": {},
"ttl": {},
"type": {},
"class": {},
"name": {},
"answer name": {},
"edns0": {},
"ttl": {},
"cname_target": {}, // new option
},
},
Expand Down Expand Up @@ -351,7 +351,7 @@ var plugins = map[string]map[string]plugin{
"success": {},
"denial": {},
"prefetch": {},
"serve_stale": {},
"serve_stale": {},
"keepttl": {}, // new option
},
},
Expand Down Expand Up @@ -417,6 +417,21 @@ var plugins = map[string]map[string]plugin{
},
},
},
"v4": plugin{
namedOptions: map[string]option{
"except": {},
"force_tcp": {},
"prefer_udp": {},
"expire": {},
"max_fails": {},
"tls": {},
"tls_servername": {},
"policy": {},
"health_check": {},
"max_concurrent": {},
"next": {}, // new option
},
},
},

"k8s_external": {
Expand All @@ -428,8 +443,8 @@ var plugins = map[string]map[string]plugin{
},
"v2": plugin{
namedOptions: map[string]option{
"apex": {},
"ttl": {},
"apex": {},
"ttl": {},
"fallthrough": {}, // new option
},
},
Expand Down
37 changes: 34 additions & 3 deletions migration/versions.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,22 +30,34 @@ type release struct {

// Versions holds a map of plugin/option migrations per CoreDNS release (since 1.1.4)
var Versions = map[string]release{
"1.12.0": {
priorVersion: "1.11.4",
dockerImageSHA: "40384aa1f5ea6bfdc77997d243aec73da05f27aed0c5e9d65bfa98933c519d97",
plugins: plugins_1_11_4,
},
"1.11.4": {
nextVersion: "1.12.0",
priorVersion: "1.11.3",
dockerImageSHA: "4190b960ea90e017631e3e1a38eea28e98e057ab60d57d47b3db6e5cf77436f7",
plugins: plugins_1_11_4,
},
"1.11.3": {
nextVersion: "1.11.4",
priorVersion: "1.11.1",
dockerImageSHA: "9caabbf6238b189a65d0d6e6ac138de60d6a1c419e5a341fbbb7c78382559c6e",
plugins: plugins_1_11_0,
plugins: plugins_1_11_0,
},
"1.11.1": {
nextVersion: "1.11.3",
priorVersion: "1.11.0",
dockerImageSHA: "1eeb4c7316bacb1d4c8ead65571cd92dd21e27359f0d4917f1a5822a73b75db1",
plugins: plugins_1_11_0,
plugins: plugins_1_11_0,
},
"1.11.0": {
nextVersion: "1.11.1",
priorVersion: "1.10.1",
dockerImageSHA: "cc3ebb05fbdba439d2d69813f162aa204b027098c8244fb3156e6e7c0f31c548",
plugins: plugins_1_11_0,
plugins: plugins_1_11_0,
},
"1.10.1": {
nextVersion: "1.11.0",
Expand Down Expand Up @@ -763,6 +775,25 @@ var Versions = map[string]release{
}`},
}

var plugins_1_11_4 = map[string]plugin{
"errors": plugins["errors"]["v3"],
"log": plugins["log"]["v1"],
"health": plugins["health"]["v1"],
"ready": {},
"autopath": {},
"kubernetes": plugins["kubernetes"]["v8"],
"k8s_external": plugins["k8s_external"]["v2"],
"prometheus": {},
"forward": plugins["forward"]["v4"], // add next option
"cache": plugins["cache"]["v2"],
"loop": {},
"reload": {},
"loadbalance": {},
"hosts": plugins["hosts"]["v1"],
"rewrite": plugins["rewrite"]["v3"],
"transfer": plugins["transfer"]["v1"],
}

var plugins_1_11_0 = map[string]plugin{
"errors": plugins["errors"]["v3"],
"log": plugins["log"]["v1"],
Expand Down

0 comments on commit 1897e8e

Please sign in to comment.