Skip to content

Instantly share code, notes, and snippets.

View odra's full-sized avatar
💻

odra odra

💻
  • São Paulo, Brazil
View GitHub Profile
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)
-
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
@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/*"`
@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 / 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 / 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 / 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
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 / template.yaml
Created April 18, 2019 11:03
testtemplate
---
apiVersion: v1
kind: Template
labels:
template: ionic-showcase-server
metadata:
name: mobile-develope-services-dataSync-demo-server
annotations:
openshift.io/display-name: Mobile Developer Services Data Sync Example
@odra
odra / start.md
Created May 12, 2019 17:17
knative getting started

Kubernetes Cluster

Istio

Install istio from resource files:

#Install istio components
kubectl apply -f https://storage.googleapis.com/knative-releases/serving/latest/istio.yaml
#Check and wait for istio pod readiness