Skip to content

Commit

Permalink
Migrate to kubebuilder v4 layout
Browse files Browse the repository at this point in the history
Signed-off-by: Ruben Vargas <[email protected]>
  • Loading branch information
rubenvp8510 committed Nov 18, 2024
1 parent 1fb2623 commit 2016061
Show file tree
Hide file tree
Showing 160 changed files with 255 additions and 561 deletions.
10 changes: 5 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ test: manifests generate fmt setup-envtest ## Run tests.

.PHONY: build
build: generate fmt ## Build manager binary.
CGO_ENABLED=0 go build -o bin/manager -ldflags ${LD_FLAGS} main.go
CGO_ENABLED=0 go build -o bin/manager -ldflags ${LD_FLAGS} cmd/main.go

.PHONY: must-gather
must-gather:
Expand All @@ -164,7 +164,7 @@ run: manifests generate ## Run a controller from your host.
RELATED_IMAGE_TEMPO_GATEWAY=$(TEMPO_GATEWAY_IMAGE) \
RELATED_IMAGE_TEMPO_GATEWAY_OPA=$(TEMPO_GATEWAY_OPA_IMAGE) \
RELATED_IMAGE_OAUTH_PROXY=$(OAUTH_PROXY_IMAGE) \
go run -ldflags ${LD_FLAGS} ./main.go --zap-log-level=info start
go run -ldflags ${LD_FLAGS} ./cmd/main.go --zap-log-level=info start

.PHONY: container-must-gather
container-must-gather:
Expand Down Expand Up @@ -223,10 +223,10 @@ $(LOCALBIN):

## Tool Versions
KUSTOMIZE_VERSION ?= v5.0.3
CONTROLLER_GEN_VERSION ?= v0.15.0
CONTROLLER_GEN_VERSION ?= v0.16.5
GEN_API_DOCS_VERSION ?= v0.6.0
ENVTEST_VERSION ?= latest
OPERATOR_SDK_VERSION ?= 1.32.0
OPERATOR_SDK_VERSION ?= 1.33.0
OLM_VERSION ?= v0.28.0
CERTMANAGER_VERSION ?= 1.9.1
CHAINSAW_VERSION ?= v0.2.4
Expand Down Expand Up @@ -488,7 +488,7 @@ docs/spec/%: bundle/community/manifests/% | gen-api-docs
$(GEN_API_DOCS) < $^ > $@

docs/operator/config.yaml: gen-api-docs
$(GEN_API_DOCS) -pkg github.com/grafana/tempo-operator/apis/config/v1alpha1 -type ProjectConfig -format multiline > $@
$(GEN_API_DOCS) -pkg github.com/grafana/tempo-operator/api/config/v1alpha1 -type ProjectConfig -format multiline > $@

##@ Release
CHLOGGEN_VERSION=v0.11.0
Expand Down
2 changes: 1 addition & 1 deletion PROJECT
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
domain: grafana.com
layout:
- go.kubebuilder.io/v3
- go.kubebuilder.io/v4
multigroup: true
plugins:
manifests.sdk.operatorframework.io/v2: {}
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/utils/ptr"

configv1alpha1 "github.com/grafana/tempo-operator/apis/config/v1alpha1"
configv1alpha1 "github.com/grafana/tempo-operator/api/config/v1alpha1"
)

var (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"

configv1alpha1 "github.com/grafana/tempo-operator/apis/config/v1alpha1"
configv1alpha1 "github.com/grafana/tempo-operator/api/config/v1alpha1"
)

var (
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"k8s.io/apimachinery/pkg/api/resource"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"

"github.com/grafana/tempo-operator/apis/config/v1alpha1"
"github.com/grafana/tempo-operator/api/config/v1alpha1"
)

// ManagementStateType defines the type for CR management states.
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions bundle/community/bundle.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ LABEL operators.operatorframework.io.bundle.manifests.v1=manifests/
LABEL operators.operatorframework.io.bundle.metadata.v1=metadata/
LABEL operators.operatorframework.io.bundle.package.v1=tempo-operator
LABEL operators.operatorframework.io.bundle.channels.v1=alpha
LABEL operators.operatorframework.io.metrics.builder=operator-sdk-v1.32.0
LABEL operators.operatorframework.io.metrics.builder=operator-sdk-v1.33.0
LABEL operators.operatorframework.io.metrics.mediatype.v1=metrics+v1
LABEL operators.operatorframework.io.metrics.project_layout=go.kubebuilder.io/v3
LABEL operators.operatorframework.io.metrics.project_layout=go.kubebuilder.io/v4

