This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| serviceAccountName := "" | |
| if claims, ok := jwtToken.Claims.(jwt.MapClaims); ok { | |
| for key, value := range claims { | |
| if key == "kubernetes.io" { | |
| if k8sClaims, ok := value.(map[string]interface{}); ok { | |
| for k, v := range k8sClaims { | |
| if k == "serviceaccount" { | |
| if saClaims, ok := v.(map[string]interface{}); ok { | |
| for k, v := range saClaims { | |
| if k == "name" { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| set -x | |
| set -e | |
| set -o pipefail | |
| cd $GOPATH/src/k8s.io/cloud-provider-openstack | |
| mkdir -p /var/log/csi-pod | |
| # TODO(chrigl): No idea why both tests fail in CI. On a real OpenStack both pass. | |
| /tmp/kubernetes/test/bin/e2e.test \ | |
| -storage.testdriver=tests/e2e/csi/cinder/test-driver.yaml \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ❯ mkdir exporter-test | |
| ❯ cd exporter-test | |
| ❯ gh repo clone gecio/openvswitch_exporter | |
| ❯ sed -i 's#gecio#digitalocean#' internal/ovsexporter/ovsexporter_gec.go | |
| ❯ sed -i 's#gecio#digitalocean#' cmd/openvswitch_exporter/main.go | |
| ❯ sed -i 's#gecio#digitalocean#' internal/ovsexporter/dumpports.go | |
| ❯ git diff | |
| diff --git a/cmd/openvswitch_exporter/main.go b/cmd/openvswitch_exporter/main.go |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Habe alle gecio referenzen im code zurück auf digitalocean gesetzt und... | |
| go mod edit -replace github.com/digitalocean/go-openvswitch=github.com/gecio/go-openvswitch@master |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| gh repo clone digitalocean/openvswitch_exporter | |
| gh repo clone gecio/go-openvswitch | |
| go work init go-openvswitch/ | |
| go work use openvswitch_exporter/ | |
| cd openvswitch_exporter/ | |
| go build cmd/openvswitch_exporter/main.go |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # This script shuts down a rook-ceph cluster | |
| # Please DON'T use this. It is only for demonstration purposes. | |
| set -eux -o pipefail | |
| force=false | |
| while getopts "f" arg; do | |
| case $arg in | |
| f) | |
| force=true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| apiVersion: apps/v1 | |
| kind: DaemonSet | |
| metadata: | |
| labels: | |
| app: debugging | |
| name: debugging | |
| spec: | |
| revisionHistoryLimit: 2 | |
| selector: | |
| matchLabels: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| apiVersion: v1 | |
| kind: ServiceAccount | |
| metadata: | |
| name: oc-admin | |
| namespace: default | |
| --- | |
| apiVersion: rbac.authorization.k8s.io/v1 | |
| kind: ClusterRoleBinding | |
| metadata: | |
| name: oc-admin |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| import ( | |
| "fmt" | |
| "log" | |
| "github.com/gophercloud/gophercloud" | |
| "github.com/gophercloud/gophercloud/openstack" | |
| "github.com/gophercloud/gophercloud/openstack/compute/v2/servers" | |
| "github.com/gophercloud/utils/openstack/clientconfig" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| import ( | |
| "flag" | |
| "fmt" | |
| "log" | |
| "os" | |
| "os/user" | |
| "path/filepath" |
NewerOlder