Skip to content

Instantly share code, notes, and snippets.

Crossplane Provider Migration to V2

This short document describes a way to migrate a Crossplane provider to crossplane-runtime v2 and add namespace-scoped managed resources. The described changes have been implemented in crossplane-contrib/provider-argocd#348.

Library upgrade

This is the shortest and easiest step. The runtime is most backwards compatible. Some things need to be changed, however. Most notably, the v1 resource.Managed property has been renamed to resource.LegacyManaged. The new namespace resource interface is resource.ModernManaged.

@MisterMX
MisterMX / host-browser
Created December 19, 2022 11:18
Open Host Browser through XDG in Virtualbox
#!/bin/sh
set -e
# NOTE: This must be in your BROWSER env var.
url="$1"
echo "Opening $1 in host browser"
curl -X POST "http://10.0.2.2:30999/browse?url=$url" -H "Content-Length: 0"
@MisterMX
MisterMX / bira-custom.zsh-theme
Created November 3, 2021 12:41
Customized Bira theme for zsh with custom kubens plugin
# Put this into $ZSH_CUSTOM/themes/
# ZSH Theme - Preview: https://gyazo.com/8becc8a7ed5ab54a0262a470555c3eed.png
local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})"
if [[ $UID -eq 0 ]]; then
local user_host='%{$terminfo[bold]$fg[red]%}%n@%m %{$reset_color%}'
local user_symbol='#'
else
local user_host='%{$terminfo[bold]$fg[green]%}%n@%m %{$reset_color%}'
@MisterMX
MisterMX / run-proxy.sh
Last active November 13, 2019 07:37
PX corporate proxy switch
#!/usr/bin/env bash
# This will run a proxy for Docker on windows. The proxy can be accessed inside a container at host.docker.internal:3128.
# The proxy automatically authenticates against a corporate proxy using the windows network stack (no credentials required).
# If the real proxy is not available it will fall back to a simple request forwareder to provide compatibility
# with already configured docker containers and applications.
# https://github.com/genotrance/px
PROXY_URL=<your-corporate-proxy>
curl -s -o /dev/null $PROXY_URL
@MisterMX
MisterMX / inno-space.theme
Created May 4, 2019 01:39
Inno Space Slack theme
#FFFFFF,#F9F9F9,#F9F9F9,#888888,#F9F9F9,#999999,#F39200,#F39200
@MisterMX
MisterMX / visual-studio.theme
Last active May 1, 2019 08:00
Visual Studio style Slack theme
#F5F5F5,#C9DEF5,#EEEEF2,#007ACC,#EEEEF2,#1E1E1E,#0E70C0,#E5C365
@MisterMX
MisterMX / loading-indicator.css
Last active March 16, 2019 19:12
CSS SVG loading indicator
.container {
width: 50px;
height: 50px;
}
.path {
stroke: green;
fill: transparent;
stroke-width: 1px;
stroke-dasharray: 100%;
@MisterMX
MisterMX / mission_intro_text.sqf
Last active October 15, 2017 19:26
Displays a fancy text in the bottom left corner.
_year = date select 0;
_month = date select 1;
_day = date select 2;
_date = format ["%1\%2\%3", _month, _day, _year];
[
[
["My Mission Name", "align = 'left' shadow = '1' size = '0.8' font='PuristaBold'", "#FFCC00"],
["", "<br/>"],
["Location, Country", "align = 'left' shadow = '1' size = '0.8'"],