# Labels for testing.
LABEL operators.operatorframework.io.test.mediatype.v1=scorecard+v1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,13 @@ metadata:
capabilities: Deep Insights
categories: Logging & Tracing,Monitoring
containerImage: ghcr.io/grafana/tempo-operator/tempo-operator:v0.14.1
createdAt: "2024-11-06T14:25:14Z"
createdAt: "2024-11-18T01:29:19Z"
description: Create and manage deployments of Tempo, a high-scale distributed
tracing backend.
operatorframework.io/cluster-monitoring: "true"
operatorframework.io/suggested-namespace: tempo-operator-system
operators.operatorframework.io/builder: operator-sdk-v1.32.0
operators.operatorframework.io/project_layout: go.kubebuilder.io/v3
operators.operatorframework.io/builder: operator-sdk-v1.33.0
operators.operatorframework.io/project_layout: go.kubebuilder.io/v4
repository: https://github.com/grafana/tempo-operator
support: Grafana Tempo Operator SIG
name: tempo-operator.v0.14.1
Expand Down Expand Up @@ -1253,6 +1253,13 @@ spec:
verbs:
- create
- patch
- apiGroups:
- ""
resources:
- persistentvolumeclaims
verbs:
- list
- watch
- apiGroups:
- apps
resources:
Expand Down Expand Up @@ -1289,13 +1296,6 @@ spec:
- get
- list
- watch
- apiGroups:
- ""
resources:
- persistentvolumeclaims
verbs:
- list
- watch
- apiGroups:
- grafana.integreatly.org
resources:
Expand Down Expand Up @@ -1370,31 +1370,6 @@ spec:
- tempo.grafana.com
resources:
- tempomonolithics
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- tempo.grafana.com
resources:
- tempomonolithics/finalizers
verbs:
- update
- apiGroups:
- tempo.grafana.com
resources:
- tempomonolithics/status
verbs:
- get
- patch
- update
- apiGroups:
- tempo.grafana.com
resources:
- tempostacks
verbs:
- create
Expand All @@ -1407,12 +1382,14 @@ spec:
- apiGroups:
- tempo.grafana.com
resources:
- tempomonolithics/finalizers
- tempostacks/finalizers
verbs:
- update
- apiGroups:
- tempo.grafana.com
resources:
- tempomonolithics/status
- tempostacks/status
verbs:
- get
Expand Down
31 changes: 4 additions & 27 deletions bundle/community/manifests/tempo.grafana.com_tempomonolithics.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.15.0
controller-gen.kubebuilder.io/version: v0.16.5
creationTimestamp: null
labels:
app.kubernetes.io/managed-by: operator-lifecycle-manager
Expand Down Expand Up @@ -966,7 +966,6 @@ spec:
description: |-
TLS defines the TLS configuration for OTLP/gRPC ingestion.
On OpenShift when operator config `servingCertsService` and TLS is enabled but no `certName` and `caName`
are provided it will use OpenShift serving certificate service.
properties:
Expand Down Expand Up @@ -1004,7 +1003,6 @@ spec:
description: |-
TLS defines the TLS configuration for OTLP/HTTP ingestion.
On OpenShift when operator config `servingCertsService` and TLS is enabled but no `certName` and `caName`
are provided it will use OpenShift serving certificate service.
properties:
Expand Down Expand Up @@ -1052,11 +1050,9 @@ spec:
Claims lists the names of resources, defined in spec.resourceClaims,
that are used by this container.
This is an alpha field and requires enabling the
DynamicResourceAllocation feature gate.
This field is immutable. It can only be set for containers.
items:
description: ResourceClaim references one entry in PodSpec.ResourceClaims.
Expand Down Expand Up @@ -1154,11 +1150,9 @@ spec:
Claims lists the names of resources, defined in spec.resourceClaims,
that are used by this container.
This is an alpha field and requires enabling the
DynamicResourceAllocation feature gate.
This field is immutable. It can only be set for containers.
items:
description: ResourceClaim references one entry in PodSpec.ResourceClaims.
Expand Down Expand Up @@ -1392,11 +1386,9 @@ spec:
Claims lists the names of resources, defined in spec.resourceClaims,
that are used by this container.
This is an alpha field and requires enabling the
DynamicResourceAllocation feature gate.
This field is immutable. It can only be set for containers.
items:
description: ResourceClaim references one entry in PodSpec.ResourceClaims.
Expand Down Expand Up @@ -1548,11 +1540,9 @@ spec:
Claims lists the names of resources, defined in spec.resourceClaims,
that are used by this container.
This is an alpha field and requires enabling the
DynamicResourceAllocation feature gate.
This field is immutable. It can only be set for containers.
items:
description: ResourceClaim references one entry in PodSpec.ResourceClaims.
Expand Down Expand Up @@ -1759,16 +1749,8 @@ spec:
conditions:
description: Conditions of the Tempo deployment health.
items:
description: "Condition contains details for one aspect of the current
state of this API Resource.\n---\nThis struct is intended for
direct use as an array at the field path .status.conditions. For
example,\n\n\n\ttype FooStatus struct{\n\t // Represents the
observations of a foo's current state.\n\t // Known .status.conditions.type
are: \"Available\", \"Progressing\", and \"Degraded\"\n\t //
+patchMergeKey=type\n\t // +patchStrategy=merge\n\t // +listType=map\n\t
\ // +listMapKey=type\n\t Conditions []metav1.Condition `json:\"conditions,omitempty\"
patchStrategy:\"merge\" patchMergeKey:\"type\" protobuf:\"bytes,1,rep,name=conditions\"`\n\n\n\t
\ // other fields\n\t}"
description: Condition contains details for one aspect of the current
state of this API Resource.
properties:
lastTransitionTime:
description: |-
Expand Down Expand Up @@ -1809,12 +1791,7 @@ spec:
- Unknown
type: string
type:
description: |-
type of condition in CamelCase or in foo.example.com/CamelCase.
---
Many .condition.type values are consistent across resources like Available, but because arbitrary conditions can be
useful (see .node.status.conditions), the ability to deconflict is important.
The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt)
description: type of condition in CamelCase or in foo.example.com/CamelCase.
maxLength: 316
pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$
type: string
Expand Down
Loading

0 comments on commit 2016061

Please sign in to comment.