Skip to content

Commit

Permalink
chore: bump up kind for k8s v1.31 (#2318)
Browse files Browse the repository at this point in the history
* chore: bump up kind for k8s v1.31

* chore: bump up setup-kind to v0.6.2

* test: remove deprecated k8s API

* chore: add report in the failure log

* chore: increase timeout for building cluster report

* fix: add newlines

* chore: update copmuted hash for k8s v1.31.0

* chore: remove reports printing for debug

* test: looking for a name in ClusterVulnerabilityReport
  • Loading branch information
afdesk authored Nov 22, 2024
1 parent d9a4692 commit d4da6e5
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 14 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ on:
- LICENSE
- NOTICE
env:
KIND_VERSION: v0.17.0
KIND_IMAGE: kindest/node:v1.21.1@sha256:69860bda5563ac81e3c0057d654b5253219618a22ec3a346306239bba8cfa1a6
KIND_VERSION: v0.24.0
KIND_IMAGE: kindest/node:v1.31.2
GO_VERSION: '1.22'
permissions: {}
concurrency:
Expand Down Expand Up @@ -120,7 +120,7 @@ jobs:
with:
aqua_version: v1.25.0
- name: Setup Kubernetes cluster (KIND)
uses: engineerd/setup-kind@v0.5.0
uses: engineerd/setup-kind@v0.6.2
with:
version: ${{ env.KIND_VERSION }}
image: ${{ env.KIND_IMAGE }}
Expand Down
12 changes: 6 additions & 6 deletions tests/e2e/cluster/workload/00-assert.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
apiVersion: kuttl.dev/v1beta1
commands:
- script: >
cnt="$(kubectl get clustervulnerabilityreports.aquasecurity.github.io clustersbomreport-557764dbc-k8s-cluster \
-o=jsonpath='{.report.summary.highCount}')"
if [ $cnt -gt 0 ]
name="$(kubectl get clustervulnerabilityreports.aquasecurity.github.io clustersbomreport-6789697bc-k8s-cluster \
-o=jsonpath='{.metadata.name}')"
if [ $name = "clustersbomreport-6789697bc-k8s-cluster" ]
then
echo "Pass: ClusterVulnerabilityReport highCount ($cnt) is greater than 0"
echo "Pass: ClusterVulnerabilityReport was created successfully"
else
echo "Fail: ClusterVulnerabilityReport highCount ($cnt) should be greater than 0"
echo "Fail: ClusterVulnerabilityReport name doesn't exist"
exit 1
fi
kind: TestAssert
timeout: 120
timeout: 240
9 changes: 4 additions & 5 deletions tests/itest/trivy-operator/behavior/behavior.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import (
"github.com/aquasecurity/trivy-operator/tests/itest/helper"
appsv1 "k8s.io/api/apps/v1"
batchv1 "k8s.io/api/batch/v1"
batchv1beta1 "k8s.io/api/batch/v1beta1"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/util/intstr"
Expand Down Expand Up @@ -324,18 +323,18 @@ func ConfigurationCheckerBehavior(inputs *Inputs) func() {
Context("When CronJob is created", func() {

var ctx context.Context
var cronJob *batchv1beta1.CronJob
var cronJob *batchv1.CronJob

BeforeEach(func() {
ctx = context.Background()
cronJob = &batchv1beta1.CronJob{
cronJob = &batchv1.CronJob{
ObjectMeta: metav1.ObjectMeta{
Namespace: inputs.PrimaryNamespace,
Name: "hello-" + rand.String(5),
},
Spec: batchv1beta1.CronJobSpec{
Spec: batchv1.CronJobSpec{
Schedule: "*/1 * * * *",
JobTemplate: batchv1beta1.JobTemplateSpec{
JobTemplate: batchv1.JobTemplateSpec{
Spec: batchv1.JobSpec{
Template: corev1.PodTemplateSpec{
Spec: corev1.PodSpec{
Expand Down

0 comments on commit d4da6e5

Please sign in to comment.