Skip to content

Instantly share code, notes, and snippets.


Nick Boldt nickboldt

View GitHub Profile
nickboldt /
Last active May 12, 2021
get related images from a given CSV as list of sorted/unique images, or name=value;name2=value2... pairs to use in KIP configmap
# CRW 2.8
# Re:
# Example 8.1. Getting the list of all relevant images for CodeReady Workspaces
# for list of containers only
curl -sSLo- | \
yq -r '.spec.install.spec.deployments[].spec.template.spec.containers[].env[] | select(.name | test("RELATED_IMAGE_.*"; "g")) | .value' | \
sort -u
View gist:c38ea07145f4e096293fd2edf0c90a04
brew list-tagged crw-2-rhel-8-container-candidate | grep operator-metadata
brew untag crw-2-rhel-8-container-candidate \
codeready-workspaces-rhel8-operator-metadata-container-2.8-23 \
codeready-workspaces-rhel8-operator-metadata-container-2.8-25 \
# ...
nickboldt / go.cheat.adoc
Last active Apr 9, 2021
go cheat sheet
View go.cheat.adoc

get latest deps into a vendor/ folder:

go mod tidy || true; go get -d -t || true; go mod download || true; go mod vendor || true

go build options:

-mod=readonly == break if go.mod not current w.r.t. vendor folder (online mode)
nickboldt /
Created Jan 29, 2021
check rpms installed in a container (or diff two containers)
# copied from a jenkins job last used in Dec 2019 for CRW 2.0
alias dr='docker run --rm --entrypoint /bin/bash'
if [[ ${CONTAINER1} ]]; then
dr ${CONTAINER1} -c "rpm -qa | sort" | tee CONTAINER1.installed.rpms.txt &
if [[ ${CONTAINER2} ]]; then
dr ${CONTAINER2} -c "rpm -qa | sort" | tee CONTAINER2.installed.rpms.txt &
nickboldt /
Created Jan 22, 2021 :: get server + registry images from an OCP 4.x CRW 2.x deployment and compare those digests to the latest in Quay
function obtainPodName(){
local podPartialName=$1
echo "$(oc get pods -n $NAMESPACE | grep $podPartialName | awk '{print $1;}' | awk 'NR==1{print $1}')"
nickboldt / pr1.yaml
Last active Dec 2, 2020
2 ways to do github action to authenticate against
View pr1.yaml
name: Test crw-build token for authenticated connection to RHEC (option 1)
# note, this only works against pull requests from the origin fork (redhat-developer, eclipse), not from personal forks,
# as secrets cannot be copied to user forks and end up being blank
on: [pull_request]
runs-on: ubuntu-18.04
- name: Checkout code
nickboldt / crwctldeploy2
Last active Aug 21, 2020
installing CRW 2.3 via operatorhub / olm method v2, based on
View crwctldeploy2
set +e +x
tmpdir=$(mktemp -d)
crw-2-rhel8-operator-metadata \
devfileregistry-rhel8 \
pluginregistry-rhel8 \
server-rhel8 \
nickboldt /
Last active Jul 29, 2020
create a custom catalog index in quay for use when deploying CRW 2.3 via crwctl server:start -a olm
# create a custom catalog for CRW 2.3 operator metadata
cd /tmp
if [[ ! -x /usr/local/bin/opm ]]; then
echo "Download opm binary from ${OPM_image}"
oc image extract ${OPM_image} --path /usr/bin/opm:/tmp --confirm
chmod +x /tmp/opm
nickboldt / crwctldeploy
Last active Aug 21, 2020
installing CRW 2.3 via operatorhub / olm method
View crwctldeploy
set +e +x
# for a specific version, see either quay or redhat folders:
VER=2.3.0-CI # or specific release like 2.3.0-GA
CHANNEL="quay" # for CI, use Quay, for GA, use redhat
# set project namespace default