Skip to content

Instantly share code, notes, and snippets.

View Skarlso's full-sized avatar
🏠
Working from home

Gergely Brautigam Skarlso

🏠
Working from home
View GitHub Profile
apiVersion: cluster.x-k8s.io/v1beta1
kind: Cluster
metadata:
name: capi-quickstart
namespace: default
spec:
clusterNetwork:
pods:
cidrBlocks:
- 192.168.0.0/16
@Skarlso
Skarlso / main.go
Created September 11, 2023 12:03
Downloading helm chart
package main
import (
"fmt"
"log"
"os"
"github.com/open-component-model/ocm/pkg/contexts/ocm"
"github.com/open-component-model/ocm/pkg/contexts/ocm/compdesc"
metav1 "github.com/open-component-model/ocm/pkg/contexts/ocm/compdesc/meta/v1"
# Title above here
# Use 50 characters maximum.
# Do not use a sentence-ending period.
#
# Prefixes:
#
# bump = bump version
# chore(subtype) = chore
# docs = documentation
# feat = new feature
.....................................................................................................
.....................................................................................................
.....................................................................................................
.....................................................................................................
.....................................................................................................
.....................................................................................................
.....................................................................................................
...........................................................................iiiiijjjj.................
..........................................................................ii.......j.................
..........................................................................i........j.................
2022/07/31 14:56:21 http: panic serving 10.244.0.1:2734: runtime error: invalid memory address or nil pointer dereference
goroutine 1836 [running]:
net/http.(*conn).serve.func1()
/usr/local/go/src/net/http/server.go:1825 +0xbf
panic({0x2229e20, 0x3f9c090})
/usr/local/go/src/runtime/panic.go:844 +0x258
encoding/json.(*encodeState).marshal.func1()
/usr/local/go/src/encoding/json/encode.go:328 +0x6e
panic({0x2229e20, 0x3f9c090})
/usr/local/go/src/runtime/panic.go:838 +0x207
@Skarlso
Skarlso / output.txt
Last active July 29, 2022 13:54
Create Pod and get logs of the running container
go run main.go
creating pod, then creating a container...
pod created... waiting for it to be running
Pod status: Pending
Pod status: Pending
Pod status: Running
watcher stopped
Got container logs: /docker-entrypoint.sh: /docker-entrypoint.d/ is not empty, will attempt to perform configuration
/docker-entrypoint.sh: Looking for shell scripts in /docker-entrypoint.d/
/docker-entrypoint.sh: Launching /docker-entrypoint.d/10-listen-on-ipv6-by-default.sh
package main
import (
"context"
"fmt"
"io/ioutil"
"log"
"os"
"time"
@Skarlso
Skarlso / local-kind-cluster.sh
Created January 22, 2022 15:21
Local test kind cluster with registry
#!/bin/bash
set -o errexit
create() {
set +e
kind get clusters | grep "${NAME}"
exitCode=$?
set -e
if [ $exitCode -eq "0" ]; then
echo "kind cluster already exists"
@Skarlso
Skarlso / graph.go
Last active December 31, 2021 10:07
Generic Graph Implementation
// BFS returns the shortest path between two nodes,
// as a list of edges. Eq is used to determine parity between nodes. The Eq functions makes
// this function generic enough instead of trying to shoehorn some other `comparable` type
// into `Node`.
// Note, this would be much more user-friendly, if it would return a map of `cameFrom`s which
// then could be traversed back to find the shortest path, rather than returning a slice of
// edges which is difficult to follow back.
func (g *Graph[Node, Edge]) BFS(from, to Node, eq func(self, other Node) bool) []Edge {
queue := []Node{from}
path := make([]Edge, 0)
@Skarlso
Skarlso / log.log
Created November 30, 2021 08:20
Log output
➜ test-set-label-config-file eksctl set labels --nodegroup ng-1 --cluster test-set-labels-5 --labels asdf=asdf
2021-11-29 22:03:37 [ℹ] eksctl version 0.77.0-dev+32cdc500.2021-11-29T22:02:28Z
2021-11-29 22:03:37 [ℹ] using region us-west-2
2021-11-29 22:03:37 [ℹ] setting label(s) on nodegroup ng-1 in cluster test-set-labels-5.us-west-2.eksctl.io
2021-11-29 22:03:39 [ℹ] updating nodegroup stack
2021-11-29 22:03:40 [ℹ] waiting for CloudFormation changeset "eksctl-update-nodegroup-1638219819" for stack "eksctl-test-set-labels-5-nodegroup-ng-1"
2021-11-29 22:03:56 [ℹ] waiting for CloudFormation changeset "eksctl-update-nodegroup-1638219819" for stack "eksctl-test-set-labels-5-nodegroup-ng-1"
2021-11-29 22:03:58 [ℹ] waiting for CloudFormation stack "eksctl-test-set-labels-5-nodegroup-ng-1"
2021-11-29 22:04:16 [ℹ] waiting for CloudFormation stack "eksctl-test-set-labels-5-nodegroup-ng-1"
2021-11-29 22:04:37 [ℹ] waiting for CloudFormation stack "eksctl-test-set-labels-5-nodegroup-ng-1"