Skip to content

Commit

Permalink
style: run pre-commit over the repo changes
Browse files Browse the repository at this point in the history
  • Loading branch information
iranzo committed Jun 15, 2022
1 parent a7540ed commit f76471f
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 34 deletions.
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ repos:
- files: \.(css|js|md|markdown|json)
id: prettier
repo: https://github.com/pre-commit/mirrors-prettier
rev: v2.6.2
rev: v2.7.0
- hooks:
- id: seed-isort-config
repo: https://github.com/asottile/seed-isort-config
Expand Down Expand Up @@ -55,7 +55,7 @@ repos:
- id: check-byte-order-marker
- id: check-docstring-first
repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.2.0
rev: v4.3.0
- hooks:
- id: flake8
repo: https://gitlab.com/pycqa/flake8
Expand Down
16 changes: 8 additions & 8 deletions deploy-edgecluster/render_edgeclusters.sh
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ EOF
echo "Edge-cluster: ${cluster}"
echo "Master: ${master}"
if [[ ${CHANGE_EDGE_MASTER_PUB_INT_MAC} == "null" ]]; then
cat <<EOF >>${OUTPUT}
cat <<EOF >>${OUTPUT}
- name: $CHANGE_EDGE_MASTER_MGMT_INT.102
type: vlan
state: up
Expand All @@ -311,7 +311,7 @@ EOF
mtu: 1500
EOF
else
cat <<EOF >>${OUTPUT}
cat <<EOF >>${OUTPUT}
- name: $CHANGE_EDGE_MASTER_PUB_INT
type: ethernet
state: up
Expand Down Expand Up @@ -347,11 +347,11 @@ EOF
next-hop-address: $CHANGE_EDGE_MASTER_PUB_INT_GW
EOF
if [[ ${CHANGE_EDGE_MASTER_PUB_INT_MAC} == "null" ]]; then
cat <<EOF >>${OUTPUT}
cat <<EOF >>${OUTPUT}
next-hop-interface: $CHANGE_EDGE_MASTER_MGMT_INT.102
EOF
else
cat <<EOF >>${OUTPUT}
cat <<EOF >>${OUTPUT}
next-hop-interface: $CHANGE_EDGE_MASTER_PUB_INT
EOF
fi
Expand All @@ -367,13 +367,13 @@ EOF
- name: "$CHANGE_EDGE_MASTER_MGMT_INT"
macAddress: '$CHANGE_EDGE_MASTER_MGMT_INT_MAC'
EOF
if [[ ${CHANGE_EDGE_MASTER_PUB_INT_MAC} != "null" ]]; then
cat <<EOF >>${OUTPUT}
if [[ ${CHANGE_EDGE_MASTER_PUB_INT_MAC} != "null" ]]; then
cat <<EOF >>${OUTPUT}
- name: "$CHANGE_EDGE_MASTER_PUB_INT"
macAddress: '$CHANGE_EDGE_MASTER_PUB_INT_MAC'
EOF
fi
cat <<EOF >>${OUTPUT}
fi
cat <<EOF >>${OUTPUT}
---
apiVersion: v1
kind: Secret
Expand Down
10 changes: 5 additions & 5 deletions deploy-worker/render_worker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ spec:
mac-address: '$CHANGE_EDGE_WORKER_MGMT_INT_MAC'
EOF
if [[ ${CHANGE_EDGE_WORKER_PUB_INT_MAC} == "null" ]]; then
cat <<EOF >>${OUTPUT}
cat <<EOF >>${OUTPUT}
- name: $CHANGE_EDGE_WORKER_MGMT_INT.102
type: vlan
state: up
Expand All @@ -86,7 +86,7 @@ EOF
mtu: 1500
EOF
else
cat <<EOF >>${OUTPUT}
cat <<EOF >>${OUTPUT}
- name: $CHANGE_EDGE_WORKER_PUB_INT
type: ethernet
state: up
Expand All @@ -113,11 +113,11 @@ EOF
next-hop-address: $CHANGE_EDGE_WORKER_PUB_INT_GW
EOF
if [[ ${CHANGE_EDGE_WORKER_PUB_INT_MAC} == "null" ]]; then
cat <<EOF >>${OUTPUT}
cat <<EOF >>${OUTPUT}
next-hop-interface: $CHANGE_EDGE_WORKER_MGMT_INT.102
EOF
else
cat <<EOF >>${OUTPUT}
cat <<EOF >>${OUTPUT}
next-hop-interface: $CHANGE_EDGE_WORKER_PUB_INT
EOF
fi
Expand All @@ -127,7 +127,7 @@ EOF
macAddress: '$CHANGE_EDGE_WORKER_MGMT_INT_MAC'
EOF
if [[ ${CHANGE_EDGE_WORKER_PUB_INT_MAC} != "null" ]]; then
cat <<EOF >>${OUTPUT}
cat <<EOF >>${OUTPUT}
- name: "$CHANGE_EDGE_WORKER_PUB_INT"
macAddress: '$CHANGE_EDGE_WORKER_PUB_INT_MAC'
EOF
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ include::modules/common-attributes.adoc[]
[discrete]
=== Base prerequisites

