Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix dot import and update images #877

Merged
merged 2 commits into from
Oct 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ RUN CGO_ENABLED=1 GOOS=linux GO111MODULE=on go build -o manager main.go

# Use distroless as minimal base image to package the manager binary
# Refer to https://github.com/GoogleContainerTools/distroless for more details
FROM registry.access.redhat.com/ubi8/ubi-minimal:8.8-1072.1696517598
FROM registry.access.redhat.com/ubi8/ubi-minimal:8.8-1072.1697626218
WORKDIR /
COPY --from=builder /workspace/manager .
COPY --from=builder /workspace/manifest.yaml .
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.base
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Build the manager binary
FROM registry.access.redhat.com/ubi8/go-toolset:1.19.10-16.1696540524 as builder
FROM registry.access.redhat.com/ubi8/go-toolset:1.19.13-2.1697656138 as builder
USER 0
RUN dnf install -y openssh-clients git make which jq python3

Expand Down
28 changes: 14 additions & 14 deletions apis/cloud.redhat.com/v1alpha1/webhook_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import (
"time"

ginkgo "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
g "github.com/onsi/gomega"

admissionv1beta1 "k8s.io/api/admission/v1beta1"
//+kubebuilder:scaffold:imports
Expand All @@ -47,7 +47,7 @@ var ctx context.Context
var cancel context.CancelFunc

func TestAPIs(t *testing.T) {
RegisterFailHandler(ginkgo.Fail)
g.RegisterFailHandler(ginkgo.Fail)

ginkgo.RunSpecs(t,
"Webhook Suite",
Expand All @@ -69,21 +69,21 @@ var _ = ginkgo.BeforeSuite(func() {
}

cfg, err := testEnv.Start()
Expect(err).NotTo(HaveOccurred())
Expect(cfg).NotTo(BeNil())
g.Expect(err).NotTo(g.HaveOccurred())
g.Expect(cfg).NotTo(g.BeNil())

scheme := runtime.NewScheme()
err = AddToScheme(scheme)
Expect(err).NotTo(HaveOccurred())
g.Expect(err).NotTo(g.HaveOccurred())

err = admissionv1beta1.AddToScheme(scheme)
Expect(err).NotTo(HaveOccurred())
g.Expect(err).NotTo(g.HaveOccurred())

//+kubebuilder:scaffold:scheme

k8sClient, err = client.New(cfg, client.Options{Scheme: scheme})
Expect(err).NotTo(HaveOccurred())
Expect(k8sClient).NotTo(BeNil())
g.Expect(err).NotTo(g.HaveOccurred())
g.Expect(k8sClient).NotTo(g.BeNil())

// start webhook server using Manager
webhookInstallOptions := &testEnv.WebhookInstallOptions
Expand All @@ -95,37 +95,37 @@ var _ = ginkgo.BeforeSuite(func() {
LeaderElection: false,
MetricsBindAddress: "0",
})
Expect(err).NotTo(HaveOccurred())
g.Expect(err).NotTo(g.HaveOccurred())

err = (&ClowdApp{}).SetupWebhookWithManager(mgr)
Expect(err).NotTo(HaveOccurred())
g.Expect(err).NotTo(g.HaveOccurred())

//+kubebuilder:scaffold:webhook

go func() {
err = mgr.Start(ctx)
if err != nil {
Expect(err).NotTo(HaveOccurred())
g.Expect(err).NotTo(g.HaveOccurred())
}
}()

// wait for the webhook server to get ready
dialer := &net.Dialer{Timeout: time.Second}
addrPort := fmt.Sprintf("%s:%d", webhookInstallOptions.LocalServingHost, webhookInstallOptions.LocalServingPort)
Eventually(func() error {
g.Eventually(func() error {
conn, err := tls.DialWithDialer(dialer, "tcp", addrPort, &tls.Config{InsecureSkipVerify: true}) //nolint:gosec
if err != nil {
return err
}
conn.Close()
return nil
}).Should(Succeed())
}).Should(g.Succeed())

})

var _ = ginkgo.AfterSuite(func() {
cancel()
ginkgo.By("tearing down the test environment")
err := testEnv.Stop()
Expect(err).NotTo(HaveOccurred())
g.Expect(err).NotTo(g.HaveOccurred())
})
Loading