Stupid Finalizers

Stupid Finalizers

Build

go build

Run

# List all objects blocked by a finalizer
./finalizers

# List all objects with finalizers
./finalizers --all

Example

./finalizers

NAMESPACE   NAME                    APIVERSION                KIND                         FINALIZERS
p-nf5gh     creator-project-owner   management.cattle.io/v3   ProjectRoleTemplateBinding   [controller.cattle.io/mgmt-auth-prtb-controller]
Comments
  • Add exclude window

    Add exclude window

    In order to use this library in automation it could be useful to exclude objects that have been deleted within a certain window. For instance if the longest time I can expect clean up functions to take is 4 hours, then I only want to list objects that have a deleted time older than 4 hours from now.

    • adds new ExcludeSinceWindow flag which accepts Time.Duration
    • IsDeleted() takes an excludes window
  • Bump sys module to fix darwin_arm64 build errors

    Bump sys module to fix darwin_arm64 build errors

    This currently fails to build on Apple Silicon-based Macs with an error along the lines of the following:

    /Users/nick/src/golang/pkg/mod/golang.org/x/[email protected]/unix/zsyscall_darwin_arm64.go:105:3: //go:linkname must refer to declared function or variable
    /Users/nick/src/golang/pkg/mod/golang.org/x/[email protected]/unix/zsyscall_darwin_arm64.go:121:3: //go:linkname must refer to declared function or variable
    /Users/nick/src/golang/pkg/mod/golang.org/x/[email protected]/unix/zsyscall_darwin_arm64.go:121:3: too many errors
    

    Bumping the sys module fixes the issue and builds successfully.

  • Add initial goreleaser to create plugin binary

    Add initial goreleaser to create plugin binary

    Adds initial bits to publish as a Kubernetes plugin using goreleaser and krew.

    Action is triggered when a release is cut (vX.Y.Z), goreleaser runs and uploads the archives.

    If you're interested in this, then I'd be happy to submit a PR to the krew index to start making this available

    Resolves #3

  • finalizers isn't namespace aware

    finalizers isn't namespace aware

    listing all finalizers works fine (via -a)

    finalizers -a | grep logging
    logging            datadir-scylladb-0                                                     v1                               PersistentVolumeClaim   [kubernetes.io/pvc-protection]
    logging            datadir-scylladb-1                                                     v1                               PersistentVolumeClaim   [kubernetes.io/pvc-protection]
    logging            datadir-scylladb-2                                                     v1                               PersistentVolumeClaim   [kubernetes.io/pvc-protection]
    

    but filtering on a specific namespace doesn't work

    finalizers -n logging
    NAMESPACE   NAME      APIVERSION   KIND      FINALIZERS
    
  • finalizers as kubectl plugin (via krew)

    finalizers as kubectl plugin (via krew)

    for now it's only required to renaming the finalizers binary to kubectl-finalizers to work/use finalizers via kubectl (as plugin).

    kubectl finalizers -a                                                                                                                                                                                                                                                    
    NAMESPACE          NAME                                                                   APIVERSION                       KIND                    FINALIZERS                                                              
                       v1alpha1.snapshot.storage.k8s.io                                       apiregistration.k8s.io/v1beta1   APIService              [foregroundDeletion]                                                    
                       v1alpha1.snapshot.storage.k8s.io                                       apiregistration.k8s.io/v1        APIService              [foregroundDeletion]                                                    
    logging            datadir-scylladb-0                                                     v1                               PersistentVolumeClaim   [kubernetes.io/pvc-protection]                                          
    logging            datadir-scylladb-1                                                     v1                               PersistentVolumeClaim   [kubernetes.io/pvc-protection]                                          
    logging            datadir-scylladb-2                                                     v1                               PersistentVolumeClaim   [kubernetes.io/pvc-protection]
    ...
                       csi-005fbe019be01aabd67884654875863a4f1a916ebf96765cdc6f1b2e240xxxx   storage.k8s.io/v1                VolumeAttachment        [external-attacher/cinder-csi-openstack-org]                                                                             
                       csi-01b1f2dd04c217cbd1a09cc10d054ba2d76cda59b7a20dbafc7235dd7867xxxx   storage.k8s.io/v1                VolumeAttachment        [external-attacher/cinder-csi-openstack-org]                                                                             
                       csi-051607d95569d169cde631f8f2d9441dd0d5cd145452c14da6c2c8e36325xxxx   storage.k8s.io/v1                VolumeAttachment        [external-attacher/cinder-csi-openstack-org]
    

    Do you agree with the preparation of the code to fulfill all the requirements for a kubectl plugin?

Quantum it simple, stupid

qiss qiss is a toy application exploring the integration of post-quantum cryptography into certificate verification during a TLS connection. It adds a

Dec 14, 2021
Stupid hacky script + program for visualising Discord mutual friends
Stupid hacky script + program for visualising Discord mutual friends

discord-mutual-friends jank script and program for generating a .dot file for visualisation of mutual friends in Discord $ chmod +x ./relationship.sh

Nov 11, 2022