Skip to content

Commit

Permalink
fix: shellcheck errors and remove unused scripts
Browse files Browse the repository at this point in the history
Signed-off-by: Sunil Thaha <[email protected]>
  • Loading branch information
sthaha committed Oct 2, 2023
1 parent 1a05c86 commit 83c0015
Show file tree
Hide file tree
Showing 10 changed files with 31 additions and 230 deletions.
20 changes: 10 additions & 10 deletions .devcontainer/scripts/install-tools.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@
echo "**********************************************************************"
echo "Install OpenShift CLI..."
echo "**********************************************************************"
if [ $(uname -m) == aarch64 ]; then
echo "Installing OpenShift CLI for ARM64..."
curl https://mirror.openshift.com/pub/openshift-v4/clients/ocp/stable/openshift-client-linux-arm64.tar.gz --output oc.tar.gz
if [ "$(uname -m)" == aarch64 ]; then
echo "Installing OpenShift CLI for ARM64..."
curl https://mirror.openshift.com/pub/openshift-v4/clients/ocp/stable/openshift-client-linux-arm64.tar.gz --output oc.tar.gz
else
echo "Installing OpenShift CLI for x86_64..."
curl https://mirror.openshift.com/pub/openshift-v4/clients/ocp/stable/openshift-client-linux.tar.gz --output oc.tar.gz
fi;
echo "Installing OpenShift CLI for x86_64..."
curl https://mirror.openshift.com/pub/openshift-v4/clients/ocp/stable/openshift-client-linux.tar.gz --output oc.tar.gz
fi
sudo tar xvzf oc.tar.gz -C /usr/local/bin/ oc
sudo ln -s /usr/local/bin/oc /usr/bin/oc
rm oc.tar.gz
Expand All @@ -24,9 +24,9 @@ echo "Creatine alias for kubectl (kc) and kustomize (ku)..."
echo "**********************************************************************"

echo "Creating kc and kns alias for kubectl..."
echo "alias kc='/usr/local/bin/kubectl'" >> $HOME/.bash_aliases
echo "alias kns='kubectl config set-context --current --namespace'" >> $HOME/.bash_aliases
echo "alias kc='/usr/local/bin/kubectl'" >>"$HOME/.bash_aliases"
echo "alias kns='kubectl config set-context --current --namespace'" >>"$HOME/.bash_aliases"
echo "Creating ku alias for kustomize..."
echo "alias ku='/usr/local/bin/kustomize'" >> $HOME/.bash_aliases
echo "alias ku='/usr/local/bin/kustomize'" >>"$HOME/.bash_aliases"

echo "Extra tools installations complete."
echo "Extra tools installations complete."
22 changes: 10 additions & 12 deletions automation/presubmit-tests/gofmt.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,14 @@
set -e

echo "Checking go format"
sources="./cmd/ ./pkg/"
unformatted=$(gofmt -e -d -s -l $sources)
if [ ! -z "$unformatted" ]; then
# Some files are not gofmt.
echo >&2 "The following Go files must be formatted with gofmt:"
for fn in $unformatted; do
echo >&2 " $fn"
done
echo >&2 "Please run 'make format'."
exit 1
fi
unformatted="$(gofmt -e -d -s -l "./cmd" "./pkg")"
[[ -z "$unformatted" ]] && exit 0

exit 0
# Some files are not gofmt.
echo "The following Go files must be formatted with gofmt:" >&2
for fn in $unformatted; do
echo " $fn" >&2
done

echo "Please run 'make format'." >&2
exit 1
16 changes: 8 additions & 8 deletions bundle/manifests/kepler-operator.clusterserviceversion.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@ metadata:
]
capabilities: Basic Install
categories: Monitoring
containerImage: quay.io/sustainable_computing_io/kepler-operator:0.8.0
createdAt: "2023-09-20T10:50:40Z"
containerImage: localhost:5001/kepler-operator:0.0.0-dev
createdAt: "2023-10-02T21:20:16Z"
description: 'Deploys and Manages Kepler on Kubernetes '
operators.operatorframework.io/builder: operator-sdk-v1.27.0
operators.operatorframework.io/project_layout: go.kubebuilder.io/v3
repository: https://github.com/sustainable-computing-io/kepler-operator
name: kepler-operator.v0.8.0
name: kepler-operator.v0.0.0-dev
namespace: placeholder
spec:
apiservicedefinitions: {}
Expand Down Expand Up @@ -224,8 +224,8 @@ spec:
- /manager
env:
- name: RELATED_IMAGE_KEPLER
value: quay.io/sustainable_computing_io/kepler:release-0.5.5
image: quay.io/sustainable_computing_io/kepler-operator:0.8.0
value: localhost:5001/kepler:release-0.5.5
image: localhost:5001/kepler-operator:0.0.0-dev
imagePullPolicy: IfNotPresent
livenessProbe:
httpGet:
Expand Down Expand Up @@ -327,7 +327,7 @@ spec:
name: Kepler Operator Contributors
url: https://sustainable-computing.io/
relatedImages:
- image: quay.io/sustainable_computing_io/kepler:release-0.5.5
- image: localhost:5001/kepler:release-0.5.5
name: kepler
replaces: kepler-operator.v0.7.3
version: 0.8.0
replaces: kepler-operator.v0.8.0
version: 0.0.0-dev
1 change: 1 addition & 0 deletions hack/bundle.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ declare -r PROJECT_ROOT
declare -r LOCAL_BIN="$PROJECT_ROOT/tmp/bin"
declare -r CSV_FILE=bundle/manifests/kepler-operator.clusterserviceversion.yaml

# shellcheck source=hack/utils.bash
source "$PROJECT_ROOT/hack/utils.bash"

# TODO: write a git action to create bundle on every pull request merge and make a commit to new branch
Expand Down
42 changes: 0 additions & 42 deletions hack/cluster-clean.sh

This file was deleted.

1 change: 1 addition & 0 deletions hack/cluster.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ declare -r DEV_CLUSTER_DIR="$TMP_DIR/local-dev-cluster"
declare -r BIN_DIR="$TMP_DIR/bin"
declare -r OPERATOR_SDK_VERSION=${OPERATOR_SDK_VERSION:-v1.27.0}

# shellcheck source=hack/utils.bash
source "$PROJECT_ROOT/hack/utils.bash"

git_checkout() {
Expand Down
62 changes: 0 additions & 62 deletions hack/common.sh

This file was deleted.

1 change: 1 addition & 0 deletions hack/dashboard/openshift/deploy-grafana.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ declare -r UWM_CONFIG_URL="https://docs.openshift.com/container-platform/latest/
declare -r GRAFANA_NS=kepler-grafana
declare -r GRAFANA_SA=grafana

# shellcheck source=hack/utils.bash
source "$PROJECT_ROOT/hack/utils.bash"

oc_apply_grafana_ns() {
Expand Down
95 changes: 0 additions & 95 deletions hack/integration_cluster.sh

This file was deleted.

1 change: 0 additions & 1 deletion tests/run-e2e.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ declare SHOW_USAGE=false
declare LOGS_DIR="tmp/e2e"
declare OPERATORS_NS="operators"
declare TEST_TIMEOUT="15m"
# declare -a PORT_FORWARDED_PIDS=()

cleanup() {
info "Cleaning up ..."
Expand Down

0 comments on commit 83c0015

Please sign in to comment.