Skip to content
This repository has been archived by the owner on Oct 30, 2024. It is now read-only.

🐛 bump KinD k8s node image version to 1.20 #426

Merged
merged 3 commits into from
Jun 6, 2022
Merged

Conversation

jerr
Copy link
Contributor

@jerr jerr commented May 23, 2022

Description

The current 1.15 KinD node version is no longer supported by KinD. The Kubernetes 1.20 version is still in use, so we can use it as a reference version for the tests.

The node image used is the last available on the KinD releases page for the version 1.20.

The no longer supported APIs have been removed from the tests.

  • Deployment

    The extensions/v1beta1, apps/v1beta1, and apps/v1beta2 API versions of Deployment are no longer served as of v1.16.

  • DaemonSet

    The extensions/v1beta1 and apps/v1beta2 API versions of DaemonSet are no longer served as of v1.16.

  • StatefulSet

    The apps/v1beta1 and apps/v1beta2 API versions of StatefulSet are no longer served as of v1.16.

Type of change
  • Bug fix 🐛
How Has This Been Tested?

The tests with KinD are fixed

$  make test
./test.sh
Starting tests. This may take a while...
kind create cluster --name "kubeaudit-test" --image kindest/node:v1.20.15@sha256:6f2d011dffe182bad80b85f6c00e8ca9d86b5b8922cdf433d53575c4c5212248
Creating cluster "kubeaudit-test" ...
 ✓ Ensuring node image (kindest/node:v1.20.15) 🖼 
 ✓ Preparing nodes 📦  
 ✓ Writing configuration 📜 
 ✓ Starting control-plane 🕹️ 
 ✓ Installing CNI 🔌 
 ✓ Installing StorageClass 💾 
Set kubectl context to "kind-kubeaudit-test"
You can now use your cluster with:

kubectl cluster-info --context kind-kubeaudit-test

Not sure what to do next? 😅  Check out https://kind.sigs.k8s.io/docs/user/quick-start/
ok      github.com/Shopify/kubeaudit    1.205s  coverage: 71.6% of statements
ok      github.com/Shopify/kubeaudit/auditors/all       41.944s coverage: 92.6% of statements
ok      github.com/Shopify/kubeaudit/auditors/apparmor  28.490s coverage: 100.0% of statements
ok      github.com/Shopify/kubeaudit/auditors/asat      29.642s coverage: 100.0% of statements
ok      github.com/Shopify/kubeaudit/auditors/capabilities      40.169s coverage: 94.8% of statements
ok      github.com/Shopify/kubeaudit/auditors/hostns    39.672s coverage: 92.1% of statements
ok      github.com/Shopify/kubeaudit/auditors/image     28.505s coverage: 96.4% of statements
ok      github.com/Shopify/kubeaudit/auditors/limits    29.404s coverage: 98.6% of statements
ok      github.com/Shopify/kubeaudit/auditors/mounts    119.239s        coverage: 89.2% of statements
ok      github.com/Shopify/kubeaudit/auditors/netpols   7.718s  coverage: 90.4% of statements
ok      github.com/Shopify/kubeaudit/auditors/nonroot   89.861s coverage: 95.7% of statements
ok      github.com/Shopify/kubeaudit/auditors/privesc   28.856s coverage: 100.0% of statements
ok      github.com/Shopify/kubeaudit/auditors/privileged        28.817s coverage: 95.5% of statements
ok      github.com/Shopify/kubeaudit/auditors/rootfs    28.788s coverage: 95.5% of statements
ok      github.com/Shopify/kubeaudit/auditors/seccomp   29.277s coverage: 100.0% of statements
?       github.com/Shopify/kubeaudit/cmd        [no test files]
?       github.com/Shopify/kubeaudit/cmd/commands       [no test files]
ok      github.com/Shopify/kubeaudit/config     0.555s  coverage: 57.1% of statements
?       github.com/Shopify/kubeaudit/internal/color     [no test files]
ok      github.com/Shopify/kubeaudit/internal/k8sinternal       30.010s coverage: 85.7% of statements
?       github.com/Shopify/kubeaudit/internal/test      [no test files]
ok      github.com/Shopify/kubeaudit/internal/yaml      0.712s  coverage: 89.0% of statements
ok      github.com/Shopify/kubeaudit/pkg/fix    0.589s  coverage: 94.4% of statements
?       github.com/Shopify/kubeaudit/pkg/k8s    [no test files]
?       github.com/Shopify/kubeaudit/pkg/override       [no test files]
kind delete cluster --name "kubeaudit-test"
Deleting cluster "kubeaudit-test" ...
Checklist:
  • I have 🎩 my changes (A 🎩 specifically includes pulling down changes, setting them up, and manually testing the changed features and potential side effects to make sure nothing is broken)
  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • The test coverage did not decrease
  • I have signed the appropriate Contributor License Agreement

@ghost ghost added the config label May 23, 2022
@jerr jerr added the bug label May 23, 2022
@jerr jerr changed the title bump KinD k8s node image version to 1.20 🐛 bump KinD k8s node image version to 1.20 May 23, 2022
Copy link
Contributor

@genevieveluyt genevieveluyt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are we deleting internal/test/fixtures/all_resources/deployment-apps-v1.yml? apps/v1 seems to be the current version for deployments?

Copy link
Contributor

@dani-santos-code dani-santos-code left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hey @jerr ! thanks a bunch for your contribution and sorry for taking long to review it! great work. thanks for updating it and giving kubeaudit some love. It looks great. I have the same question as Genevieve: do we need to remove internal/test/fixtures/all_resources/deployment-apps-v1.yml since it's using apps/v1?

@jerr jerr merged commit 29fbf35 into main Jun 6, 2022
@jerr jerr deleted the bump_kind_node_1.20 branch June 6, 2022 16:46
@genevieveluyt genevieveluyt mentioned this pull request Jun 7, 2022
13 tasks
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants