Skip to content

Commit

Permalink
fix: Modifies install procedures
Browse files Browse the repository at this point in the history
* oauthclient.yml
 * Corrects apiVersion as current causes error

* package.json
* kube-apply.sh
 * Since the patches directory has been introduced in the deploy directory,
   the kustomize install falls foul of the restricted root limit. By
   scripting the kube apply, the kustomize call can be relaxed with the
   load-restrictor switch. This is already used in the deploy directory
   Makefile
  • Loading branch information
phantomjinx committed Nov 3, 2023
1 parent 622c7f5 commit f18ad32
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 5 deletions.
2 changes: 1 addition & 1 deletion oauthclient.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: v1
apiVersion: oauth.openshift.io/v1
kind: OAuthClient
metadata:
name: hawtio-online-dev
Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@
"test": "yarn test:docker && yarn test:nginx",
"test:docker": "jasmine docker/*.spec.js",
"test:nginx": "cd docker/ && HAWTIO_ONLINE_RBAC_ACL= njs test.js",
"deploy:k8s:namespace": "kubectl apply --kustomize deploy/k8s/namespace/",
"deploy:k8s:cluster": "kubectl apply --kustomize deploy/k8s/cluster/",
"deploy:openshift:namespace": "oc apply --kustomize deploy/openshift/namespace/",
"deploy:openshift:cluster": "oc apply --kustomize deploy/openshift/cluster/ && ./deploy/openshift/cluster/oauthclient.sh $ROUTE_HOSTNAME",
"deploy:k8s:namespace": "./scripts/kube-apply.sh deploy/k8s/namespace/",
"deploy:k8s:cluster": "./scripts/kube-apply.sh deploy/k8s/cluster/",
"deploy:openshift:namespace": "./scripts/kube-apply.sh deploy/openshift/namespace/",
"deploy:openshift:cluster": "./scripts/kube-apply.sh deploy/openshift/cluster/ && ./deploy/openshift/cluster/oauthclient.sh $ROUTE_HOSTNAME",
"kustomize:image": "cd deploy/base && kustomize edit set image hawtio/online=docker.io/${ORG:-hawtio}/${PROJECT:-online}:${TAG:-latest}"
},
"devDependencies": {
Expand Down
17 changes: 17 additions & 0 deletions scripts/kube-apply.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/bash

set -e -o pipefail

if [ -z "${1}" ]; then
echo "Error: no directory specified"
exit 1
fi

if [ ! -d "${1}" ]; then
echo "Error: directory does not exist"
exit 1
fi

kubectl \
kustomize --load-restrictor LoadRestrictionsNone "${1}" | \
kubectl apply -f -

0 comments on commit f18ad32

Please sign in to comment.