Skip to content

Instantly share code, notes, and snippets.

@glyn
glyn / terminal.txt
Created March 10, 2020 14:51
How to get chrome to provide checkbox to allow external protocol dialog to be accepted by default
defaults write com.google.Chrome ExternalProtocolDialogShowAlwaysOpenCheckbox -bool true
@glyn
glyn / console.txt
Created February 25, 2020 10:30
duck typed find and replace using gojq
cat scratch/deployment.yaml | ./gojq --yaml-input --yaml-output '(..|.spec?.containers|values[].image| select(. == "nginx"))|="banana"'
apiVersion: apps/v1
kind: Deployment
metadata:
name: sample-deployment
spec:
template:
spec:
containers:
- image: banana
@glyn
glyn / cert-manager.yaml
Last active February 13, 2020 15:06
Missed images
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
name: certificaterequests.cert-manager.io
spec:
additionalPrinterColumns:
- JSONPath: .status.conditions[?(@.type=="Ready")].status
name: Ready
type: string
- JSONPath: .spec.issuerRef.name
@glyn
glyn / kpack-extract.yaml
Created February 12, 2020 11:57
k8s-manifest-scanner failure to detect all images in https://storage.googleapis.com/projectriff/release/0.5.0/kpack.yaml
...
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: kpack-controller
namespace: kpack
spec:
replicas: 1
selector:
@glyn
glyn / terminal.out
Created February 12, 2020 09:06
kpack scanning example
$ GO111MODULE=off go run github.com/projectriff/k8s-manifest-scanner/cmd/k8s-manifest-scanner scan https://raw.githubusercontent.com/pivotal/kpack/master/samples/experimental/store.yaml
[
"cloudfoundry/cnb:bionic",
"gcr.io/cf-build-service-public/node-engine-buildpackage@sha256:95ff756f0ef0e026440a8523f4bab02fd8b45dc1a8a3a7ba063cefdba5cb9493",
"gcr.io/cf-build-service-public/npm-buildpackage@sha256:5058ceb9a562ec647ea5a41008b0d11e32a56e13e8c9ec20c4db63d220373e33"
]
@glyn
glyn / gen-manifest.yaml
Created February 11, 2020 15:02
sheaf gen-manifest output for riff
This file has been truncated, but you can view the full file.
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
name: certificaterequests.cert-manager.io
spec:
additionalPrinterColumns:
- JSONPath: .status.conditions[?(@.type=="Ready")].status
name: Ready
type: string
- JSONPath: .spec.issuerRef.name
@glyn
glyn / octant.txt
Created November 25, 2019 21:59
Prefix of output of octant -v
octant -v
2019-11-25T21:57:29.319Z DEBUG commands/dash.go:70 disable-open-browser: %!s(bool=false)
2019-11-25T21:57:29.319Z DEBUG dash/dash.go:68 Loading configuration: /Users/glyn/.kube/config
2019-11-25T21:57:29.324Z DEBUG cluster/cluster.go:260 initializing REST client configuration {"client-qps": 200, "client-burst": 400}
2019-11-25T21:57:29.325Z DEBUG cluster/cluster.go:107 created temp directory {"component": "cluster client", "dir": "/var/folders/92/71dm5l157sldq4hjqm5k94tm0000gr/T/octant496471761"}
2019-11-25T21:57:29.325Z DEBUG dash/dash.go:96 initial namespace for dashboard is default
2019-11-25T21:57:29.328Z DEBUG describer/path_matcher.go:44 register path {"name": "overview", "path": "/?"}
2019-11-25T21:57:29.328Z DEBUG describer/path_matcher.go:44 register path {"name": "overview", "path": "/workloads"}
2019-11-25T21:57:29.328Z DEBUG describer/path_matcher.go:44 register path {"name": "overview", "path": "/workloads/cron-jobs"}
2019-11-25T21:57:29.328Z DEBUG describer/path_matcher.go:44 register
@glyn
glyn / console.txt
Created November 20, 2019 17:07
Integration test failure
make test
/Users/glyn/go/bin/controller-gen object:headerFile=./hack/boilerplate.go.txt paths="./..."
go fmt ./...
go vet ./...
/Users/glyn/go/bin/controller-gen "crd:trivialVersions=true" rbac:roleName=manager-role webhook paths="./..." output:crd:artifacts:config=config/crd/bases
ginkgo -r -nodes=1 -coverprofile cover.out
[1574268149] Controller Suite - 20/20 specs •
------------------------------
• Failure in Spec Setup (BeforeEach) [0.021 seconds]
Integration Test when an image map is created [BeforeEach] when the image map is deleted should remove the image map from the composite
@glyn
glyn / registry-cnab-relocation.md
Last active August 6, 2019 15:11
Image relocation and storing bundles in repositories

[WORK IN PROGRESS] Image relocation and storing bundles in repositories

This document explores how image relocation should work when bundles are stored in docker/OCI repositories. But first, let's take a look at a simple example of image relocation where the bundle is not stored in a repository. If you aren't familiar with image relocation, read duffle's guide.

Relocation of a bundle not stored in a repository

Sometimes a bundle "knows" about some (“original”) image references. For example, a bundle may contain kubernetes resource files (i.e. YAML) referring to specific images. After image relocation, typically to a private registry, the invocation image needs to be able to substitute the relocated image references for the original image references.

Let's take a simple example. Suppose bundle A declares a single image in addition to an invocation image:

@glyn
glyn / CNAB.md
Last active August 1, 2019 19:05
Distribution, relocation, content addressing, and signing considerations for CNAB core

[WORK IN PROGRESS] Distribution, relocation, content addressing, and signing considerations for CNAB core

Introduction

CNAB core is currently attempting to stabilise for v1.0, but several issues are unresolved around distribution, relocation, and signing. This document attempts to summarise the issues and suggest some next steps, both in the spec and in the duffle reference implementation.

Distribution

One of CNAB's primary design goals is to make packages easily portable in a wide range of scenarios. So we should (or even must) support moving thin and thick bundles independently of a registry. It should be possible to distribute both thin and thick bundles by conventional means, such as file transfer or USB stick. Distribution via a registry also has its advantages. Here are some of the ways a CNAB may be distributed: