Skip to content

Instantly share code, notes, and snippets.

View Oats87's full-sized avatar

Chris Kim Oats87

View GitHub Profile
@Oats87
Oats87 / diff-yaml.sh
Created April 18, 2023 20:03
This requires `yq`, `diff`, and `bash`
#!/bin/bash
FILE=${1:-0}
if [ "${FILE}" = "0" ]; then
echo "need to specify a file"
exit 1
fi
fileNo=$(ls $FILE-split | wc -l | awk '{print $1}')
package systemtemplate
import (
"bytes"
"crypto/sha256"
"encoding/hex"
"encoding/json"
"fmt"
"strings"
"testing"
@Oats87
Oats87 / debug.yaml
Created May 9, 2023 19:23
drop-in-debug.yaml
kube-apiserver-arg+: "v=6"
kube-controller-manager-arg+: "v=6"
kube-scheduler-arg+: "v=6"
kubelet-arg+: "v=6"
debug: "true"
@Oats87
Oats87 / parse-provisioning-tests-debug-data.sh
Last active May 10, 2023 20:46
This is a WIP attempt to write a parsing file that can take the drone logs download of a provisioning-tests failure and spit out the information in an easy-to-digest format.
#!/bin/sh
FILE=$1
if [ -z "${FILE}" ]; then
echo "A file must be specified"
exit 1
fi
BLOB=$(cat ${FILE} | grep -A 1 "wait failed on" | grep -v "wait failed on")
@Oats87
Oats87 / gist:10b93fc13d57b14660a7bc3cc1d1acea
Created June 22, 2023 19:00
Patch for conditions on infrastructuremachine
kubectl -n fleet-default patch vmwarevspheremachine <INFRAMACHINE> --subresource=status --type=json -p='[{"op": "replace", "path": "/status/conditions", "value":[{"type":"CreateJob","status":"True"},{"type":"Ready","status":"True"}]}]'
@Oats87
Oats87 / setup-rancher-run-env.sh
Last active January 29, 2024 22:57
Create a run.env file that can be used for running Rancher in an IDE
set -x;
if ! command -v rancher-machine &> /dev/null; then
echo "rancher-machine must be in your PATH";
exit 1;
fi;
RDIR=$(pwd)/local-run-data;
mkdir -p $RDIR;
: > run.env;
echo "CATTLE_DEV_MODE=30" >> run.env;
eval "$(grep '^ENV CATTLE_SYSTEM_AGENT' package/Dockerfile | awk '{print "export " $2 "=" $3}')";