-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
2,246 additions
and
124 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,128 @@ | ||
#!/bin/bash | ||
|
||
set -exv | ||
|
||
mkdir -p /container_workspace/bin | ||
|
||
export KUBEBUILDER_ASSETS=/container_workspace/testbin/bin | ||
|
||
curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl" | ||
curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl.sha256" | ||
echo "$(cat kubectl.sha256) ./kubectl" | sha256sum --check | ||
chmod +x kubectl | ||
mv kubectl /container_workspace/bin | ||
export PATH="/container_workspace/bin:$PATH" | ||
|
||
( | ||
cd "$(mktemp -d)" && | ||
OS="$(uname | tr '[:upper:]' '[:lower:]')" && | ||
ARCH="$(uname -m | sed -e 's/x86_64/amd64/' -e 's/\(arm\)\(64\)\?.*/\1\2/' -e 's/aarch64$/arm64/')" && | ||
KREW="krew-${OS}_${ARCH}" && | ||
curl -fsSLO "https://github.com/kubernetes-sigs/krew/releases/latest/download/${KREW}.tar.gz" && | ||
tar zxvf "${KREW}.tar.gz" && | ||
./"${KREW}" install krew | ||
) | ||
|
||
source build/template_check.sh | ||
export PATH="${KREW_ROOT:-$HOME/.krew}/bin:$PATH" | ||
|
||
export PATH="/bins:$PATH" | ||
|
||
set +x | ||
|
||
echo "$MINIKUBE_SSH_KEY" > minikube-ssh-ident | ||
chmod 600 minikube-ssh-ident | ||
|
||
ssh -o StrictHostKeyChecking=no $MINIKUBE_USER@$MINIKUBE_HOST -i minikube-ssh-ident "minikube delete" | ||
ssh -o StrictHostKeyChecking=no $MINIKUBE_USER@$MINIKUBE_HOST -i minikube-ssh-ident "minikube start --cpus 6 --disk-size 10GB --memory 16000MB --kubernetes-version=1.26.3 --addons=metrics-server --disable-optimizations" | ||
|
||
export MINIKUBE_IP=`ssh -o StrictHostKeyChecking=no $MINIKUBE_USER@$MINIKUBE_HOST -i minikube-ssh-ident "minikube ip"` | ||
|
||
set -x | ||
|
||
scp -o StrictHostKeyChecking=no -i minikube-ssh-ident $MINIKUBE_USER@$MINIKUBE_HOST:$MINIKUBE_ROOTDIR/.minikube/profiles/minikube/client.key ./ | ||
scp -i minikube-ssh-ident $MINIKUBE_USER@$MINIKUBE_HOST:$MINIKUBE_ROOTDIR/.minikube/profiles/minikube/client.crt ./ | ||
scp -i minikube-ssh-ident $MINIKUBE_USER@$MINIKUBE_HOST:$MINIKUBE_ROOTDIR/.minikube/ca.crt ./ | ||
|
||
ssh -o ExitOnForwardFailure=yes -f -N -L 127.0.0.1:8444:$MINIKUBE_IP:8443 -i minikube-ssh-ident $MINIKUBE_USER@$MINIKUBE_HOST | ||
|
||
cat > kube-config <<- EOM | ||
apiVersion: v1 | ||
clusters: | ||
- cluster: | ||
certificate-authority: $PWD/ca.crt | ||
server: https://127.0.0.1:8444 | ||
name: 127-0-0-1:8444 | ||
contexts: | ||
- context: | ||
cluster: 127-0-0-1:8444 | ||
user: remote-minikube | ||
name: remote-minikube | ||
users: | ||
- name: remote-minikube | ||
user: | ||
client-certificate: $PWD/client.crt | ||
client-key: $PWD/client.key | ||
current-context: remote-minikube | ||
kind: Config | ||
preferences: {} | ||
EOM | ||
|
||
export PATH="$KUBEBUILDER_ASSETS:$PATH" | ||
export PATH="/root/go/bin:$PATH" | ||
|
||
export KUBECONFIG=$PWD/kube-config | ||
export KUBECTL_CMD="kubectl " | ||
$KUBECTL_CMD config use-context remote-minikube | ||
$KUBECTL_CMD get pods --all-namespaces=true | ||
|
||
source build/kube_setup.sh | ||
|
||
export IMAGE_TAG=`git rev-parse --short=8 HEAD` | ||
|
||
$KUBECTL_CMD create namespace clowder-system | ||
|
||
mkdir artifacts | ||
|
||
make release | ||
|
||
cat manifest.yaml > artifacts/manifest.yaml | ||
|
||
sed -i "s/clowder:latest/clowder:$IMAGE_TAG/g" manifest.yaml | ||
|
||
$KUBECTL_CMD apply -f manifest.yaml --validate=false -n clowder-system | ||
|
||
## The default generated config isn't quite right for our tests - so we'll create a new one and restart clowder | ||
$KUBECTL_CMD apply -f clowder-config.yaml -n clowder-system | ||
$KUBECTL_CMD delete pod -n clowder-system -l operator-name=clowder | ||
|
||
# Wait for operator deployment... | ||
$KUBECTL_CMD rollout status deployment clowder-controller-manager -n clowder-system | ||
$KUBECTL_CMD krew install kuttl | ||
|
||
set +e | ||
|
||
$KUBECTL_CMD get env | ||
|
||
source build/run_kuttl.sh --report xml | ||
KUTTL_RESULT=$? | ||
mv kuttl-report.xml artifacts/junit-kuttl.xml | ||
|
||
CLOWDER_PODS=$($KUBECTL_CMD get pod -n clowder-system -o jsonpath='{.items[*].metadata.name}') | ||
for pod in $CLOWDER_PODS; do | ||
$KUBECTL_CMD logs $pod -n clowder-system > artifacts/$pod.log | ||
$KUBECTL_CMD logs $pod -n clowder-system | ./parse-controller-logs > artifacts/$pod-parsed-controller-logs.log | ||
done | ||
|
||
# Grab the metrics | ||
$KUBECTL_CMD port-forward svc/clowder-controller-manager-metrics-service-non-auth -n clowder-system 8080 & | ||
sleep 5 | ||
curl 127.0.0.1:8080/metrics > artifacts/clowder-metrics | ||
|
||
STRIMZI_PODS=$($KUBECTL_CMD get pod -n strimzi -o jsonpath='{.items[*].metadata.name}') | ||
for pod in $STRIMZI_PODS; do | ||
$KUBECTL_CMD logs $pod -n strimzi > artifacts/$pod.log | ||
done | ||
set -e | ||
|
||
exit $KUTTL_RESULT |
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
module example.com/controller-gen | ||
|
||
go 1.21.11 | ||
|
||
require ( | ||
github.com/fatih/color v1.12.0 // indirect | ||
github.com/go-logr/logr v1.2.0 // indirect | ||
github.com/gobuffalo/flect v0.2.3 // indirect | ||
github.com/gogo/protobuf v1.3.2 // indirect | ||
github.com/google/go-cmp v0.5.6 // indirect | ||
github.com/google/gofuzz v1.1.0 // indirect | ||
github.com/inconshreveable/mousetrap v1.0.0 // indirect | ||
github.com/json-iterator/go v1.1.12 // indirect | ||
github.com/mattn/go-colorable v0.1.8 // indirect | ||
github.com/mattn/go-isatty v0.0.12 // indirect | ||
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect | ||
github.com/modern-go/reflect2 v1.0.2 // indirect | ||
github.com/spf13/cobra v1.2.1 // indirect | ||
github.com/spf13/pflag v1.0.5 // indirect | ||
golang.org/x/mod v0.4.2 // indirect | ||
golang.org/x/net v0.0.0-20210825183410-e898025ed96a // indirect | ||
golang.org/x/sys v0.0.0-20210831042530-f4d43177bf5e // indirect | ||
golang.org/x/text v0.3.7 // indirect | ||
golang.org/x/tools v0.1.6-0.20210820212750-d4cc65f0b2ff // indirect | ||
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect | ||
gopkg.in/inf.v0 v0.9.1 // indirect | ||
gopkg.in/yaml.v2 v2.4.0 // indirect | ||
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect | ||
k8s.io/api v0.23.0 // indirect | ||
k8s.io/apiextensions-apiserver v0.23.0 // indirect | ||
k8s.io/apimachinery v0.23.0 // indirect | ||
k8s.io/klog/v2 v2.30.0 // indirect | ||
k8s.io/utils v0.0.0-20210930125809-cb0fa318a74b // indirect | ||
sigs.k8s.io/controller-tools v0.8.0 // indirect | ||
sigs.k8s.io/json v0.0.0-20211020170558-c049b76a60c6 // indirect | ||
sigs.k8s.io/structured-merge-diff/v4 v4.1.2 // indirect | ||
sigs.k8s.io/yaml v1.3.0 // indirect | ||
) |
Oops, something went wrong.