Skip to content

Instantly share code, notes, and snippets.

View evict-code-cov.html
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>storage: Go Coverage Report</title>
<style>
body {
background: black;
color: rgb(80, 80, 80);
View gist:e742b83d3950c6cdbfaa25fe262a86bf
Created google-fedora-metadata-keys following instructions here: https://wiki.ubuntu.com/GoogleComputeEngineSSHKeys
I used 'fedora', 'cloudinit', and 'root' as usernames there, most likely just 'fedora' would be required/needed.
Converted qcow2 image to raw using qemu-img convert command, followed instructions here to import into GCE appropriately: https://major.io/2019/08/07/fedora-30-on-google-compute-engine/
Create instance (you probably don't need to specify all these options, this was copied from the web interface for convenience)
gcloud beta compute \
--project=<redacted> instances create mgugino-fedora-33-test3 \
--zone=us-east1-c --machine-type=e2-medium \
View grace-period-problems.txt
[myuser machine-api-operator]$ go test ./pkg/apis/machine/v1beta1/
panic: test timed out after 10m0s
goroutine 6194 [running]:
testing.(*M).startAlarm.func1()
/home/myuser/go_dists/go-1.13.7/src/testing/testing.go:1377 +0xdf
created by time.goFunc
/home/myuser/go_dists/go-1.13.7/src/time/sleep.go:168 +0x44
goroutine 1 [chan receive, 9 minutes]:
View webhook-start-stop.txt
=== RUN TestStorageMachine
--- PASS: TestStorageMachine (0.04s)
=== RUN TestRoundTripMachine
--- PASS: TestRoundTripMachine (0.86s)
=== RUN TestMachineCreation
=== RUN TestMachineCreation/with_AWS_and_a_nil_provider_spec_value
Starting runnable 986112c5-fa99-4a4d-8a9e-9c37034185f3
=== RUN TestMachineCreation/with_AWS_and_no_fields_set
finished runnable 986112c5-fa99-4a4d-8a9e-9c37034185f3
Starting runnable 18caa06b-9bd6-468a-9332-10a70c6bbcc6
View joel-race.txt
==================
WARNING: DATA RACE
Read at 0x00c000599ef0 by goroutine 68:
runtime.mapiterinit()
/home/mgugino/go_dists/go-1.13.7/src/runtime/map.go:802 +0x0
sigs.k8s.io/controller-runtime/pkg/webhook.(*Server).Start()
/home/mgugino/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.6.0/pkg/webhook/server.go:145 +0x174
sigs.k8s.io/controller-runtime/pkg/manager.(*controllerManager).Add.func1()
/home/mgugino/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.6.0/pkg/manager/internal.go:235 +0x74
View data-race.txt
[myuser machine-api-operator]$ go test -race -gcflags '-N -l' ./pkg/apis/machine/v1beta1/
==================
WARNING: DATA RACE
Read at 0x00c00070e210 by goroutine 62:
runtime.mapiterinit()
/home/myuser/go_dists/go-1.13.7/src/runtime/map.go:802 +0x0
sigs.k8s.io/controller-runtime/pkg/webhook.(*Server).Start()
/home/myuser/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.6.0/pkg/webhook/server.go:145 +0x174
sigs.k8s.io/controller-runtime/pkg/manager.(*controllerManager).Add.func1()
/home/myuser/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.6.0/pkg/manager/internal.go:235 +0x74
View weird-manager.stuff.txt
--- FAIL: TestCPMachineSetDelete (0.06s)
--- FAIL: TestCPMachineSetDelete/is_not_CP_MachineSet (0.01s)
machineset_webhook_test.go:694:
Expected success, but got an error:
<*errors.StatusError | 0xc000922280>: {
ErrStatus: {
TypeMeta: {Kind: "", APIVersion: ""},
ListMeta: {
SelfLink: "",
ResourceVersion: "",
View go-is-nuts.txt
$ go test ./pkg/apis/machine/v1beta1/
2020/06/17 23:57:58 Defaulting fields for MachineSet foo
2020/06/17 23:57:58 Defaulting to Random
--- FAIL: TestMachineSetUpdate (0.28s)
--- FAIL: TestMachineSetUpdate/with_a_valid_Azure_ProviderSpec (0.01s)
machineset_webhook_test.go:590:
Unexpected error:
<*errors.StatusError | 0xc0000f66e0>: {
ErrStatus: {
TypeMeta: {Kind: "", APIVersion: ""},
@michaelgugino
michaelgugino / all-objects.sh
Created Jun 11, 2020
dumping all your k8s objects
View all-objects.sh
./kubectl get --raw / | jq '.paths | map(select(. | test("/v1")))[]' | \
sed -e 's/^"//' -e 's/"$//' | parallel -a - --jobs 20 --tag './apigetter.sh {= $args[0] =} 2> /dev/null' | \
sed 's/\s/\//g' | parallel -a - --jobs 20 ./oc get --raw | \
jq '.items[] | .metadata.selfLink+":"+.metadata.resourceVersion' | sort > allobjects.out
# apigetter.sh
#!/usr/bin/env bash
./oc get --raw $1 | jq '.resources | map(select(.name | test("^\\w*$")))[].name' | sed -e 's/^"//' -e 's/"$//'
View mcps.yaml
[mgugino@mguginop50 gcp-testing]$ cat mcps.yaml
apiVersion: machine.openshift.io/v1beta1
kind: MachineControlPlaneSet
metadata:
name: default
spec: {}
status:
controlPlaneMachines:
- name: "x1"
replacementInProgress: false