Skip to content

Commit

Permalink
fix: alm examples used by Openshift Web Console when clicking "Create…
Browse files Browse the repository at this point in the history
… Move2Kube" button (#166)

Signed-off-by: Harikrishnan Balagopal <harikrishmenon@gmail.com>
  • Loading branch information
HarikrishnanBalagopal authored Oct 31, 2023
1 parent ab87a55 commit d2c32f5
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 69 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ endif
.PHONY: prepare-for-release
prepare-for-release:
mv helm-charts/move2kube/Chart.yaml old
cat old | sed -E s/version:\ v0.1.0-unreleased/version:\ ${IMAGE_TAG}/ | sed -E s/appVersion:\ latest/appVersion:\ ${IMAGE_TAG}/ > helm-charts/move2kube/Chart.yaml
cat old | sed -E s/version:\ v0.1.0-unreleased/version:\ ${IMAGE_TAG}/ | sed -E s/appVersion:\ v0.1.0-unreleased/appVersion:\ ${IMAGE_TAG}/ > helm-charts/move2kube/Chart.yaml
rm old

.PHONY: cmultibuildpush
Expand Down
2 changes: 1 addition & 1 deletion helm-charts/move2kube/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ keywords:
- move2kube
name: move2kube
version: v0.1.0-unreleased
appVersion: latest
appVersion: v0.1.0-unreleased
type: application
icon: https://raw.githubusercontent.com/konveyor/community/main/brand/logo/konveyor-logo-move2kube.svg
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ spec:
{{- end }}
containers:
- name: move2kubeapi
image: "{{ .Values.deployment.api.imageName }}:{{ .Values.deployment.api.imageTag | default .Chart.AppVersion }}"
image: "{{ .Values.deployment.api.imageName }}:{{ .Values.deployment.api.imageTag }}"
command:
- move2kube-api
args:
Expand Down
16 changes: 8 additions & 8 deletions helm-charts/move2kube/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ deployment:
api:
replicas: 1
privilegedPods: false # some optional features of Move2Kube require privileged pods
imageName: quay.io/konveyor/move2kube-ui
imageTag: "" # if empty we will use AppVersion from the Chart.yaml as the tag
imageName: "quay.io/konveyor/move2kube-ui"
imageTag: "latest"
memory: "1Gi"
cpu: "300m"
initContainer: false
Expand All @@ -21,14 +21,14 @@ deployment:
ingress:
enable: true
preferRoute: false # if true we will use an Openshift Route instead of an K8s Ingress
host: mydomain.com
host: "mydomain.com"
tlsSecretName: "" # not necessary when using Openshift Route
persistentVolumeClaim:
enable: false # set this to true to get persistent storage
createNew: true
name: "" # if createNew is false this MUST contain the name of an existing persistent volume claim
storageClassName: ""
storageSize: 1Gi
storageSize: "1Gi"
readWriteMany: true
secret:
api:
Expand All @@ -39,10 +39,10 @@ secret:
authServer: # required if deployment.authServer.enable is true
createNew: true
name: "" # if createNew is false this MUST contain the name of an existing secret
adminUsername: admin # TODO: Change this before deploying
adminPassword: password # TODO: Change this before deploying
databaseUsername: auth-server # TODO: Change this before deploying
databasePassword: password # TODO: Change this before deploying
adminUsername: "admin" # TODO: Change this before deploying
adminPassword: "password" # TODO: Change this before deploying
databaseUsername: "auth-server" # TODO: Change this before deploying
databasePassword: "password" # TODO: Change this before deploying
realmJSON: ""
standaloneHAXML: ""
securityContextContraints:
Expand Down
19 changes: 17 additions & 2 deletions operator/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@ run: helm-operator ## Run against the configured Kubernetes cluster in ~/.kube/c
.PHONY: docker-build
docker-build: ## Build docker image with the manager.
cp -r ../helm-charts .
yq eval --exit-status --inplace ".version=\"${VERSION}\"" helm-charts/move2kube/Chart.yaml
yq eval --exit-status --inplace ".appVersion=\"${VERSION}\"" helm-charts/move2kube/Chart.yaml
yq eval --exit-status --inplace ".deployment.api.imageTag=\"${VERSION}\"" helm-charts/move2kube/values.yaml
docker build -t ${IMG} .
rm -rf helm-charts
Expand Down Expand Up @@ -190,20 +192,33 @@ bundle: kustomize operator-sdk ## Generate bundle manifests and metadata, then v
ls -al .
ls -al helm-charts
echo 'changing the image tag to '${VERSION}' in "containerImage" field in the CSV using yq'
# -------------------
echo 'before editting the CSV'
cat config/manifests/bases/move2kube-operator.clusterserviceversion.yaml
$(eval MYYQEXPR1 := '.metadata.annotations.containerImage="quay.io/konveyor/move2kube-operator:${VERSION}"')
echo ${MYYQEXPR1}
yq eval --exit-status ${MYYQEXPR1} config/manifests/bases/move2kube-operator.clusterserviceversion.yaml > foo.yaml
mv foo.yaml config/manifests/bases/move2kube-operator.clusterserviceversion.yaml
echo 'after editting the CSV'
cat config/manifests/bases/move2kube-operator.clusterserviceversion.yaml
# -------------------
echo 'before editting the values.yaml'
cat helm-charts/move2kube/values.yaml
$(eval MYYQEXPR2 := '.deployment.api.imageTag="${VERSION}"')
echo ${MYYQEXPR2}
yq eval --exit-status ${MYYQEXPR2} helm-charts/move2kube/values.yaml > bar.yaml
mv bar.yaml helm-charts/move2kube/values.yaml
echo 'after editting the values.yaml'
cat helm-charts/move2kube/values.yaml
echo 'after editting the CSV'
cat config/manifests/bases/move2kube-operator.clusterserviceversion.yaml
# -------------------
echo 'changing the version and appVersion to '${VERSION}' in the "Chart.yaml"'
echo 'before editting the Chart.yaml'
cat helm-charts/move2kube/Chart.yaml
yq eval --exit-status --inplace ".version=\"${VERSION}\"" helm-charts/move2kube/Chart.yaml
yq eval --exit-status --inplace ".appVersion=\"${VERSION}\"" helm-charts/move2kube/Chart.yaml
echo 'after editting the Chart.yaml'
cat helm-charts/move2kube/Chart.yaml
# -------------------
ls -al .
ls -al config
ls -al config/manifests
Expand Down
57 changes: 1 addition & 56 deletions operator/config/samples/move2kube_v1alpha1_move2kube.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,59 +2,4 @@ apiVersion: move2kube.konveyor.io/v1alpha1
kind: Move2Kube
metadata:
name: move2kube-sample
spec:
# Default values copied from <project_dir>/helm-charts/move2kube/values.yaml
deployment:
api:
cpu: 300m
imageTag: ""
initContainer: false
memory: 1Gi
privilegedPods: false
replicas: 1
authServer:
cpu: 300m
enable: false
memory: 1Gi
replicas: 1
database:
cpu: 300m
enable: false
memory: 1Gi
replicas: 1
startEmpty: true
ingress:
enable: true
host: mydomain.com
preferRoute: false
tlsSecretName: ""
persistentVolumeClaim:
createNew: true
enable: false
name: ""
readWriteMany: true
storageClassName: ""
storageSize: 1Gi
secret:
api:
configYAML: ""
createNew: true
enable: false
name: ""
authServer:
adminPassword: password
adminUsername: admin
createNew: true
databasePassword: password
databaseUsername: auth-server
name: ""
realmJSON: ""
standaloneHAXML: ""
securityContextContraints:
enable: false
serviceAccount:
createNew: true
enable: false
name: ""


spec: {}

0 comments on commit d2c32f5

Please sign in to comment.