Skip to content

Commit b8f1e48

Browse files
committed
Precommit
1 parent 302a911 commit b8f1e48

9 files changed

Lines changed: 25 additions & 28 deletions

File tree

deploy-disconnected-registry/deploy.sh

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#!/usr/bin/env bash
22

3-
43
set -o pipefail
54
set -o nounset
65
set -m
@@ -13,19 +12,19 @@ source ${WORKDIR}/shared-utils/common.sh
1312

1413
source ./common.sh ${1}
1514

16-
if [[ "$1" == 'hub' ]]; then
17-
if ! ./verify.sh ; then
18-
echo ">>>> Deploy internal registry on: ${REGISTRY} Namespace"
19-
echo ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"
20-
# TODO: Render variables instead being static
21-
oc create namespace ${REGISTRY} -o yaml --dry-run=client | oc apply -f -
22-
htpasswd -bBc ${AUTH_SECRET} ${REG_US} ${REG_PASS}
23-
oc -n ${REGISTRY} create secret generic ${SECRET} --from-file=${AUTH_SECRET} -o yaml --dry-run=client | oc apply -f -
24-
oc -n ${REGISTRY} create configmap registry-conf --from-file=config.yml -o yaml --dry-run=client | oc apply -f -
25-
oc -n ${REGISTRY} create -f ${REGISTRY_MANIFESTS}/deployment.yaml -o yaml --dry-run=client | oc apply -f -
26-
oc -n ${REGISTRY} create -f ${REGISTRY_MANIFESTS}/service.yaml -o yaml --dry-run=client | oc apply -f -
27-
oc -n ${REGISTRY} create -f ${REGISTRY_MANIFESTS}/pvc-registry.yaml -o yaml --dry-run=client | oc apply -f -
28-
oc -n ${REGISTRY} create -f ${REGISTRY_MANIFESTS}/route.yaml -o yaml --dry-run=client | oc apply -f -
15+
if [[ $1 == 'hub' ]]; then
16+
if ! ./verify.sh; then
17+
echo ">>>> Deploy internal registry on: ${REGISTRY} Namespace"
18+
echo ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"
19+
# TODO: Render variables instead being static
20+
oc create namespace ${REGISTRY} -o yaml --dry-run=client | oc apply -f -
21+
htpasswd -bBc ${AUTH_SECRET} ${REG_US} ${REG_PASS}
22+
oc -n ${REGISTRY} create secret generic ${SECRET} --from-file=${AUTH_SECRET} -o yaml --dry-run=client | oc apply -f -
23+
oc -n ${REGISTRY} create configmap registry-conf --from-file=config.yml -o yaml --dry-run=client | oc apply -f -
24+
oc -n ${REGISTRY} create -f ${REGISTRY_MANIFESTS}/deployment.yaml -o yaml --dry-run=client | oc apply -f -
25+
oc -n ${REGISTRY} create -f ${REGISTRY_MANIFESTS}/service.yaml -o yaml --dry-run=client | oc apply -f -
26+
oc -n ${REGISTRY} create -f ${REGISTRY_MANIFESTS}/pvc-registry.yaml -o yaml --dry-run=client | oc apply -f -
27+
oc -n ${REGISTRY} create -f ${REGISTRY_MANIFESTS}/route.yaml -o yaml --dry-run=client | oc apply -f -
2928

3029
echo ">>>> Trusting internal registry"
3130
echo ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"

deploy-disconnected-registry/ocp-sync.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ source ${WORKDIR}/shared-utils/common.sh
1111

1212
source ./common.sh ${1}
1313

14-
if [[ "$1" == 'hub' ]]; then
15-
if ! ./verify_ocp_sync.sh ; then
14+
if [[ $1 == 'hub' ]]; then
15+
if ! ./verify_ocp_sync.sh; then
1616
oc create namespace ${REGISTRY} -o yaml --dry-run=client | oc apply -f -
1717

1818
export REGISTRY_NAME="$(oc get route -n ${REGISTRY} ${REGISTRY} -o jsonpath={'.status.ingress[0].host'})"

deploy-disconnected-registry/olm-sync.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,8 @@ function mirror() {
9090
done
9191
done
9292
}
93-
if [[ "$1" == 'hub' ]]; then
94-
if ! ./verify_olm_sync.sh ; then
93+
if [[ $1 == 'hub' ]]; then
94+
if ! ./verify_olm_sync.sh; then
9595
prepare_env ${1}
9696
mirror
9797
create_cs

deploy-disconnected-registry/verify_ocp_sync.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ set -m
1313
source ${WORKDIR}/shared-utils/common.sh
1414
source ./common.sh hub
1515

