Update labels. Update relam display name
parent
ee7364a153
commit
c40ebd530a
|
|
@ -4,7 +4,8 @@
|
|||
--password $keycloakAdminPassword \
|
||||
$trustStoreCommandArg \
|
||||
&& /opt/eap/bin/kcadm.sh update realms/master -s sslRequired=none $trustStoreCommandArg \
|
||||
&& /opt/eap/bin/kcadm.sh create realms -s realm=$keycloakRealm \
|
||||
&& /opt/eap/bin/kcadm.sh create realms -s realm='$keycloakRealm' \
|
||||
-s displayName='Codeready Workspaces' \
|
||||
-s enabled=true \
|
||||
-s sslRequired=none \
|
||||
-s registrationAllowed=true \
|
||||
|
|
@ -13,7 +14,7 @@
|
|||
-s adminTheme=$keycloakTheme \
|
||||
-s emailTheme=$keycloakTheme \
|
||||
$trustStoreCommandArg \
|
||||
&& /opt/eap/bin/kcadm.sh create clients -r $keycloakRealm \
|
||||
&& /opt/eap/bin/kcadm.sh create clients -r '$keycloakRealm' \
|
||||
-s clientId=$keycloakClientId \
|
||||
-s 'webOrigins=["$protocol://$cheHost"]' \
|
||||
-s 'redirectUris=["$protocol://$cheHost/*"]' \
|
||||
|
|
@ -21,13 +22,13 @@
|
|||
-s publicClient=true $trustStoreCommandArg \
|
||||
&& /opt/eap/bin/kcadm.sh create users -s username=admin \
|
||||
-s email=\"admin@admin.com\" \
|
||||
-s enabled=true -r $keycloakRealm \
|
||||
-s enabled=true -r '$keycloakRealm' \
|
||||
-s 'requiredActions=[$requiredActions]' \
|
||||
$trustStoreCommandArg \
|
||||
&& /opt/eap/bin/kcadm.sh set-password -r $keycloakRealm --username admin \
|
||||
&& /opt/eap/bin/kcadm.sh set-password -r '$keycloakRealm' --username admin \
|
||||
--new-password admin \
|
||||
$trustStoreCommandArg \
|
||||
&& /opt/eap/bin/kcadm.sh add-roles -r $keycloakRealm \
|
||||
&& /opt/eap/bin/kcadm.sh add-roles -r '$keycloakRealm' \
|
||||
--uusername admin \
|
||||
--cclientid broker \
|
||||
--rolename read-token \
|
||||
|
|
|
|||
|
|
@ -29,7 +29,6 @@ func addMap(a map[string]string, b map[string]string) {
|
|||
|
||||
func newCheConfigMap(cheHost string, keycloakURL string) *corev1.ConfigMap {
|
||||
infra := util.GetInfra()
|
||||
cheLabels := map[string]string{"app": "che"}
|
||||
openshiftOAuth := util.GetEnvBool("CHE_OPENSHIFT_OAUTH", false)
|
||||
ingressDomain := util.GetEnv("CHE_INFRA_KUBERNETES_INGRESS_DOMAIN", "")
|
||||
strategy := util.GetEnv("CHE_INFRA_KUBERNETES_SERVER__STRATEGY", "multi-host")
|
||||
|
|
|
|||
|
|
@ -21,7 +21,6 @@ import (
|
|||
)
|
||||
|
||||
func newRoleBinding(kind string,name string, serviceAccountName string, roleName string, roleKind string) *rbac.RoleBinding {
|
||||
labels := map[string]string{"app": "che"}
|
||||
return &rbac.RoleBinding{
|
||||
TypeMeta: metav1.TypeMeta{
|
||||
Kind: kind,
|
||||
|
|
@ -30,7 +29,7 @@ func newRoleBinding(kind string,name string, serviceAccountName string, roleName
|
|||
ObjectMeta: metav1.ObjectMeta{
|
||||
Name: name,
|
||||
Namespace: namespace,
|
||||
Labels: labels,
|
||||
Labels: cheLabels,
|
||||
|
||||
},
|
||||
Subjects: []rbac.Subject{
|
||||
|
|
|
|||
|
|
@ -20,7 +20,6 @@ import (
|
|||
)
|
||||
|
||||
func newServiceAccount(name string) *corev1.ServiceAccount {
|
||||
labels := map[string]string{"app": "che"}
|
||||
return &corev1.ServiceAccount{
|
||||
TypeMeta: metav1.TypeMeta{
|
||||
Kind: "ServiceAccount",
|
||||
|
|
@ -29,7 +28,7 @@ func newServiceAccount(name string) *corev1.ServiceAccount {
|
|||
ObjectMeta: metav1.ObjectMeta{
|
||||
Name: name,
|
||||
Namespace: namespace,
|
||||
Labels: labels,
|
||||
Labels: cheLabels,
|
||||
|
||||
},
|
||||
}
|
||||
|
|
|
|||
|
|
@ -24,7 +24,6 @@ import (
|
|||
)
|
||||
|
||||
func newCheDeployment(cheImage string) *appsv1.Deployment {
|
||||
cheLabels := map[string]string{"app": "che"}
|
||||
optionalEnv := true
|
||||
return &appsv1.Deployment{
|
||||
TypeMeta: metav1.TypeMeta{
|
||||
|
|
@ -32,7 +31,7 @@ func newCheDeployment(cheImage string) *appsv1.Deployment {
|
|||
APIVersion: "apps/v1",
|
||||
},
|
||||
ObjectMeta: metav1.ObjectMeta{
|
||||
Name: "che",
|
||||
Name: cheFlavor,
|
||||
Namespace: namespace,
|
||||
Labels: cheLabels,
|
||||
},
|
||||
|
|
@ -49,7 +48,7 @@ func newCheDeployment(cheImage string) *appsv1.Deployment {
|
|||
ServiceAccountName: "che",
|
||||
Containers: []corev1.Container{
|
||||
{
|
||||
Name: "che",
|
||||
Name: cheFlavor,
|
||||
ImagePullPolicy: corev1.PullIfNotPresent,
|
||||
Image: cheImage,
|
||||
Ports: []corev1.ContainerPort{
|
||||
|
|
|
|||
|
|
@ -199,6 +199,9 @@ func CreateKeycloakDeployment() (*appsv1.Deployment, error) {
|
|||
|
||||
func GetKeycloakProvisionCommand(keycloakURL string, cheHost string) (command string) {
|
||||
openShiftApiUrl := util.GetEnv("CHE_OPENSHIFT_API_URL", "")
|
||||
//if cheFlavor == "codeready" {
|
||||
// keycloakRealm = "codeready%20workspaces"
|
||||
//}
|
||||
requiredActions := ""
|
||||
if updateAdminPassword {
|
||||
requiredActions = "\"UPDATE_PASSWORD\""
|
||||
|
|
|
|||
|
|
@ -162,7 +162,7 @@ func (o *k8s) ExecToPod(command []string, podName, namespace string) (string, st
|
|||
func (o *k8s) GetDeploymentPod(name string) (podName string) {
|
||||
api := o.clientset.CoreV1()
|
||||
listOptions := metav1.ListOptions{
|
||||
LabelSelector: "app=" + name,
|
||||
LabelSelector: "component=" + name,
|
||||
}
|
||||
podList, _ := api.Pods(namespace).List(listOptions)
|
||||
podListItems := podList.Items
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ func TestGetDeploymentPod(t *testing.T) {
|
|||
Name: "fake-pod",
|
||||
Namespace: "eclipse-che",
|
||||
Labels: map[string]string{
|
||||
"app": "postgres",
|
||||
"component": "postgres",
|
||||
},
|
||||
},
|
||||
})
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ func pvc(name string, pvcClaimSize string, labels map[string]string) *corev1.Per
|
|||
ObjectMeta: metav1.ObjectMeta{
|
||||
Name: name,
|
||||
Namespace: namespace,
|
||||
Labels: labels,
|
||||
Labels: cheLabels,
|
||||
|
||||
},
|
||||
Spec: corev1.PersistentVolumeClaimSpec{
|
||||
|
|
|
|||
|
|
@ -20,7 +20,6 @@ import (
|
|||
)
|
||||
|
||||
func newRole(name string, resources []string, verbs []string) *rbac.Role {
|
||||
labels := map[string]string{"app": "che"}
|
||||
return &rbac.Role{
|
||||
TypeMeta: metav1.TypeMeta{
|
||||
Kind: "Role",
|
||||
|
|
@ -29,7 +28,7 @@ func newRole(name string, resources []string, verbs []string) *rbac.Role {
|
|||
ObjectMeta: metav1.ObjectMeta{
|
||||
Name: name,
|
||||
Namespace: namespace,
|
||||
Labels: labels,
|
||||
Labels: cheLabels,
|
||||
},
|
||||
Rules: []rbac.PolicyRule{
|
||||
{
|
||||
|
|
|
|||
|
|
@ -69,7 +69,7 @@ var (
|
|||
|
||||
cheImage = util.GetEnv("CHE_IMAGE", "eclipse/che-server:latest")
|
||||
|
||||
postgresLabels = map[string]string{"app": "postgres"}
|
||||
keycloakLabels = map[string]string{"app": "keycloak"}
|
||||
cheLabels = map[string]string{"app": "che"}
|
||||
postgresLabels = map[string]string{"component": "postgres", "app": cheFlavor}
|
||||
keycloakLabels = map[string]string{"component": "keycloak", "app": cheFlavor}
|
||||
cheLabels = map[string]string{"component": cheFlavor, "app": cheFlavor}
|
||||
)
|
||||
|
|
|
|||
Loading…
Reference in New Issue