Skip to content

Commit c89fdea

Browse files
fix: Include pkg/ in Docker build and drop envtest-only controller suite
Copy pkg/features into the container build context and replace the ginkgo envtest scaffold with a unit test so go test works without kubebuilder.
1 parent 3dd837e commit c89fdea

3 files changed

Lines changed: 15 additions & 114 deletions

File tree

Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ RUN go mod download
1414
# Copy the go source
1515
COPY cmd/ cmd/
1616
COPY internal/ internal/
17+
COPY pkg/ pkg/
1718

1819
# Build
1920
# the GOARCH has not a default value to allow the binary be built according to the host where the command

internal/controller/resourcemanager/personal_organization_controller_test.go

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,18 @@
22

33
package resourcemanager
44

5-
import (
6-
. "github.com/onsi/ginkgo/v2"
7-
)
5+
import "testing"
86

9-
var _ = Describe("User Controller", func() {
10-
Context("When reconciling a resource", func() {
11-
12-
It("should successfully reconcile the resource", func() {
13-
14-
// TODO(user): Add more specific assertions depending on your controller's reconciliation logic.
15-
// Example: If you expect a certain status condition after reconciliation, verify it here.
16-
})
17-
})
18-
})
7+
func TestHashPersonalOrgName(t *testing.T) {
8+
first := hashPersonalOrgName("uid-123")
9+
second := hashPersonalOrgName("uid-123")
10+
if first != second {
11+
t.Fatalf("hashPersonalOrgName() not stable: %q vs %q", first, second)
12+
}
13+
if first == "" {
14+
t.Fatal("hashPersonalOrgName() returned empty string")
15+
}
16+
if hashPersonalOrgName("uid-456") == first {
17+
t.Fatal("hashPersonalOrgName() returned same value for different inputs")
18+
}
19+
}

internal/controller/resourcemanager/suite_test.go

Lines changed: 0 additions & 101 deletions
This file was deleted.

0 commit comments

Comments
 (0)