Skip to content

Commit

Permalink
fix(ci): support go:embed resources for make bundle procedure
Browse files Browse the repository at this point in the history
  • Loading branch information
squakez committed Apr 22, 2024
1 parent c32987e commit 4ae39c5
Show file tree
Hide file tree
Showing 12 changed files with 25 additions and 268 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,12 @@
# See the License for the specific language governing permissions and
# limitations under the License.
# ---------------------------------------------------------------------------

$patch: delete
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
apiVersion: builtin
kind: LabelTransformer
metadata:
name: camel-k-edit
name: global-labels
labels:
app: camel-k
fieldSpecs:
- path: metadata/labels
create: true
28 changes: 0 additions & 28 deletions config/manager/kustomization.yaml

This file was deleted.

173 changes: 0 additions & 173 deletions config/manifests/bases/camel-k.clusterserviceversion.yaml

This file was deleted.

39 changes: 0 additions & 39 deletions config/manifests/kustomization.yaml

This file was deleted.

2 changes: 1 addition & 1 deletion pkg/resources/config/manifests/.vfsignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@
# limitations under the License.
# ---------------------------------------------------------------------------

# This dir and subdirs are not included in VFS
# This dir and subdirs are not included in VFS
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,12 @@
# See the License for the specific language governing permissions and
# limitations under the License.
# ---------------------------------------------------------------------------

apiVersion: apps/v1
kind: Deployment
apiVersion: builtin
kind: LabelTransformer
metadata:
name: camel-k-operator
spec:
template:
spec:
containers:
- name: camel-k-operator
volumeMounts: null
volumes: null
name: global-labels
labels:
app: camel-k
fieldSpecs:
- path: metadata/labels
create: true
3 changes: 1 addition & 2 deletions pkg/resources/config/manifests/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@ resources:

patchesStrategicMerge:
- patch-delete-user-cluster-role.yaml
- patch-delete-pvc.yaml
images:
- name: docker.io/apache/camel-k
newName: docker.io/apache/camel-k
newTag: 2.3.1-SNAPSHOT
newTag: 2.3.0-SNAPSHOT
16 changes: 7 additions & 9 deletions script/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ LINT_GOGC := 10
LINT_DEADLINE := 10m

# olm bundle vars
MANAGER := config/manager
MANIFESTS := config/manifests
MANAGER := pkg/resources/config/manager
MANIFESTS := pkg/resources/config/manifests
BUNDLE_DIR := bundle
DEFAULT_CHANNEL ?= $(shell echo "stable-v$(word 1,$(subst ., ,$(lastword $(OPERATOR_VERSION))))")
CHANNELS ?= $(DEFAULT_CHANNEL),latest
Expand Down Expand Up @@ -300,7 +300,6 @@ endif

build-resources:
./script/get_catalog.sh $(DEFAULT_RUNTIME_VERSION) $(STAGING_RUNTIME_REPO)
go generate ./pkg/...

bundle-kamelets:
ifneq (,$(findstring release,$(MAKECMDGOALS)))
Expand Down Expand Up @@ -522,10 +521,9 @@ $(BUNDLE_CAMEL_APIS): operator-sdk
@# Remove the camel directory and re-copy only the required api
rm -rf api_$@/camel/* && cp -rf pkg/apis/camel/$@ api_$@/camel/
@# operator-sdk generate ... cannot execute across separate modules so need to temporarily move api
$(OPERATOR_SDK) generate kustomize manifests --apis-dir $(addprefix api_, $@) -q
@# Adds the licence header to the csv file.
./script/add_license.sh config/manifests/bases ./script/headers/yaml.txt
./script/add_createdAt.sh config/manifests/bases
./script/add_license.sh pkg/resources/config/manifests/bases ./script/headers/yaml.txt
./script/add_createdAt.sh pkg/resources/config/manifests/bases
@# Clean up temporary working api directories
rm -rf api_*

Expand Down Expand Up @@ -558,12 +556,12 @@ pre-bundle:

bundle: set-version generate-crd kustomize operator-sdk pre-bundle $(BUNDLE_CAMEL_APIS)
@# Sets the operator image to the preferred image:tag
@cd config/manifests && $(KUSTOMIZE) edit set image $(IMAGE_NAME)=$(CUSTOM_IMAGE):$(CUSTOM_VERSION)
@cd pkg/resources/config/manifests && $(KUSTOMIZE) edit set image $(IMAGE_NAME)=$(CUSTOM_IMAGE):$(CUSTOM_VERSION)
@# Build kustomize manifests
@$(KUSTOMIZE) build config/manifests | \
@$(KUSTOMIZE) build pkg/resources/config/manifests | \
$(OPERATOR_SDK) generate bundle \
-q --overwrite --version $(OPERATOR_VERSION) \
--kustomize-dir config/manifests $(BUNDLE_METADATA_OPTS)
--kustomize-dir pkg/resources/config/manifests $(BUNDLE_METADATA_OPTS)
@# Move the dockerfile into the bundle directory
ifeq ($(shell uname -s 2>/dev/null || echo Unknown),Darwin)
@mv bundle.Dockerfile bundle/Dockerfile && sed -i '' 's/bundle\///g' bundle/Dockerfile
Expand Down

0 comments on commit 4ae39c5

Please sign in to comment.