From 90369fbc7e942b6d9c7e21ef531745af96fb079f Mon Sep 17 00:00:00 2001 From: tukwila Date: Tue, 22 Aug 2023 22:09:36 +0800 Subject: [PATCH] support coredns v1.11.0 (#76) add 1.11.0 and fix missing option in 1.10.1 Signed-off-by: guangli.bao --- corefile-tool/cmd/validversions_test.go | 2 +- migration/plugins.go | 27 +++++++++++++++ migration/versions.go | 46 ++++++++++++++++++++++++- 3 files changed, 73 insertions(+), 2 deletions(-) diff --git a/corefile-tool/cmd/validversions_test.go b/corefile-tool/cmd/validversions_test.go index 0fb73b7..33d49c6 100644 --- a/corefile-tool/cmd/validversions_test.go +++ b/corefile-tool/cmd/validversions_test.go @@ -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.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 `, expectedError: false, }, diff --git a/migration/plugins.go b/migration/plugins.go index abfb04d..500b73c 100644 --- a/migration/plugins.go +++ b/migration/plugins.go @@ -309,6 +309,17 @@ var plugins = map[string]map[string]plugin{ "ttl": {}, // new option }, }, + "v3": plugin{ + namedOptions: map[string]option{ + "type": {}, + "class": {}, + "name": {}, + "answer name": {}, + "edns0": {}, + "ttl": {}, + "cname_target": {}, // new option + }, + }, }, "log": { @@ -335,6 +346,15 @@ var plugins = map[string]map[string]plugin{ "serve_stale": {}, // new option }, }, + "v3": plugin{ + namedOptions: map[string]option{ + "success": {}, + "denial": {}, + "prefetch": {}, + "serve_stale": {}, + "keepttl": {}, // new option + }, + }, }, "forward": { @@ -406,6 +426,13 @@ var plugins = map[string]map[string]plugin{ "ttl": {}, }, }, + "v2": plugin{ + namedOptions: map[string]option{ + "apex": {}, + "ttl": {}, + "fallthrough": {}, // new option + }, + }, }, "proxy": { diff --git a/migration/versions.go b/migration/versions.go index 083d5da..0814d74 100644 --- a/migration/versions.go +++ b/migration/versions.go @@ -30,10 +30,16 @@ type release struct { // Versions holds a map of plugin/option migrations per CoreDNS release (since 1.1.4) var Versions = map[string]release{ + "1.11.0": { + priorVersion: "1.10.1", + dockerImageSHA: "cc3ebb05fbdba439d2d69813f162aa204b027098c8244fb3156e6e7c0f31c548", + plugins: plugins_1_11_0, + }, "1.10.1": { + nextVersion: "1.11.0", priorVersion: "1.10.0", dockerImageSHA: "a0ead06651cf580044aeb0a0feba63591858fb2e43ade8c9dea45a6a89ae7e5e", - plugins: plugins_1_9_3, + plugins: plugins_1_10_1, }, "1.10.0": { nextVersion: "1.10.1", @@ -745,6 +751,44 @@ var Versions = map[string]release{ }`}, } +var plugins_1_11_0 = 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"], //add fallthrough option + "prometheus": {}, + "forward": plugins["forward"]["v3"], + "cache": plugins["cache"]["v2"], + "loop": {}, + "reload": {}, + "loadbalance": {}, + "hosts": plugins["hosts"]["v1"], + "rewrite": plugins["rewrite"]["v3"], // add cname_target option + "transfer": plugins["transfer"]["v1"], +} + +var plugins_1_10_1 = 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"]["v1"], + "prometheus": {}, + "forward": plugins["forward"]["v3"], + "cache": plugins["cache"]["v2"], // add keepttl option + "loop": {}, + "reload": {}, + "loadbalance": {}, + "hosts": plugins["hosts"]["v1"], + "rewrite": plugins["rewrite"]["v2"], + "transfer": plugins["transfer"]["v1"], +} + var plugins_1_9_3 = map[string]plugin{ "errors": plugins["errors"]["v3"], // stacktrace option added "log": plugins["log"]["v1"],