From 456507b616d81d97eb209e170aed2e042e7ca0df Mon Sep 17 00:00:00 2001 From: Disaiah Bennett Date: Wed, 24 Apr 2024 11:42:10 -0400 Subject: [PATCH] [ACM-10819] Updated Makefiles to support podman configuration (#675) * updated makefiles to support podman configuration Signed-off-by: Disaiah Bennett * updated rbac_gen Signed-off-by: Disaiah Bennett * updated rbac role Signed-off-by: Disaiah Bennett --------- Signed-off-by: Disaiah Bennett --- Makefile | 26 ++++++++++++++++++++++++++ config/rbac/role.yaml | 2 ++ pkg/templates/rbac_gen.go | 5 +++-- 3 files changed, 31 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index e8e4abee5..4b190cf1c 100644 --- a/Makefile +++ b/Makefile @@ -127,6 +127,12 @@ docker-build: test ## Build docker image with the manager. docker-push: ## Push docker image with the manager. docker push ${IMG} +podman-build: test ## Build podman image with the manager. + podman build --build-arg LDFLAGS=${LDFLAGS} -t ${IMG} . + +podman-push: ## Push podman image with the manager. + podman push ${IMG} + ##@ Deployment install: manifests kustomize ## Install CRDs into the K8s cluster specified in ~/.kube/config. @@ -189,6 +195,14 @@ bundle-build: ## Build the bundle image. bundle-push: ## Push the bundle image. $(MAKE) docker-push IMG=$(BUNDLE_IMG) +.PHONY: podman-bundle-build +podman-bundle-build: ## Build the bundle image. + podman build -f bundle.Dockerfile -t $(BUNDLE_IMG) . + +.PHONY: podman-bundle-push +podman-bundle-push: ## Push the bundle image. + $(MAKE) podman-push IMG=$(BUNDLE_IMG) + .PHONY: opm OPM = ./bin/opm opm: ## Download opm locally if necessary. @@ -230,6 +244,11 @@ catalog-build: opm ## Build a catalog image. catalog-push: ## Push a catalog image. $(MAKE) docker-push IMG=$(CATALOG_IMG) +# Push the catalog image. +.PHONY: podman-catalog-push +podman-catalog-push: ## Push a catalog image. + $(MAKE) podman-push IMG=$(CATALOG_IMG) + -include Makefile.dev @@ -242,5 +261,12 @@ test-image: ## Build a functional test image ft-install: ## Docker run the functional test image docker run --env TEST_MODE="install" --volume ~/.kube/config:/opt/.kube/config $(REGISTRY)/backplane-operator-test:$(VERSION) +podman-test-image: ## Build a functional test image + @echo "Building $(REGISTRY)/backplane-operator-test:$(VERSION)" + podman build . -f Dockerfile.test.prow -t $(REGISTRY)/backplane-operator-test:$(VERSION) + +podman-ft-install: ## Podman run the functional test image + podman run --env TEST_MODE="install" --volume ~/.kube/config:/opt/.kube/config $(REGISTRY)/backplane-operator-test:$(VERSION) + functional-tests: ## Run ginkgo functional tests directly. ginkgo -tags functional -v test/function_tests/backplane_operator_install_test diff --git a/config/rbac/role.yaml b/config/rbac/role.yaml index 2d9321701..ca3c50a40 100644 --- a/config/rbac/role.yaml +++ b/config/rbac/role.yaml @@ -1490,6 +1490,8 @@ rules: - dnses verbs: - get + - list + - watch - apiGroups: - config.openshift.io resources: diff --git a/pkg/templates/rbac_gen.go b/pkg/templates/rbac_gen.go index 35264e643..605e7507e 100644 --- a/pkg/templates/rbac_gen.go +++ b/pkg/templates/rbac_gen.go @@ -187,6 +187,7 @@ package main //+kubebuilder:rbac:groups=cluster.open-cluster-management.io,resources=managedclusters,verbs=get;create;update //+kubebuilder:rbac:groups=cluster.open-cluster-management.io,resources=managedclusters,verbs=get;list;create;delete;watch;update;patch //+kubebuilder:rbac:groups=cluster.open-cluster-management.io,resources=managedclusters,verbs=get;list;watch +//+kubebuilder:rbac:groups=cluster.open-cluster-management.io,resources=managedclusters,verbs=get;list;watch //+kubebuilder:rbac:groups=cluster.open-cluster-management.io,resources=managedclusters,verbs=get;list;watch;update;patch //+kubebuilder:rbac:groups=cluster.open-cluster-management.io,resources=managedclusters,verbs=get;list;watch;update;patch //+kubebuilder:rbac:groups=cluster.open-cluster-management.io,resources=managedclusters/status,verbs=patch;update @@ -214,12 +215,12 @@ package main //+kubebuilder:rbac:groups=config.openshift.io,resources=clusterversions,verbs=get //+kubebuilder:rbac:groups=config.openshift.io,resources=clusterversions,verbs=get;list //+kubebuilder:rbac:groups=config.openshift.io,resources=clusterversions,verbs=get;list;watch -//+kubebuilder:rbac:groups=config.openshift.io,resources=dnses,verbs=get +//+kubebuilder:rbac:groups=config.openshift.io,resources=dnses,verbs=get;list;watch //+kubebuilder:rbac:groups=config.openshift.io,resources=infrastructures,verbs=get //+kubebuilder:rbac:groups=config.openshift.io,resources=infrastructures,verbs=get;list;watch //+kubebuilder:rbac:groups=config.openshift.io,resources=infrastructures,verbs=get;list;watch //+kubebuilder:rbac:groups=config.openshift.io,resources=infrastructures,verbs=get;list;watch;patch;update -//+kubebuilder:rbac:groups=config.openshift.io,resources=proxies,verbs=get +//+kubebuilder:rbac:groups=config.openshift.io,resources=proxies,verbs=get;list;watch //+kubebuilder:rbac:groups=config.openshift.io,resources=proxies,verbs=get;list;watch //+kubebuilder:rbac:groups=config.openshift.io;console.openshift.io;project.openshift.io;tower.ansible.com,resources=infrastructures;consolelinks;projects;featuregates;ansiblejobs;clusterversions,verbs=list;get;watch //+kubebuilder:rbac:groups=console.open-cluster-management.io,resources=userpreferences,verbs=create;get;list;patch;watch