16-
podman login ${DESTINATION_REGISTRY} -u ${REG_US} -p ${REG_PASS} --authfile=${PULL_SECRET} # to create a merge with the registry original adding the registry auth entry
17-
if [[ $(oc adm release info "${DESTINATION_REGISTRY}"/"${OCP_DESTINATION_REGISTRY_IMAGE_NS}":"${OCP_RELEASE_FULL}"-x86_64 --registry-config="${PULL_SECRET}" |wc -l) -gt 1 ]]; then ## line 1 == error line. If found image should show more information (>1 line)
16+
podman login ${DESTINATION_REGISTRY} -u ${REG_US} -p ${REG_PASS} --authfile=${PULL_SECRET} # to create a merge with the registry original adding the registry auth entry
17+
if [[ $(oc adm release info "${DESTINATION_REGISTRY}"/"${OCP_DESTINATION_REGISTRY_IMAGE_NS}":"${OCP_RELEASE_FULL}"-x86_64 --registry-config="${PULL_SECRET}" | wc -l) -gt 1 ]]; then ## line 1 == error line. If found image should show more information (>1 line)
1818
#Everyting is ready
1919
exit 0
2020
fi

deploy-disconnected-registry/verify_olm_sync.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ podman login ${DESTINATION_REGISTRY} -u ${REG_US} -p ${REG_PASS} --authfile=${PU
1717
for packagemanifest in $(oc get packagemanifest -n openshift-marketplace -o name ${PACKAGES_FORMATED}); do
1818
for package in $(oc get $packagemanifest -o jsonpath='{.status.channels[*].currentCSVDesc.relatedImages}' | sed "s/ /\n/g" | tr -d '[],' | sed 's/"/ /g'); do
1919
echo "Verify Package: ${package}"
20-
#if next command fails, it means that the image is not already in the destination registry, so output command will be error (>0)
20+
#if next command fails, it means that the image is not already in the destination registry, so output command will be error (>0)
2121
skopeo inspect docker://"${DESTINATION_REGISTRY}"/"${OLM_DESTINATION_REGISTRY_IMAGE_NS}"/$(echo $package | awk -F'/' '{print $2}')-$(basename $package) --authfile "${PULL_SECRET}"
2222
done
2323
done
2424
#In this case, we don't need to mirror catalogs, everything is already there
25-
exit 0
25+
exit 0

deploy-hub-configs/deploy.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ if ./verify.sh; then
2121
sed -i "s/HTTPD_SERVICE/$HTTPSERVICE/g" 04-agent-service-config.yml
2222
pull=$(oc get secret -n openshift-config pull-secret -ojsonpath='{.data.\.dockerconfigjson}' | base64 -d)
2323
sed -i "s/PULL_SECRET/$pull/g" 05-pullsecrethub.yml
24-
REGISTRY=kubeframe-registry
25-
LOCAL_REG="$(oc get route -n ${REGISTRY} ${REGISTRY} -o jsonpath={'.status.ingress[0].host'})" #TODO change it to use the global common variable importing here the source commons
24+
REGISTRY=kubeframe-registry
25+
LOCAL_REG="$(oc get route -n ${REGISTRY} ${REGISTRY} -o jsonpath={'.status.ingress[0].host'})" #TODO change it to use the global common variable importing here the source commons
2626
sed -i "s/CHANGEDOMAIN/$LOCAL_REG/g" registryconf.txt
2727
CABUNDLE=$(oc get cm -n openshift-image-registry kube-root-ca.crt --template='{{index .data "ca.crt"}}')
2828
echo -e " ca-bundle.crt: |\n$(echo -n "$CABUNDLE" | sed "s/^/ /")" >>01_Mirror_ConfigMap.yml

deploy-spoke/deploy.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ echo ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"
1717

1818
oc patch provisioning provisioning-configuration --type merge -p '{"spec":{"watchAllNamespaces": true}}'
1919

20-
2120
cd ${OUTPUTDIR}
2221
oc apply -k .
2322

deploy-spoke/render_spokes.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,5 @@ EOF
297297

298298
# Main code
299299

300-
301300
create_kustomization
302301
create_spoke_definitions

deploy-spoke/wait_for_spoke.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ function validate_condition() {
1919
exit 1
2020
else
2121
echo "Condition $1 verified"
22-
22+
2323
fi
2424
}
2525

@@ -51,4 +51,4 @@ validate_condition "agentclusterinstall" "{.items[*].status.debugInfo.stateInfo}
5151

5252
echo ">>>>EOF"
5353
echo ">>>>>>>"
54-
exit 0
54+
exit 0

0 commit comments

Comments
 (0)