Skip to content

Instantly share code, notes, and snippets.

View dmage's full-sized avatar

Oleg Bulatov dmage

View GitHub Profile
package main
import (
"io"
"net/http"
"time"
)
type SlowDevNull struct {
interval time.Duration
@dmage
dmage / main.go
Created December 14, 2021 22:16
Broken registry
package main
import (
"fmt"
"log"
"net/http"
)
const (
alpineDigest = "sha256:e7d88de73db3d3fd9b2d63aa7f447a10fd0220b7cbf39803c803f2af9ba256b3"
#!/bin/sh -eux
oc import-image --from=docker.io/library/nginx my-nginx --confirm --reference-policy=local
oc set image-lookup my-nginx
sleep 10
oc apply -f - <<EOF
apiVersion: apps.openshift.io/v1
kind: DeploymentConfig
package main
import (
"flag"
"fmt"
"io"
"log"
"net"
"net/http"
)
var groupingGroups = [
{
id: "bz1913069",
issueLink: "https://bugzilla.redhat.com/show_bug.cgi?id=1913069",
m: /spec\.containers\[0\]\.securityContext\.containers\[0\]\.hostPort: Invalid value: 1030[0-9]: Host ports are not allowed to be used/,
},
{
id: "googleapi-403-quota-exceeded",
m: /googleapi: Error 403: Quota exceeded for quota group/,
},
# oc create -f ./boater-probe.yaml
# oc -n openshift logs pod/boater-probe
---
apiVersion: v1
kind: Pod
metadata:
name: boater-probe
namespace: openshift
spec:
containers:
#!/bin/sh -eu
NAMESPACE=default
SERVICEACCOUNT=default
oc -n "$NAMESPACE" serviceaccounts new-token "$SERVICEACCOUNT"
NEW_SECRET_NAME=$(
oc get secrets \
--field-selector='type=kubernetes.io/service-account-token' \
kind: List
apiVersion: v1
items:
- apiVersion: v1
kind: ServiceAccount
metadata:
name: pruner
namespace: openshift-image-registry
- apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
@dmage
dmage / README.md
Last active February 25, 2019 09:42
Using "override" in OKD installer

Get a pull secret from https://cloud.openshift.com/clusters/install.

Copy a part of the secret that looks like

"quay.io":{"auth":"...","email":"..."}

and add it to your ~/.docker/config.json.

You also will need credentials for registry.svc.ci.openshift.org:

#!/bin/bash
set -eu
# Released into the Public Domain.
#
# Original implementation in C by Brad Conte (brad@bradconte.com) <https://github.com/B-Con/crypto-algorithms>
# Ported to Bash (lol) by Josh Junon (josh@junon.me) <https://github.com/qix->
#
# Original gist is https://gist.github.com/Qix-/affef08b50686e54e1f2ca18f97a6ff7
# Removed external utilities.