* Deploy the {product-title} cluster with three control plane nodes following the guidance in the section link:https://docs.openshift.com/container-platform/4.10/installing/installing_bare_metal_ipi/ipi-install-prerequisites.html[Deploying installer-provisioned clusters on bare metal].
* Deploy the {product-title} cluster with three control plane nodes following the guidance in the section link:https://docs.openshift.com/container-platform/4.10/installing/installing_bare_metal_ipi/ipi-install-prerequisites.html[Deploying installer-provisioned clusters on bare metal].

** Alternatively you can use the technology preview Assisted Installer from link:https://cloud.redhat.com/[cloud.redhat.com] to create the cluster.
** Alternatively you can use the technology preview Assisted Installer from link:https://cloud.redhat.com/[cloud.redhat.com] to create the cluster.

* To install single-node OpenShift follow the guidance in link:https://docs.openshift.com/container-platform/4.10/installing/installing_sno/install-sno-installing-sno.html[Installing on a single node] in the {product-title} documentation.

Expand Down
9 changes: 3 additions & 6 deletions pipelines/bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -163,15 +163,14 @@ function clean_openshift_pipelines() {

}


export BRANCH=${1:-main}
export KUBECONFIG_HUB="${KUBECONFIG}"

if [[ "${0}" == *"bootstrap.sh" ]]; then
if [[ ${0} == *"bootstrap.sh" ]]; then
echo "Running locally"
export WORKDIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
export WORKDIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd)
export PIPELINES_DIR=${WORKDIR}
else
else
echo "Running from Remote source"
export BASEDIR=$(dirname "$0")
export WORKDIR=${BASEDIR}/ztp-pipeline-relocatable
Expand All @@ -187,7 +186,6 @@ export EDGE_DEPLOYER_NS=$(yq eval '.namespace' "${PIPELINES_DIR}/resources/kusto
export EDGE_DEPLOYER_SA=${EDGE_DEPLOYER_NS}
export EDGE_DEPLOYER_ROLEBINDING=ztp-cluster-admin


if [[ ${@} == *'clean'* ]]; then
clean_openshift_pipelines
echo "Done!"
Expand All @@ -202,4 +200,3 @@ fi
create_permissions
deploy_openshift_pipelines
deploy_pipeline

2 changes: 1 addition & 1 deletion shared-utils/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ fi
export KUBECONFIG_HUB=${KUBECONFIG}
export PULL_SECRET=${OUTPUTDIR}/pull-secret.json

if [[ ! -z "${PRESERVE_SECRET:-false}" ]]; then
if [[ -n ${PRESERVE_SECRET:-false} ]]; then
echo "Pull secret file ${PULL_SECRET} does not exist, grabbing from OpenShift"
oc get secret -n openshift-config pull-secret -ojsonpath='{.data.\.dockerconfigjson}' | base64 -d >${PULL_SECRET}
export PRESERVE_SECRET=true
Expand Down
20 changes: 10 additions & 10 deletions utils/build-gulp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,42 +24,42 @@ declare -a mydevprev
readarray -t mydevprev <<<$(cat website/_data/devprev.yml | grep name | cut -d ":" -f 2- | sort -u)

# Empty index
> website/index.html
>website/index.html

# Create website/index.html
# This index.html will be the docs index
# Builds an href for each doc:release

# Versioned release documents
echo "<h2>Versioned</h2>" >> website/index.html
echo "<ul>" >> website/index.html
echo "<h2>Versioned</h2>" >>website/index.html
echo "<ul>" >>website/index.html
for release in ${myreleases}; do
for doc in "${mydocs[@]}"; do
doc=$(echo "${doc}" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//')
echo "<li><a href=\"${release}/${doc}\">${release}-${doc}</a></li>" >> website/index.html
echo "<li><a href=\"${release}/${doc}\">${release}-${doc}</a></li>" >>website/index.html
done
done
echo "</ul>" >>website/index.html

# Static documents
echo "<h2>Static</h2>" >> website/index.html
echo "<ul>" >> website/index.html
echo "<h2>Static</h2>" >>website/index.html
echo "<ul>" >>website/index.html
for release in ${mystaticreleases}; do
for doc in "${mystaticdocs[@]}"; do
doc=$(echo "${doc}" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//')
echo "<li><a href=\"${release}/${doc}\">${release}-${doc}</a></li>" >> website/index.html
echo "<li><a href=\"${release}/${doc}\">${release}-${doc}</a></li>" >>website/index.html
done
done
echo "</ul>" >>website/index.html

# Development documents
echo "<h2>Development</h2>" >> website/index.html
echo "<h2>Development</h2>" >>website/index.html
echo "<ul>" >>website/index.html
for release in ${mydevreleases}; do
for doc in "${mydevprev[@]}"; do
doc=$(echo "${doc}" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//')
echo "<li><a href=\"${release}/${doc}\"> ${release}-${doc}</a></li>" >> website/index.html
echo "<li><a href=\"${release}/${doc}\"> ${release}-${doc}</a></li>" >>website/index.html
done
done

echo "</ul>" >> website/index.html
echo "</ul>" >>website/index.html

0 comments on commit f76471f

Please sign in to comment.