Skip to content

Instantly share code, notes, and snippets.

View bshephar's full-sized avatar

Brendan Shephard bshephar

View GitHub Profile
# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc.
# Initialization code that may require console input (password prompts, [y/n]
# confirmations, etc.) must go above this block; everything else may go below.
if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then
source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
fi
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH
❯ cat install-config.yaml
apiVersion: v1
baseDomain: bne-shift.net
compute:
- hyperthreading: Enabled
name: worker
replicas: 0
controlPlane:
hyperthreading: Enabled
name: master
@bshephar
bshephar / generics
Created June 15, 2023 11:42
Trying to use generics instead of two seperate functions that do exactly the same thing
type GenericDataPlaneObject interface {
*dataplanev1beta1.OpenStackDataPlaneRole | *dataplanev1beta1.OpenStackDataPlaneNode
}
// removeControllerManagedAnnotations will check for and remove annotations on Role objects that are managed by a OpenStackDataPlane controller.
func removeControllerManagedAnnotations[T GenericDataPlaneObject](ctx context.Context, instance T, helper *helper.Helper, annotation map[string]string) error {
client := helper.GetClient()
// Get all of the current annotations
annotations := instance.ObjectMeta.GetAnnotations()