Skip to content

Commit 8dc780b

Browse files
author
Per Goncalves da Silva
committed
Updates
Signed-off-by: Per Goncalves da Silva <[email protected]>
1 parent 62eb2d3 commit 8dc780b

35 files changed

+2428
-106
lines changed

Makefile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ TEST_OPERATOR_CONTROLLERS=v1.0.0 v2.0.0
251251

252252
.PHONY: $(TEST_OPERATOR_CONTROLLERS)
253253
$(TEST_OPERATOR_CONTROLLERS):
254-
go build $(GO_BUILD_FLAGS) $(GO_BUILD_EXTRA_FLAGS) -tags '$(GO_BUILD_TAGS)' -ldflags '$(GO_BUILD_LDFLAGS)' -gcflags '$(GO_BUILD_GCFLAGS)' -asmflags '$(GO_BUILD_ASMFLAGS)' -o ./testdata/images/controllers/test-operator/$@/manager ./test/test-operator/$@/cmd/main.go
254+
go build $(GO_BUILD_FLAGS) $(GO_BUILD_EXTRA_FLAGS) -tags '$(GO_BUILD_TAGS)' -ldflags '$(GO_BUILD_LDFLAGS)' -gcflags '$(GO_BUILD_GCFLAGS)' -asmflags '$(GO_BUILD_ASMFLAGS)' -o ./testdata/images/controllers/test-operator/$@/manager ./test/testdata/images/bundles/test-operator/$@/cmd/main.go
255255

256256
.PHONY: test-operator-controllers
257257
test-operator-controllers: $(TEST_OPERATOR_CONTROLLERS)
@@ -261,7 +261,6 @@ E2E_REGISTRY_IMAGE=localhost/e2e-test-registry:devel
261261
image-registry: export GOOS=linux
262262
image-registry: export GOARCH=amd64
263263
image-registry: $(TEST_OPERATOR_CONTROLLERS) ## Build the testdata catalog used for e2e tests and push it to the image registry
264-
go build $(GO_BUILD_FLAGS) $(GO_BUILD_EXTRA_FLAGS) -tags '$(GO_BUILD_TAGS)' -ldflags '$(GO_BUILD_LDFLAGS)' -gcflags '$(GO_BUILD_GCFLAGS)' -asmflags '$(GO_BUILD_ASMFLAGS)' -o ./testdata/registry/bin/registry ./testdata/registry/registry.go
265264
go build $(GO_BUILD_FLAGS) $(GO_BUILD_EXTRA_FLAGS) -tags '$(GO_BUILD_TAGS)' -ldflags '$(GO_BUILD_LDFLAGS)' -gcflags '$(GO_BUILD_GCFLAGS)' -asmflags '$(GO_BUILD_ASMFLAGS)' -o ./testdata/push/bin/push ./testdata/push/push.go
266265
$(CONTAINER_RUNTIME) build -f ./testdata/Dockerfile -t $(E2E_REGISTRY_IMAGE) ./testdata
267266
$(CONTAINER_RUNTIME) save $(E2E_REGISTRY_IMAGE) | $(KIND) load image-archive /dev/stdin --name $(KIND_CLUSTER_NAME)

testdata/.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
push/bin
2-
registry/bin
2+
images/controllers/*

testdata/Dockerfile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ FROM gcr.io/distroless/static:nonroot
22

33
WORKDIR /
44

5-
COPY registry/bin/registry registry
65
COPY push/bin/push push
76

87
COPY images images
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
/*
2+
Copyright 2025.
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
*/
16+
17+
// Package v1 contains API Schema definitions for the testolm v1 API group.
18+
// +kubebuilder:object:generate=false
19+
// +groupName=testolm.operatorframework.io
20+
package v1
21+
22+
import (
23+
"k8s.io/apimachinery/pkg/runtime/schema"
24+
"sigs.k8s.io/controller-runtime/pkg/scheme"
25+
)
26+
27+
var (
28+
// GroupVersion is group version used to register these objects.
29+
GroupVersion = schema.GroupVersion{Group: "testolm.operatorframework.io", Version: "v1"}
30+
31+
// SchemeBuilder is used to add go types to the GroupVersionKind scheme.
32+
SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion}
33+
34+
// AddToScheme adds the types in this group-version to the given scheme.
35+
AddToScheme = SchemeBuilder.AddToScheme
36+
)
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
/*
2+
Copyright 2025.
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
*/
16+
17+
package v1
18+
19+
import (
20+
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
21+
)
22+
23+
// TestOperatorSpec defines the desired state of TestOperator.
24+
type TestOperatorSpec struct {
25+
// +optional
26+
Message string `json:"message,omitempty"`
27+
}
28+
29+
// TestOperatorStatus defines the observed state of TestOperator.
30+
type TestOperatorStatus struct {
31+
Echo string `json:"echo,omitempty"`
32+
}
33+
34+
// +kubebuilder:object:root=true
35+
// +kubebuilder:subresource:status
36+
37+
// TestOperator is the Schema for the testoperators API.
38+
type TestOperator struct {
39+
metav1.TypeMeta `json:",inline"`
40+
metav1.ObjectMeta `json:"metadata,omitempty"`
41+
42+
Spec TestOperatorSpec `json:"spec,omitempty"`
43+
Status TestOperatorStatus `json:"status,omitempty"`
44+
}
45+
46+
// +kubebuilder:object:root=true
47+
48+
// TestOperatorList contains a list of TestOperator.
49+
type TestOperatorList struct {
50+
metav1.TypeMeta `json:",inline"`
51+
metav1.ListMeta `json:"metadata,omitempty"`
52+
Items []TestOperator `json:"items"`
53+
}
54+
55+
func init() {
56+
SchemeBuilder.Register(&TestOperator{}, &TestOperatorList{})
57+
}

testdata/images/bundles/test-operator/v1.0.0/api/v1/zz_generated.deepcopy.go

Lines changed: 114 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)