Change the CRD API group in the operator
This commit is contained in:
parent
cb4a513e24
commit
66b1c2b167
15 changed files with 19 additions and 1126 deletions
|
@ -20,7 +20,7 @@ e.g:
|
|||
|
||||
[source,yaml]
|
||||
----
|
||||
apiVersion: keycloak.org/v2alpha1
|
||||
apiVersion: k8s.keycloak.org/v2alpha1
|
||||
kind: Keycloak
|
||||
metadata:
|
||||
name: example-kc
|
||||
|
@ -67,7 +67,7 @@ As an example you can inject labels, annotations, or even volumes and volume mou
|
|||
|
||||
[source,yaml]
|
||||
----
|
||||
apiVersion: keycloak.org/v2alpha1
|
||||
apiVersion: k8s.keycloak.org/v2alpha1
|
||||
kind: Keycloak
|
||||
metadata:
|
||||
name: example-kc
|
||||
|
@ -98,7 +98,7 @@ Specifically, you can disable the required fields with a special value `INSECURE
|
|||
|
||||
[source,yaml]
|
||||
----
|
||||
apiVersion: keycloak.org/v2alpha1
|
||||
apiVersion: k8s.keycloak.org/v2alpha1
|
||||
kind: Keycloak
|
||||
metadata:
|
||||
name: example-kc
|
||||
|
|
|
@ -113,7 +113,7 @@ The Keycloak CRD allow you to customize several fields but, for a simple deploym
|
|||
[source,bash]
|
||||
----
|
||||
cat <<EOF >> example-kc.yaml
|
||||
apiVersion: keycloak.org/v2alpha1
|
||||
apiVersion: k8s.keycloak.org/v2alpha1
|
||||
kind: Keycloak
|
||||
metadata:
|
||||
name: example-kc
|
||||
|
|
|
@ -31,7 +31,7 @@ To provide a custom image you have to define the `image` field in the Keycloak C
|
|||
|
||||
[source,yaml]
|
||||
----
|
||||
apiVersion: keycloak.org/v2alpha1
|
||||
apiVersion: k8s.keycloak.org/v2alpha1
|
||||
kind: Keycloak
|
||||
metadata:
|
||||
name: example-kc
|
||||
|
|
|
@ -26,7 +26,7 @@ A Realm Import Custom Resource(CR) looks like follows:
|
|||
|
||||
[source,yaml]
|
||||
----
|
||||
apiVersion: keycloak.org/v2alpha1
|
||||
apiVersion: k8s.keycloak.org/v2alpha1
|
||||
kind: KeycloakRealmImport
|
||||
metadata:
|
||||
name: my-realm-kc
|
||||
|
@ -52,7 +52,7 @@ Use `kubectl` to create the CR in the correct cluster namespace:
|
|||
[source,bash]
|
||||
----
|
||||
cat <<EOF >> example-realm-import.yaml
|
||||
apiVersion: keycloak.org/v2alpha1
|
||||
apiVersion: k8s.keycloak.org/v2alpha1
|
||||
kind: KeycloakRealmImport
|
||||
metadata:
|
||||
name: my-realm-kc
|
||||
|
|
|
@ -35,6 +35,4 @@ fi
|
|||
|
||||
mv $SCRIPT_DIR/../olm/$VERSION/manifests/clusterserviceversion.yaml "$SCRIPT_DIR/../olm/$VERSION/manifests/keycloak-operator.v$VERSION.clusterserviceversion.yaml"
|
||||
|
||||
# Include the old CRD version
|
||||
( cd $SCRIPT_DIR/../ && kubectl kustomize target | yq ea "select(.metadata.name == \"keycloaks.keycloak.org\")" > $SCRIPT_DIR/../olm/$VERSION/manifests/keycloaks.keycloak.org-v1.yml )
|
||||
cp $SCRIPT_DIR/../target/kubernetes/keycloakrealmimports.keycloak.org-v1.yml $SCRIPT_DIR/../olm/$VERSION/manifests
|
||||
cp target/kubernetes/*.keycloak.org-v1.yml olm/$VERSION/manifests
|
||||
|
|
|
@ -19,7 +19,7 @@ package org.keycloak.operator;
|
|||
import java.util.Map;
|
||||
|
||||
public final class Constants {
|
||||
public static final String CRDS_GROUP = "keycloak.org";
|
||||
public static final String CRDS_GROUP = "k8s.keycloak.org";
|
||||
public static final String CRDS_VERSION = "v2alpha1";
|
||||
public static final String SHORT_NAME = "kc";
|
||||
public static final String NAME = "keycloak";
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -4,17 +4,10 @@ kind: Kustomization
|
|||
namespace: keycloak
|
||||
|
||||
resources:
|
||||
- kubernetes/keycloaks.keycloak.org-v1.yml
|
||||
- kubernetes/keycloakrealmimports.keycloak.org-v1.yml
|
||||
- kubernetes/keycloaks.k8s.keycloak.org-v1.yml
|
||||
- kubernetes/keycloakrealmimports.k8s.keycloak.org-v1.yml
|
||||
- kubernetes/kubernetes.yml
|
||||
|
||||
# patchesStrategicMerge
|
||||
patches:
|
||||
- kubernetes/minikube.yml
|
||||
|
||||
# patchesJson6902
|
||||
patches:
|
||||
- path: append_legacy_cr.yaml
|
||||
target:
|
||||
kind: CustomResourceDefinition
|
||||
name: keycloaks.keycloak.org
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
apiVersion: keycloak.org/v2alpha1
|
||||
apiVersion: k8s.keycloak.org/v2alpha1
|
||||
kind: Keycloak
|
||||
metadata:
|
||||
name: example-kc
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
apiVersion: keycloak.org/v2alpha1
|
||||
apiVersion: k8s.keycloak.org/v2alpha1
|
||||
kind: KeycloakRealmImport
|
||||
metadata:
|
||||
name: example-count0-kc
|
||||
|
|
|
@ -119,10 +119,10 @@ public abstract class ClusterOperatorTest {
|
|||
private static void createCRDs() {
|
||||
Log.info("Creating CRDs");
|
||||
try {
|
||||
var deploymentCRD = k8sclient.load(new FileInputStream(TARGET_KUBERNETES_GENERATED_YML_FOLDER + "keycloaks.keycloak.org-v1.yml"));
|
||||
var deploymentCRD = k8sclient.load(new FileInputStream(TARGET_KUBERNETES_GENERATED_YML_FOLDER + "keycloaks.k8s.keycloak.org-v1.yml"));
|
||||
deploymentCRD.createOrReplace();
|
||||
deploymentCRD.waitUntilReady(5, TimeUnit.SECONDS);
|
||||
var realmImportCRD = k8sclient.load(new FileInputStream(TARGET_KUBERNETES_GENERATED_YML_FOLDER + "keycloakrealmimports.keycloak.org-v1.yml"));
|
||||
var realmImportCRD = k8sclient.load(new FileInputStream(TARGET_KUBERNETES_GENERATED_YML_FOLDER + "keycloakrealmimports.k8s.keycloak.org-v1.yml"));
|
||||
realmImportCRD.createOrReplace();
|
||||
realmImportCRD.waitUntilReady(5, TimeUnit.SECONDS);
|
||||
} catch (Exception e) {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
apiVersion: keycloak.org/v2alpha1
|
||||
apiVersion: k8s.keycloak.org/v2alpha1
|
||||
kind: Keycloak
|
||||
metadata:
|
||||
name: example-podtemplate-kc
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
apiVersion: keycloak.org/v2alpha1
|
||||
apiVersion: k8s.keycloak.org/v2alpha1
|
||||
kind: Keycloak
|
||||
metadata:
|
||||
name: example-podtemplate
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
apiVersion: keycloak.org/v2alpha1
|
||||
apiVersion: k8s.keycloak.org/v2alpha1
|
||||
kind: KeycloakRealmImport
|
||||
metadata:
|
||||
name: example-count0-kc
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
apiVersion: keycloak.org/v2alpha1
|
||||
apiVersion: k8s.keycloak.org/v2alpha1
|
||||
kind: KeycloakRealmImport
|
||||
metadata:
|
||||
name: example-token-test-kc
|
||||
|
|
Loading…
Reference in a new issue