From bada2cd70545a2b10bb3cf72045066fc7d9640ed Mon Sep 17 00:00:00 2001 From: Aaron Hurley Date: Wed, 16 Nov 2022 15:30:18 -0600 Subject: [PATCH] Introduce inclusive naming check and update existing language We are following the Inclusive Naming Initiative's guidance as that is what the CNCF supports. --- .../workflows/inclusive-language-check.yml | 19 ++++++++++++++++++ .wokeignore | 3 +++ examples/cf-for-k8s-v0.2.0-custom/config.yml | 4 ++-- examples/gitops/guestbook/all-in-one.yml | 2 +- examples/istio-v1.4.0/istio.yml | 2 +- pkg/kapp/clusterapply/applying_changes.go | 2 +- pkg/kapp/diffgraph/assets/cf-for-k8s.yml | 6 +++--- .../ignore_failing_api_services_flag_test.go | 20 +++++++++---------- 8 files changed, 40 insertions(+), 18 deletions(-) create mode 100644 .github/workflows/inclusive-language-check.yml create mode 100644 .wokeignore diff --git a/.github/workflows/inclusive-language-check.yml b/.github/workflows/inclusive-language-check.yml new file mode 100644 index 000000000..3c7928997 --- /dev/null +++ b/.github/workflows/inclusive-language-check.yml @@ -0,0 +1,19 @@ +--- +name: Check inclusive language + +on: + pull_request: + types: ['opened'] + +jobs: + check-inclusive-language: + name: Check inclusive language + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: '0' + - name: woke + run: | + curl -sSfL https://git.io/getwoke | bash -s -- -b /usr/local/bin + woke -c https://inclusivenaming.org/word-lists/index.json -o github-actions --exit-1-on-failure diff --git a/.wokeignore b/.wokeignore new file mode 100644 index 000000000..9259501c1 --- /dev/null +++ b/.wokeignore @@ -0,0 +1,3 @@ +# out of our control +vendor/ +examples/resource-ordering/README.md diff --git a/examples/cf-for-k8s-v0.2.0-custom/config.yml b/examples/cf-for-k8s-v0.2.0-custom/config.yml index 1ee3c18d1..12d83e440 100644 --- a/examples/cf-for-k8s-v0.2.0-custom/config.yml +++ b/examples/cf-for-k8s-v0.2.0-custom/config.yml @@ -10777,7 +10777,7 @@ data: require_client_certificate: true - # Manual 'whitebox' mode + # Manual 'open-box' mode - name: "local.15019" address: socket_address: @@ -14144,7 +14144,7 @@ data: url: https://uaa.cf.cppforlife.io/authenticate limitedFunctionality: enabled: false - whitelist: + whitelist: # wokeignore:rule=whitelist endpoints: - /oauth/authorize/** - /oauth/token/** diff --git a/examples/gitops/guestbook/all-in-one.yml b/examples/gitops/guestbook/all-in-one.yml index 583c27cae..e90e21d77 100644 --- a/examples/gitops/guestbook/all-in-one.yml +++ b/examples/gitops/guestbook/all-in-one.yml @@ -87,7 +87,7 @@ spec: spec: containers: - name: replica - image: gcr.io/google_samples/gb-redisslave:v1 + image: gcr.io/google_samples/gb-redisslave:v1 # wokeignore:rule=slave resources: requests: cpu: 100m diff --git a/examples/istio-v1.4.0/istio.yml b/examples/istio-v1.4.0/istio.yml index 4fce26ecc..53677625f 100644 --- a/examples/istio-v1.4.0/istio.yml +++ b/examples/istio-v1.4.0/istio.yml @@ -7283,7 +7283,7 @@ data: filename: /etc/certs/key.pem - # Manual 'whitebox' mode + # Manual 'open-box' mode - name: "local.15019" address: socket_address: diff --git a/pkg/kapp/clusterapply/applying_changes.go b/pkg/kapp/clusterapply/applying_changes.go index b240deecf..18e9bb1e6 100644 --- a/pkg/kapp/clusterapply/applying_changes.go +++ b/pkg/kapp/clusterapply/applying_changes.go @@ -118,7 +118,7 @@ func (c *ApplyingChanges) Apply(allChanges []*ctldgraph.Change) ([]WaitingChange } func (c *ApplyingChanges) Complete() error { - // Sanity check that we applied all changes + // Confidence check that we applied all changes if c.numTotal != c.numApplied() { return fmt.Errorf("Internal inconsistency: did not apply all changes: %d != %d", c.numTotal, c.numApplied()) diff --git a/pkg/kapp/diffgraph/assets/cf-for-k8s.yml b/pkg/kapp/diffgraph/assets/cf-for-k8s.yml index fa04d3dc0..3a8d28207 100644 --- a/pkg/kapp/diffgraph/assets/cf-for-k8s.yml +++ b/pkg/kapp/diffgraph/assets/cf-for-k8s.yml @@ -1,5 +1,5 @@ # This file was generated from github.com/cloudfoundry/cf-for-k8s@bb1b88a0c22eb265378258b0f0a65eead00b94de -# with bunch of dummy secrets. It's used as a complex test fixture for testing ordering. +# with bunch of placeholder secrets. It's used as a complex test fixture for testing ordering. apiVersion: apps/v1 kind: Deployment @@ -10484,7 +10484,7 @@ data: require_client_certificate: true - # Manual 'whitebox' mode + # Manual 'open-box' mode - name: "local.15019" address: socket_address: @@ -13851,7 +13851,7 @@ data: url: https://uaa.cf.cppforlife.io/authenticate limitedFunctionality: enabled: false - whitelist: + whitelist: # wokeignore:rule=whitelist endpoints: - /oauth/authorize/** - /oauth/token/** diff --git a/test/e2e/ignore_failing_api_services_flag_test.go b/test/e2e/ignore_failing_api_services_flag_test.go index cb0a0c8b9..5d0831416 100644 --- a/test/e2e/ignore_failing_api_services_flag_test.go +++ b/test/e2e/ignore_failing_api_services_flag_test.go @@ -21,12 +21,12 @@ func TestIgnoreFailingAPIServices(t *testing.T) { apiVersion: apiregistration.k8s.io/v1 kind: APIService metadata: - name: v1.dummykapptest.com + name: v1.samplekapptest.com annotations: kapp.k14s.io/disable-default-change-group-and-rules: "" kapp.k14s.io/change-group: "apiservice" spec: - group: dummykapptest.com + group: samplekapptest.com groupPriorityMinimum: 100 insecureSkipTLSVerify: true service: @@ -38,12 +38,12 @@ spec: apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: - name: foo.dummykapptest.com + name: foo.samplekapptest.com annotations: kapp.k14s.io/disable-default-change-group-and-rules: "" kapp.k14s.io/change-rule: "upsert after upserting apiservice" spec: - group: dummykapptest.com + group: samplekapptest.com versions: - name: v1 served: true @@ -77,7 +77,7 @@ metadata: yaml3 := ` --- -apiVersion: dummykapptest.com/v1 +apiVersion: samplekapptest.com/v1 kind: Foo metadata: name: test-uses-failing-api-service @@ -129,7 +129,7 @@ metadata: AllowError: true, IntoNs: true, StdinReader: strings.NewReader(yaml3)}) require.Errorf(t, err, "Expected error when deploying with failing api service") - require.Contains(t, err.Error(), "unable to retrieve the complete list of server APIs: dummykapptest.com/v1: the server is currently unable to handle the request", + require.Contains(t, err.Error(), "unable to retrieve the complete list of server APIs: samplekapptest.com/v1: the server is currently unable to handle the request", "Expected api retrieval error") }) @@ -140,7 +140,7 @@ metadata: AllowError: true, IntoNs: true, StdinReader: strings.NewReader(yaml3)}) require.Errorf(t, err, "Expected error when deploying with failing api service") - require.Contains(t, err.Error(), "Expected to find kind 'dummykapptest.com/v1/Foo', but did not", "Expected CRD retrieval error") + require.Contains(t, err.Error(), "Expected to find kind 'samplekapptest.com/v1/Foo', but did not", "Expected CRD retrieval error") }) logger.Section("delete app that does not use api service", func() { @@ -162,9 +162,9 @@ func TestIgnoreFailingGroupVersion(t *testing.T) { apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: - name: foo.dummykapptest.com + name: foo.samplekapptest.com spec: - group: dummykapptest.com + group: samplekapptest.com versions: # v1 is available and used for internal storage - name: v1 @@ -225,7 +225,7 @@ metadata: yaml3 := ` --- -apiVersion: dummykapptest.com/v2 +apiVersion: samplekapptest.com/v2 kind: Foo metadata: name: test-uses-failing-group-version