From 7508633373c87a1167128b0f73e47a5496297180 Mon Sep 17 00:00:00 2001 From: Carlos Eduardo Arango Gutierrez Date: Tue, 6 Aug 2024 11:36:17 +0200 Subject: [PATCH 1/2] Remove unused GHA Action Signed-off-by: Carlos Eduardo Arango Gutierrez --- Dockerfile | 27 --------------------------- Makefile | 2 +- action.yaml | 12 ------------ 3 files changed, 1 insertion(+), 40 deletions(-) delete mode 100644 Dockerfile delete mode 100644 action.yaml diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index 182aa698..00000000 --- a/Dockerfile +++ /dev/null @@ -1,27 +0,0 @@ -## Copyright (c) 2024, NVIDIA CORPORATION. All rights reserved.## -## Licensed under the Apache License, Version 2.0 (the "License"); -## you may not use this file except in compliance with the License. -## You may obtain a copy of the License at -## -## http://www.apache.org/licenses/LICENSE-2.0 -## -## Unless required by applicable law or agreed to in writing, software -## distributed under the License is distributed on an "AS IS" BASIS, -## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -## See the License for the specific language governing permissions and -## limitations under the License. -## - -FROM golang:1.22-bookworm - -WORKDIR /src -COPY . . - -RUN make build && \ - install -m 755 /src/bin/nv-ci-bot /usr/local/bin/nv-ci-bot - -RUN echo "nobody:x:65534:65534:Nobody:/:" >> /etc/passwd -# Run as unprivileged user -USER 65534:65534 - -ENTRYPOINT ["/usr/local/bin/nv-ci-bot","retitle"] diff --git a/Makefile b/Makefile index 7f37a363..bfe96842 100644 --- a/Makefile +++ b/Makefile @@ -49,4 +49,4 @@ vendor: go mod verify check-vendor: vendor - git diff --quiet HEAD -- go.mod go.sum vendor \ No newline at end of file + git diff --quiet HEAD -- go.mod go.sum vendor diff --git a/action.yaml b/action.yaml deleted file mode 100644 index 94ff2805..00000000 --- a/action.yaml +++ /dev/null @@ -1,12 +0,0 @@ -name: NV-CI-Bot -description: NV GitHub bot for CI/CD automation -inputs: - github-token: - description: "Token used by prow actions to accomplish jobs and tasks. May be a bot user access token or the limited scope Github token" - required: true -runs: - using: docker - image: Dockerfile -branding: - color: green - icon: cloud From 9274eea1335cc3782c5c2060ceb15c4d3a33b0ac Mon Sep 17 00:00:00 2001 From: Carlos Eduardo Arango Gutierrez Date: Tue, 6 Aug 2024 12:29:03 +0200 Subject: [PATCH 2/2] Add apiextensionsclientset to Framework struct Signed-off-by: Carlos Eduardo Arango Gutierrez --- go.mod | 2 +- pkg/framework/framework.go | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/go.mod b/go.mod index 76945d2e..a23cdc9c 100644 --- a/go.mod +++ b/go.mod @@ -7,6 +7,7 @@ require ( github.com/onsi/ginkgo/v2 v2.19.1 github.com/onsi/gomega v1.34.0 k8s.io/api v0.30.3 + k8s.io/apiextensions-apiserver v0.30.0 k8s.io/apimachinery v0.30.3 k8s.io/client-go v0.30.3 k8s.io/klog/v2 v2.130.1 @@ -139,7 +140,6 @@ require ( gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect helm.sh/helm/v3 v3.15.2 // indirect - k8s.io/apiextensions-apiserver v0.30.0 // indirect k8s.io/apiserver v0.30.0 // indirect k8s.io/cli-runtime v0.30.0 // indirect k8s.io/component-base v0.30.0 // indirect diff --git a/pkg/framework/framework.go b/pkg/framework/framework.go index c371a138..38cf0c75 100644 --- a/pkg/framework/framework.go +++ b/pkg/framework/framework.go @@ -35,6 +35,7 @@ import ( "github.com/onsi/ginkgo/v2" "github.com/onsi/gomega" corev1 "k8s.io/api/core/v1" + apiextensionsclientset "k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset" apierrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" @@ -73,6 +74,7 @@ type Framework struct { clientConfig *rest.Config ClientSet clientset.Interface + ApiExtClient *apiextensionsclientset.Clientset // Helm HelmClient helm.Client @@ -134,6 +136,10 @@ func (f *Framework) BeforeEach(ctx context.Context) { f.ClientSet, err = clientset.NewForConfig(config) gomega.Expect(err).NotTo(gomega.HaveOccurred()) + // Create an API extensions client + f.ApiExtClient, err = apiextensionsclientset.NewForConfig(config) + gomega.Expect(err).NotTo(gomega.HaveOccurred()) + if !f.SkipNamespaceCreation { ginkgo.By(fmt.Sprintf("Building a namespace with basename %s", f.BaseName)) namespace, err := f.CreateNamespace(ctx, f.BaseName, map[string]string{