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

🐛 waiting the approved csr if it is not found in integration test #188

Merged
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 build/Dockerfile.placement
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.20 AS builder
FROM golang:1.20-bullseye AS builder
ARG OS=linux
ARG ARCH=amd64
WORKDIR /go/src/open-cluster-management.io/ocm
Expand Down
2 changes: 1 addition & 1 deletion build/Dockerfile.registration
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.20 AS builder
FROM golang:1.20-bullseye AS builder
ARG OS=linux
ARG ARCH=amd64
WORKDIR /go/src/open-cluster-management.io/ocm
Expand Down
2 changes: 1 addition & 1 deletion build/Dockerfile.registration-operator
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.20 AS builder
FROM golang:1.20-bullseye AS builder
ARG OS=linux
ARG ARCH=amd64
WORKDIR /go/src/open-cluster-management.io/ocm
Expand Down
2 changes: 1 addition & 1 deletion build/Dockerfile.work
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.20 AS builder
FROM golang:1.20-bullseye AS builder
ARG OS=linux
ARG ARCH=amd64
WORKDIR /go/src/open-cluster-management.io/ocm
Expand Down
23 changes: 11 additions & 12 deletions test/integration/registration/spokecluster_autoapproval_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,22 +42,21 @@ var _ = ginkgo.Describe("Cluster Auto Approval", func() {
cancel := runAgent("autoapprovaltest", agentOptions, spokeCfg)
defer cancel()

gomega.Eventually(func() error {
if _, err := util.GetManagedCluster(clusterClient, managedClusterName); err != nil {
return err
// after bootstrap the spokecluster should be accepted and its csr should be auto approved
gomega.Eventually(func() bool {
cluster, err := util.GetManagedCluster(clusterClient, managedClusterName)
if err != nil {
return false
}
return nil
}, eventuallyTimeout, eventuallyInterval).ShouldNot(gomega.HaveOccurred())

return cluster.Spec.HubAcceptsClient
}, eventuallyTimeout, eventuallyInterval).Should(gomega.BeTrue())

var approvedCSR *certificates.CertificateSigningRequest
// after bootstrap the spokecluster csr should be auto approved
gomega.Eventually(func() error {
gomega.Eventually(func() bool {
approvedCSR, err = util.FindAutoApprovedSpokeCSR(kubeClient, managedClusterName)
if err != nil {
return err
}
return nil
}, eventuallyTimeout, eventuallyInterval).ShouldNot(gomega.HaveOccurred())
return err == nil
}, eventuallyTimeout, eventuallyInterval).Should(gomega.BeTrue())

// simulate hub cluster to fill a certificate
now := time.Now()
Expand Down