Skip to content
Open
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
23 changes: 23 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,29 @@ tmp.Dockerfile
_tmp/
**/e2e-tests.test
helm/charts/

# Local IDE state and implementation-session artifacts
/.idea/
/.superpowers/
/docs/superpowers/

# Local build and test outputs
/out/
/build/
*.test
/*.log
/coverage.html

# OS and editor temporary files
.DS_Store
*.swp
*.swo
*~

/.superpower/

/docs/superpower/

# Generated catalogs
/catalog/out/
/catalog/out-legacy/
4 changes: 3 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ FROM docker.io/library/golang:1.26 AS builder

ARG TARGETARCH=amd64
ARG LDFLAGS
# Bound concurrent compiler processes on memory-constrained CI builders.
ARG GO_BUILD_PARALLELISM=2

WORKDIR /opt/app-root

Expand All @@ -18,7 +20,7 @@ COPY internal/ internal/
COPY config/crd/bases config/crd/bases

# Build
RUN CGO_ENABLED=0 GOOS=linux GOARCH=$TARGETARCH GO111MODULE=on go build -ldflags "$LDFLAGS" -mod vendor -a -o manager main.go
RUN CGO_ENABLED=0 GOOS=linux GOARCH=$TARGETARCH GO111MODULE=on go build -p "$GO_BUILD_PARALLELISM" -ldflags "$LDFLAGS" -mod vendor -a -o manager main.go

# Create final image from minimal + built binary
FROM --platform=linux/$TARGETARCH registry.access.redhat.com/ubi9/ubi-minimal:1789546460
Expand Down
7 changes: 5 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -279,8 +279,11 @@ $(CONVERSION_GEN): ## Build conversion-gen from tools folder.
GOBIN=$(BIN_DIR) $(GO_INSTALL) $(CONVERSION_GEN_PKG) $(CONVERSION_GEN_BIN) $(CONVERSION_GEN_VER)

CONTROLLER_GEN = $(shell pwd)/bin/controller-gen
controller-gen: ## Download controller-gen locally if necessary.
$(call go-install-tool,$(CONTROLLER_GEN),sigs.k8s.io/controller-tools/cmd/controller-gen@v0.20.0)
CONTROLLER_GEN_VERSION = v0.20.0
controller-gen: ## Install the pinned controller-gen, replacing stale local versions.
@if ! "$(CONTROLLER_GEN)" --version 2>/dev/null | grep -Fxq "Version: $(CONTROLLER_GEN_VERSION)"; then \
GOBIN="$(PROJECT_DIR)/bin" GOFLAGS="-mod=mod" go install sigs.k8s.io/controller-tools/cmd/controller-gen@$(CONTROLLER_GEN_VERSION); \
fi

KUSTOMIZE = $(shell pwd)/bin/kustomize
kustomize: ## Download kustomize locally if necessary.
Expand Down
42 changes: 42 additions & 0 deletions api/ondemandcapture/v1beta1/groupversion_info.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
/*
Copyright 2021.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

// Package v1beta1 contains API Schema definitions for the ondemandcapture v1beta1 API group
// +kubebuilder:object:generate=true
// +groupName=netobserv.io
package v1beta1

import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
runtime "k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime/schema"
)

var (
// GroupVersion is group version used to register these objects
GroupVersion = schema.GroupVersion{Group: "netobserv.io", Version: "v1beta1"}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since you are creating a new CR, it should be v1alpha1


// SchemeBuilder is used to add go types to the GroupVersionKind scheme
SchemeBuilder = runtime.NewSchemeBuilder(func(scheme *runtime.Scheme) error {
scheme.AddKnownTypes(GroupVersion, &OnDemandCapture{})
scheme.AddKnownTypes(GroupVersion, &OnDemandCaptureList{})
metav1.AddToGroupVersion(scheme, GroupVersion)
return nil
})

// AddToScheme adds the types in this group-version to the given scheme.
AddToScheme = SchemeBuilder.AddToScheme
)
Loading
Loading