Skip to content

Instantly share code, notes, and snippets.

View odra's full-sized avatar
💻

odra odra

💻
  • São Paulo, Brazil
View GitHub Profile
package v1alpha1
import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime/schema"
)
// EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN!
// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized.
@odra
odra / delete-enmasse-crds.sh
Last active July 2, 2019 07:27
integreatly commands
#!/bin/bash
for name in `oc get crd -oname | grep enmasse`; do oc delete $name; done
@odra
odra / user.yml
Created February 13, 2019 09:42
user module
#creates a new user
integreatly_user:
username: myuser
password: 12345
email: [email protected]
state: present
#removes an user
integreatly_user:
username: myuser
@odra
odra / hacks.sh
Last active December 20, 2018 12:30
integreatly release-1.0.3 hacks
#patch the correct launcher frontend image after the first installation
oc patch -n launcher deploymentconfig launcher-frontend --patch '{"spec":{"template":{"spec":{"containers":[{"name":"launcher-frontend","image":"fabric8/launcher-frontend:a00064f"}]}}}}'
#changing usernames requires both email and usernames to use e-mail formatted string
ansible-playbook \
-i inventories/hosts \
playbooks/install.yml \
-e rhsso_seed_users_name_format=user%[email protected] \
-e rhsso_seed_users_email_format=user%[email protected] \
-e rhsso_seed_users_password=openshift
@odra
odra / config.yaml
Created November 29, 2018 15:26
version checker
integreatly:
channels:
- name: trello sender
kind: trello
spec:
token: my-api-token
template: /path/to/template
board: trello-board-id-or-name
vars: ["title", "tags"]
releases:
@odra
odra / go basic
Created November 29, 2018 11:25
makefiles
SHELL = /bin/bash
setup/dep:
@dep ensure -v
code/check:
@diff -u <(echo -n) <(gofmt -d `find . -type f -name '*.go' -not -path "./vendor/*"`)
code/fix:
@gofmt -w `find . -type f -name '*.go' -not -path "./vendor/*"`
-
name: Set apicurio client id var
set_fact:
apicurio_kc_client: "{{ item.id }}"
with_items: "{{ (sso_kc_realm_cmd.stdout | from_json).spec.clients }}"
when: item.id == apicurio_kc_client_id
-
name: Inject apicurio client in CR if it does not exist
shell: "oc patch keycloakrealm {{ apicurio_kc_realm }} -n {{ apicurio_keycloak_namespace }} --type=json -p '[{\"op\": \"add\", \"path\": \"/spec/clients/-\", \"value\": {{ lookup('file', apicurio_kc_cient_json_path) }}}]'"
register: result
func register() error {
var err error
keycloakList := &v1alpha1.KeycloakList{
TypeMeta: metav1.TypeMeta{
Kind: v1alpha1.KeycloakKind,
APIVersion: v1alpha1.Group + "/" + v1alpha1.Version,
},
}
err = framework.AddToFrameworkScheme(v1alpha1.AddToScheme, keycloakList)
---
kind: Role
apiVersion: rbac.authorization.k8s.io/v1beta1
metadata:
name: leo-keycloak-operator
rules:
- apiGroups:
- aerogear.org
resources:
- "*"
@odra
odra / pg
Created November 21, 2018 15:20
pg_ctl: another server might be running; trying to start server anyway
waiting for server to start....LOG: redirecting log output to logging collector process
HINT: Future log output will appear in directory "pg_log".
done
server started
=> sourcing /usr/share/container-scripts/postgresql/start/set_passwords.sh ...
ERROR: role "userAJT" does not exist