Skip to content

Instantly share code, notes, and snippets.

View akutz's full-sized avatar

Andrew Kutz akutz

View GitHub Profile
$ make e2e
kind delete cluster --name mgmt || true
Deleting cluster "mgmt" ...
docker pull gcr.io/k8s-staging-cluster-api/cluster-api-controller:master
master: Pulling from k8s-staging-cluster-api/cluster-api-controller
Digest: sha256:5cc801d5ccd29ec8868f4f04ba425d5465a96ac342ac32536fe1df501efb5bde
Status: Image is up to date for gcr.io/k8s-staging-cluster-api/cluster-api-controller:master
gcr.io/k8s-staging-cluster-api/cluster-api-controller:master
ginkgo test -v ./test/e2e
Running Suite: CAPV e2e Suite
package controllers_test
import (
"time"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
$ docker run -t --rm -v "$(pwd)":/-:ro -w /- gcr.io/cluster-api-provider-vsphere/extra/shellcheck
In ./hack/build-gitbook.sh line 20:
export KUBE_ROOT=$(dirname "${BASH_SOURCE}")/..
^-------^ SC2155: Declare and assign separately to avoid masking return values.
^------------^ SC2128: Expanding an array without an index only gives the first element.
In ./hack/build-gitbook.sh line 22:
cd $KUBE_ROOT
@akutz
akutz / client-go-mdlint.sh
Created July 17, 2019 17:26
Running MarkdownLint against Kubernetes client-go
$ cd $(mktemp -d -p /tmp) && \
> git clone https://www.github.com/kubernetes/client-go . && \
> docker run --rm -v "$(pwd)":/build:ro gcr.io/cluster-api-provider-vsphere/extra/mdlint
Cloning into '.'...
warning: redirecting to https://github.com/kubernetes/client-go.git/
remote: Enumerating objects: 34, done.
remote: Counting objects: 100% (34/34), done.
remote: Compressing objects: 100% (23/23), done.
remote: Total 34074 (delta 14), reused 24 (delta 10), pack-reused 34040
Receiving objects: 100% (34074/34074), 18.73 MiB | 5.28 MiB/s, done.
@akutz
akutz / Dockerfile
Last active July 17, 2019 00:18
Building CAPI inside a container with Bazel
# Copyright 2019 The Kubernetes Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
$ docker run --rm -v "$(pwd)":/build:ro gcr.io/cluster-api-provider-vsphere/extra/mdlint:0.17.0
CHANGELOG.md: 1: MD041/first-line-heading/first-line-h1 First line in file should be a top level heading [Context: "TODO: This document was manual..."]
CHANGELOG.md: 3: MD034/no-bare-urls Bare URL used [Context: "https://github.com/kubernetes/..."]
CHANGELOG.md: 32: MD013/line-length Line length [Expected: 80; Actual: 94]
CHANGELOG.md: 36: MD013/line-length Line length [Expected: 80; Actual: 88]
CHANGELOG.md: 69: MD013/line-length Line length [Expected: 80; Actual: 90]
CHANGELOG.md: 133: MD013/line-length Line length [Expected: 80; Actual: 86]
CHANGELOG.md: 144: MD038/no-space-in-code Spaces inside code span elements [Context: "` KubeConfigFile`"]
CHANGELOG.md: 178: MD013/line-length Line length [Expected: 80; Actual: 95]
CHANGELOG.md: 214: MD012/no-multiple-blanks Multiple consecutive blank lines [Expected: 1; Actual: 2]
@akutz
akutz / machine-controller-reconcile.puml
Created July 11, 2019 15:38
CAPV Machine Reconcile Workflow
@startuml machine-controller-reconcile
start;
:Machine controller;
repeat
:Reconcile;
if (Machine has a TaskRef) then (yes)
$ docker run -it --rm --cpus=1.5 akutz/capi-1104 /bin/bash -c 'while make test-go; do sleep 1; done'
Unable to find image 'akutz/capi-1104:latest' locally
latest: Pulling from akutz/capi-1104
6f2f362378c5: Pull complete
494c27a8a6b8: Pull complete
7596bb83081b: Pull complete
372744b62d49: Pull complete
0658c6765517: Pull complete
fc2529ce2b56: Pull complete
c9a1ca7e4a49: Pull complete
$ git log --oneline -1 && printf '\n\n' && { { ./scripts/ci-test.sh && printf '\nSUCCESS!\n'; } || printf '\nFAILED!\n'; }
1e0421912 (HEAD -> pires/fix_1104, pires/pires/fix_1104) Don't swallow errors when reconciling noderef
fetching tools
x kubebuilder/
x kubebuilder/bin/
x kubebuilder/bin/etcd
x kubebuilder/bin/kubectl
x kubebuilder/bin/kube-apiserver
[init] Using Kubernetes version: v1.14.1
[preflight] Running pre-flight checks
[preflight] Pulling images required for setting up a Kubernetes cluster
[preflight] This might take a minute or two, depending on the speed of your internet connection
[preflight] You can also perform this action in beforehand using 'kubeadm config images pull'
[kubelet-start] Writing kubelet environment file with flags to file "/var/lib/kubelet/kubeadm-flags.env"
[kubelet-start] Writing kubelet configuration to file "/var/lib/kubelet/config.yaml"
[kubelet-start] Activating the kubelet service
[certs] Using certificateDir folder "/etc/kubernetes/pki"
[certs] Generating "ca" certificate and key