Skip to content

Commit

Permalink
removing service directory , using only one target to deploy the ser…
Browse files Browse the repository at this point in the history
…vice , using Cluster ID to match the cloud id , user can change it after.
  • Loading branch information
mmorency2021 committed Sep 30, 2024
1 parent 695168d commit 1a34414
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
14 changes: 10 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,12 @@ TOKEN_BACKEND := $(shell oc create token -n open-cluster-management multicluster
BACKEND_TOKEN_RS := $(shell oc create token oauth-apiserver-sa -n openshift-oauth-apiserver --duration=48h)
BACKEND_URL := $(shell oc get route -n open-cluster-management search-api -o json | jq -r '"https://" + .spec.host')

# getting the cloud id and the IngressHost

CLOUD_ID := $(shell oc get clusterversion -o jsonpath='{.items[].spec.clusterID}{"\n"}')
INGRESS_HOST := $(shell oc get ingresscontrollers.operator.openshift.io -n openshift-ingress-operator default -o json | jq -r .status.domain)


# Source directories
SOURCE_DIRS := $(shell find . -maxdepth 1 -type d ! -name "vendor" ! -name "." ! -name ".*")

Expand Down Expand Up @@ -174,13 +180,13 @@ uninstall: manifests kustomize ## Uninstall CRDs from the K8s cluster specified
.PHONY: deploy
deploy: manifests kustomize ## Deploy controller to the K8s cluster specified in ~/.kube/config.
cd config/manager && $(KUSTOMIZE) edit set image controller=${IMG}
@sed -i '' -e 's/ingressHost:.*/ingressHost: $(INGRESS_HOST)/' config/services/metadata-server.yaml
@sed -i '' -e 's/cloudId: .*/cloudId: $(CLOUD_ID)/' config/services/metadata-server.yaml
$(KUSTOMIZE) build config/services | $(KUBECTL) apply -f -
@sed -i '' -e 's/ingressHost:.*/ingressHost: $(INGRESS_HOST)/' config/manager/metadata-server.yaml
@sed -i '' -e 's/cloudId: .*/cloudId: $(CLOUD_ID)/' config/manager/metadata-server.yaml
$(KUSTOMIZE) build config/default | $(KUBECTL) apply -f -

.PHONY: undeploy
undeploy: ## Undeploy controller from the K8s cluster specified in ~/.kube/config. Call with ignore-not-found=true to ignore resource not found errors during deletion.
$(KUSTOMIZE) build config/services | $(KUBECTL) delete --ignore-not-found=$(ignore-not-found) -f -
$(KUSTOMIZE) build config/default | $(KUBECTL) delete --ignore-not-found=$(ignore-not-found) -f -

##@ Build Dependencies

Expand Down
1 change: 1 addition & 0 deletions config/manager/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ kind: Kustomization

resources:
- manager.yaml
- metadata-server.yaml

generatorOptions:
disableNameSuffixHash: true
Expand Down
4 changes: 2 additions & 2 deletions config/manager/metadata-server.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ metadata:
spec:
alarmSubscriptionServerConfig:
enabled: false
cloudId: c0332915-6bbb-4d8d-8628-0ab3cc2c7e5e
cloudId: 9b504da0-727a-494f-b470-3eca88a1d13d
deploymentManagerServerConfig:
enabled: false
image: quay.io/openshift-kni/oran-o2ims:4.16
ingressHost: o2ims.apps.hubcluster-1.hubcluster-1.lab.eng.cert.redhat.com
ingressHost: apps.hubcluster-1.hubcluster-1.lab.eng.cert.redhat.com
metadataServerConfig:
enabled: true
resourceServerConfig:
Expand Down

0 comments on commit 1a34414

Please sign in to comment.