From 3d1d223711e3174ea5c107060968791fdf05fac1 Mon Sep 17 00:00:00 2001 From: Bridget McErlean Date: Fri, 19 Jun 2020 12:16:40 -0400 Subject: [PATCH] Replace use of whitelist with allow/allow list Signed-off-by: Bridget McErlean --- cmd/sonobuoy/app/run.go | 4 ++-- cmd/sonobuoy/app/run_test.go | 42 ++++++++++++++++++------------------ site/docs/master/faq.md | 4 ++-- site/docs/v0.16.5/faq.md | 4 ++-- site/docs/v0.17.0/faq.md | 4 ++-- site/docs/v0.17.1/faq.md | 4 ++-- site/docs/v0.17.2/faq.md | 4 ++-- site/docs/v0.18.0/faq.md | 4 ++-- site/docs/v0.18.1/faq.md | 4 ++-- site/docs/v0.18.2/faq.md | 4 ++-- site/docs/v0.18.3/faq.md | 4 ++-- 11 files changed, 41 insertions(+), 41 deletions(-) diff --git a/cmd/sonobuoy/app/run.go b/cmd/sonobuoy/app/run.go index 3ef83e4cf..0d1d0f951 100644 --- a/cmd/sonobuoy/app/run.go +++ b/cmd/sonobuoy/app/run.go @@ -80,13 +80,13 @@ func (r *runFlags) Config() (*client.RunConfig, error) { return runcfg, nil } -func givenAnyGenConfigFlags(gf *genFlags, whitelistFlagNames []string) bool { +func givenAnyGenConfigFlags(gf *genFlags, allowedFlagNames []string) bool { changed := false gf.genflags.Visit(func(f *pflag.Flag) { if changed { return } - if f.Changed && !stringInList(whitelistFlagNames, f.Name) { + if f.Changed && !stringInList(allowedFlagNames, f.Name) { changed = true } }) diff --git a/cmd/sonobuoy/app/run_test.go b/cmd/sonobuoy/app/run_test.go index 87e0c1681..5faf66b75 100644 --- a/cmd/sonobuoy/app/run_test.go +++ b/cmd/sonobuoy/app/run_test.go @@ -31,36 +31,36 @@ func TestGivenAnyGenConfigFlags(t *testing.T) { } testCases := []struct { - desc string - inFlags *genFlags - whitelist []string - expect bool + desc string + inFlags *genFlags + allowedFlags []string + expect bool }{ { - desc: "Nothing changed return true", - inFlags: getSampleFlagsWithChanged(nil), - whitelist: []string{}, - expect: false, + desc: "Nothing changed return true", + inFlags: getSampleFlagsWithChanged(nil), + allowedFlags: []string{}, + expect: false, }, { - desc: "One changed flag return true", - inFlags: getSampleFlagsWithChanged([]string{"kubeconfig"}), - whitelist: []string{}, - expect: true, + desc: "One changed flag return true", + inFlags: getSampleFlagsWithChanged([]string{"kubeconfig"}), + allowedFlags: []string{}, + expect: true, }, { - desc: "One changed flag return false if in whitelist", - inFlags: getSampleFlagsWithChanged([]string{"kubeconfig"}), - whitelist: []string{"kubeconfig"}, - expect: false, + desc: "One changed flag return false if in allowed list", + inFlags: getSampleFlagsWithChanged([]string{"kubeconfig"}), + allowedFlags: []string{"kubeconfig"}, + expect: false, }, { - desc: "One changed flag return true if not in whitelist", - inFlags: getSampleFlagsWithChanged([]string{"e2e-focus"}), - whitelist: []string{"flaga", "flagb", "flagc"}, - expect: true, + desc: "One changed flag return true if not in allowed list", + inFlags: getSampleFlagsWithChanged([]string{"e2e-focus"}), + allowedFlags: []string{"flaga", "flagb", "flagc"}, + expect: true, }, } for _, tc := range testCases { t.Run(tc.desc, func(t *testing.T) { - out := givenAnyGenConfigFlags(tc.inFlags, tc.whitelist) + out := givenAnyGenConfigFlags(tc.inFlags, tc.allowedFlags) if out != tc.expect { t.Errorf("Expected %v but got %v", tc.expect, out) } diff --git a/site/docs/master/faq.md b/site/docs/master/faq.md index 7c39c06ea..d3234ed58 100644 --- a/site/docs/master/faq.md +++ b/site/docs/master/faq.md @@ -90,9 +90,9 @@ One of the checks that it runs, is checking that all of the nodes are schedulabl This check deems any nodes with a taint other than the master node taint (`node-role.kubernetes.io/master`) to be unschedulable. This means that any node with a different taint will not be considered ready for testing and will block the tests from starting. -With the release of Kubernetes v1.17.0, you will be able to whitelist node taints so that any node with a whitelisted taint will be deemed schedulable as part of the pre-test checks. +With the release of Kubernetes v1.17.0, you will be able to provide a list of allowed node taints so that any node with an allowed taint will be deemed schedulable as part of the pre-test checks. This will ensure that these nodes will not block the tests from starting. -If you are running Kubernetes v1.17.0 or greater, you will be able to specify the taints to whitelist using the flag `--non-blocking-taints` which takes a comma-separated list of taints. +If you are running Kubernetes v1.17.0 or greater, you will be able to specify the taints to allow using the flag `--non-blocking-taints` which takes a comma-separated list of taints. To find out how to set this flag via Sonobuoy, please refer to our previous answer on how to set test framework options. This solution does not enable workloads created by the tests to run on these nodes. diff --git a/site/docs/v0.16.5/faq.md b/site/docs/v0.16.5/faq.md index 7c39c06ea..d3234ed58 100644 --- a/site/docs/v0.16.5/faq.md +++ b/site/docs/v0.16.5/faq.md @@ -90,9 +90,9 @@ One of the checks that it runs, is checking that all of the nodes are schedulabl This check deems any nodes with a taint other than the master node taint (`node-role.kubernetes.io/master`) to be unschedulable. This means that any node with a different taint will not be considered ready for testing and will block the tests from starting. -With the release of Kubernetes v1.17.0, you will be able to whitelist node taints so that any node with a whitelisted taint will be deemed schedulable as part of the pre-test checks. +With the release of Kubernetes v1.17.0, you will be able to provide a list of allowed node taints so that any node with an allowed taint will be deemed schedulable as part of the pre-test checks. This will ensure that these nodes will not block the tests from starting. -If you are running Kubernetes v1.17.0 or greater, you will be able to specify the taints to whitelist using the flag `--non-blocking-taints` which takes a comma-separated list of taints. +If you are running Kubernetes v1.17.0 or greater, you will be able to specify the taints to allow using the flag `--non-blocking-taints` which takes a comma-separated list of taints. To find out how to set this flag via Sonobuoy, please refer to our previous answer on how to set test framework options. This solution does not enable workloads created by the tests to run on these nodes. diff --git a/site/docs/v0.17.0/faq.md b/site/docs/v0.17.0/faq.md index 7c39c06ea..d3234ed58 100644 --- a/site/docs/v0.17.0/faq.md +++ b/site/docs/v0.17.0/faq.md @@ -90,9 +90,9 @@ One of the checks that it runs, is checking that all of the nodes are schedulabl This check deems any nodes with a taint other than the master node taint (`node-role.kubernetes.io/master`) to be unschedulable. This means that any node with a different taint will not be considered ready for testing and will block the tests from starting. -With the release of Kubernetes v1.17.0, you will be able to whitelist node taints so that any node with a whitelisted taint will be deemed schedulable as part of the pre-test checks. +With the release of Kubernetes v1.17.0, you will be able to provide a list of allowed node taints so that any node with an allowed taint will be deemed schedulable as part of the pre-test checks. This will ensure that these nodes will not block the tests from starting. -If you are running Kubernetes v1.17.0 or greater, you will be able to specify the taints to whitelist using the flag `--non-blocking-taints` which takes a comma-separated list of taints. +If you are running Kubernetes v1.17.0 or greater, you will be able to specify the taints to allow using the flag `--non-blocking-taints` which takes a comma-separated list of taints. To find out how to set this flag via Sonobuoy, please refer to our previous answer on how to set test framework options. This solution does not enable workloads created by the tests to run on these nodes. diff --git a/site/docs/v0.17.1/faq.md b/site/docs/v0.17.1/faq.md index 7c39c06ea..d3234ed58 100644 --- a/site/docs/v0.17.1/faq.md +++ b/site/docs/v0.17.1/faq.md @@ -90,9 +90,9 @@ One of the checks that it runs, is checking that all of the nodes are schedulabl This check deems any nodes with a taint other than the master node taint (`node-role.kubernetes.io/master`) to be unschedulable. This means that any node with a different taint will not be considered ready for testing and will block the tests from starting. -With the release of Kubernetes v1.17.0, you will be able to whitelist node taints so that any node with a whitelisted taint will be deemed schedulable as part of the pre-test checks. +With the release of Kubernetes v1.17.0, you will be able to provide a list of allowed node taints so that any node with an allowed taint will be deemed schedulable as part of the pre-test checks. This will ensure that these nodes will not block the tests from starting. -If you are running Kubernetes v1.17.0 or greater, you will be able to specify the taints to whitelist using the flag `--non-blocking-taints` which takes a comma-separated list of taints. +If you are running Kubernetes v1.17.0 or greater, you will be able to specify the taints to allow using the flag `--non-blocking-taints` which takes a comma-separated list of taints. To find out how to set this flag via Sonobuoy, please refer to our previous answer on how to set test framework options. This solution does not enable workloads created by the tests to run on these nodes. diff --git a/site/docs/v0.17.2/faq.md b/site/docs/v0.17.2/faq.md index 7c39c06ea..d3234ed58 100644 --- a/site/docs/v0.17.2/faq.md +++ b/site/docs/v0.17.2/faq.md @@ -90,9 +90,9 @@ One of the checks that it runs, is checking that all of the nodes are schedulabl This check deems any nodes with a taint other than the master node taint (`node-role.kubernetes.io/master`) to be unschedulable. This means that any node with a different taint will not be considered ready for testing and will block the tests from starting. -With the release of Kubernetes v1.17.0, you will be able to whitelist node taints so that any node with a whitelisted taint will be deemed schedulable as part of the pre-test checks. +With the release of Kubernetes v1.17.0, you will be able to provide a list of allowed node taints so that any node with an allowed taint will be deemed schedulable as part of the pre-test checks. This will ensure that these nodes will not block the tests from starting. -If you are running Kubernetes v1.17.0 or greater, you will be able to specify the taints to whitelist using the flag `--non-blocking-taints` which takes a comma-separated list of taints. +If you are running Kubernetes v1.17.0 or greater, you will be able to specify the taints to allow using the flag `--non-blocking-taints` which takes a comma-separated list of taints. To find out how to set this flag via Sonobuoy, please refer to our previous answer on how to set test framework options. This solution does not enable workloads created by the tests to run on these nodes. diff --git a/site/docs/v0.18.0/faq.md b/site/docs/v0.18.0/faq.md index 7c39c06ea..d3234ed58 100644 --- a/site/docs/v0.18.0/faq.md +++ b/site/docs/v0.18.0/faq.md @@ -90,9 +90,9 @@ One of the checks that it runs, is checking that all of the nodes are schedulabl This check deems any nodes with a taint other than the master node taint (`node-role.kubernetes.io/master`) to be unschedulable. This means that any node with a different taint will not be considered ready for testing and will block the tests from starting. -With the release of Kubernetes v1.17.0, you will be able to whitelist node taints so that any node with a whitelisted taint will be deemed schedulable as part of the pre-test checks. +With the release of Kubernetes v1.17.0, you will be able to provide a list of allowed node taints so that any node with an allowed taint will be deemed schedulable as part of the pre-test checks. This will ensure that these nodes will not block the tests from starting. -If you are running Kubernetes v1.17.0 or greater, you will be able to specify the taints to whitelist using the flag `--non-blocking-taints` which takes a comma-separated list of taints. +If you are running Kubernetes v1.17.0 or greater, you will be able to specify the taints to allow using the flag `--non-blocking-taints` which takes a comma-separated list of taints. To find out how to set this flag via Sonobuoy, please refer to our previous answer on how to set test framework options. This solution does not enable workloads created by the tests to run on these nodes. diff --git a/site/docs/v0.18.1/faq.md b/site/docs/v0.18.1/faq.md index 7c39c06ea..d3234ed58 100644 --- a/site/docs/v0.18.1/faq.md +++ b/site/docs/v0.18.1/faq.md @@ -90,9 +90,9 @@ One of the checks that it runs, is checking that all of the nodes are schedulabl This check deems any nodes with a taint other than the master node taint (`node-role.kubernetes.io/master`) to be unschedulable. This means that any node with a different taint will not be considered ready for testing and will block the tests from starting. -With the release of Kubernetes v1.17.0, you will be able to whitelist node taints so that any node with a whitelisted taint will be deemed schedulable as part of the pre-test checks. +With the release of Kubernetes v1.17.0, you will be able to provide a list of allowed node taints so that any node with an allowed taint will be deemed schedulable as part of the pre-test checks. This will ensure that these nodes will not block the tests from starting. -If you are running Kubernetes v1.17.0 or greater, you will be able to specify the taints to whitelist using the flag `--non-blocking-taints` which takes a comma-separated list of taints. +If you are running Kubernetes v1.17.0 or greater, you will be able to specify the taints to allow using the flag `--non-blocking-taints` which takes a comma-separated list of taints. To find out how to set this flag via Sonobuoy, please refer to our previous answer on how to set test framework options. This solution does not enable workloads created by the tests to run on these nodes. diff --git a/site/docs/v0.18.2/faq.md b/site/docs/v0.18.2/faq.md index 7c39c06ea..d3234ed58 100644 --- a/site/docs/v0.18.2/faq.md +++ b/site/docs/v0.18.2/faq.md @@ -90,9 +90,9 @@ One of the checks that it runs, is checking that all of the nodes are schedulabl This check deems any nodes with a taint other than the master node taint (`node-role.kubernetes.io/master`) to be unschedulable. This means that any node with a different taint will not be considered ready for testing and will block the tests from starting. -With the release of Kubernetes v1.17.0, you will be able to whitelist node taints so that any node with a whitelisted taint will be deemed schedulable as part of the pre-test checks. +With the release of Kubernetes v1.17.0, you will be able to provide a list of allowed node taints so that any node with an allowed taint will be deemed schedulable as part of the pre-test checks. This will ensure that these nodes will not block the tests from starting. -If you are running Kubernetes v1.17.0 or greater, you will be able to specify the taints to whitelist using the flag `--non-blocking-taints` which takes a comma-separated list of taints. +If you are running Kubernetes v1.17.0 or greater, you will be able to specify the taints to allow using the flag `--non-blocking-taints` which takes a comma-separated list of taints. To find out how to set this flag via Sonobuoy, please refer to our previous answer on how to set test framework options. This solution does not enable workloads created by the tests to run on these nodes. diff --git a/site/docs/v0.18.3/faq.md b/site/docs/v0.18.3/faq.md index 7c39c06ea..d3234ed58 100644 --- a/site/docs/v0.18.3/faq.md +++ b/site/docs/v0.18.3/faq.md @@ -90,9 +90,9 @@ One of the checks that it runs, is checking that all of the nodes are schedulabl This check deems any nodes with a taint other than the master node taint (`node-role.kubernetes.io/master`) to be unschedulable. This means that any node with a different taint will not be considered ready for testing and will block the tests from starting. -With the release of Kubernetes v1.17.0, you will be able to whitelist node taints so that any node with a whitelisted taint will be deemed schedulable as part of the pre-test checks. +With the release of Kubernetes v1.17.0, you will be able to provide a list of allowed node taints so that any node with an allowed taint will be deemed schedulable as part of the pre-test checks. This will ensure that these nodes will not block the tests from starting. -If you are running Kubernetes v1.17.0 or greater, you will be able to specify the taints to whitelist using the flag `--non-blocking-taints` which takes a comma-separated list of taints. +If you are running Kubernetes v1.17.0 or greater, you will be able to specify the taints to allow using the flag `--non-blocking-taints` which takes a comma-separated list of taints. To find out how to set this flag via Sonobuoy, please refer to our previous answer on how to set test framework options. This solution does not enable workloads created by the tests to run on these nodes.