fix: change from operator. to kc.operator. keys (#26414)

closes #12352

Signed-off-by: Steve Hawkins <shawkins@redhat.com>
This commit is contained in:
Steven Hawkins 2024-02-08 09:03:20 -05:00 committed by GitHub
parent a95894dbad
commit 77581d2527
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 29 additions and 41 deletions

View file

@ -91,10 +91,9 @@ jobs:
run: |
./mvnw install -Poperator -pl :keycloak-operator -am \
-Dquarkus.kubernetes.image-pull-policy=IfNotPresent \
-Doperator.keycloak.image=keycloak:${{ env.version_local }} \
-Dkc.operator.keycloak.image=keycloak:${{ env.version_local }} \
-Dtest.operator.custom.image=custom-keycloak:${{ env.version_local }} \
-Doperator.keycloak.image-pull-policy=Never \
-Dtest.operator.kubernetes.ip=$(minikube ip)
-Dkc.operator.keycloak.image-pull-policy=Never
test-remote:
name: Test remote
@ -138,11 +137,10 @@ jobs:
./mvnw install -Poperator -pl :keycloak-operator -am \
-Dquarkus.container-image.build=true \
-Dquarkus.kubernetes.image-pull-policy=IfNotPresent \
-Doperator.keycloak.image=keycloak:${{ env.version_remote }} \
-Dquarkus.kubernetes.env.vars.operator-keycloak-image-pull-policy=Never \
-Dkc.operator.keycloak.image=keycloak:${{ env.version_remote }} \
-Dquarkus.kubernetes.env.vars.kc-operator-keycloak-image-pull-policy=Never \
-Dtest.operator.custom.image=custom-keycloak:${{ env.version_remote }} \
--no-transfer-progress -Dtest.operator.deployment=remote \
-Dtest.operator.kubernetes.ip=$(minikube ip)
--no-transfer-progress -Dtest.operator.deployment=remote
test-olm:
name: Test OLM installation

View file

@ -341,6 +341,10 @@ Use the setting `spi-events-listener-jboss-logging-success-level` as described i
To trigger custom actions or custom log entries, write a custom event listener as described in the Event Listener SPI in the link:{developerguide_link}[{developerguide_name}].
= Operator Customization Property Keys
The property keys used by the operator for advanced configuration have changed from operator.keycloak to kc.operator.keycloak.
= Updates to cookies
As part of refactoring cookie handling in Keycloak there are some changes to how cookies are set:

View file

@ -30,13 +30,13 @@ This will build a container image from `Dockerfile`, using `docker` by default.
The Keycloak image can be configured, when starting the operator, using the Java property:
```
operator.keycloak.image
kc.operator.keycloak.image
```
And the imagePullPolicy with:
```
operator.keycloak.image-pull-policy
kc.operator.keycloak.image-pull-policy
```
## Contributing
@ -109,7 +109,7 @@ To avoid skipping tests that are depending on custom Keycloak images, you need t
And run the tests passing an extra Java property:
```bash
-Dtest.operator.custom.image=custom-keycloak:latest
-Dtest.kc.operator.custom.image=custom-keycloak:latest
```
### Testing using a pre-built operator image from a remote registry

View file

@ -26,7 +26,7 @@ VERSION="86400000.0.0"
mvn clean package -Poperator -pl :keycloak-operator -am \
-Dquarkus.container-image.build=true \
-Dquarkus.container-image.image="ttl.sh/${UUID}keycloak-operator:${VERSION}" \
-Doperator.keycloak.image="ttl.sh/${UUID}keycloak:${VERSION}" \
-Dkc.operator.keycloak.image="ttl.sh/${UUID}keycloak:${VERSION}" \
-DskipTests
# JIB patching on images doesn't work reliably with ttl.sh
docker push "ttl.sh/${UUID}keycloak-operator:${VERSION}"

View file

@ -18,14 +18,13 @@
package org.keycloak.operator;
import io.smallrye.config.ConfigMapping;
import io.smallrye.config.WithDefault;
import java.util.Map;
/**
* @author Vaclav Muzikar <vmuzikar@redhat.com>
*/
@ConfigMapping(prefix = "operator")
@ConfigMapping(prefix = "kc.operator")
public interface Config {
Keycloak keycloak();
@ -37,17 +36,4 @@ public interface Config {
Map<String, String> podLabels();
}
// workarounds for OLM env values
// to be removed after https://github.com/keycloak/keycloak/issues/12352
@WithDefault("keycloak-operator")
String name();
interface Condition {
@WithDefault("keycloak-operator.v999-SNAPSHOT")
String name();
}
Condition condition();
}

View file

@ -1,7 +1,7 @@
operator.keycloak.pod-labels."com.company"=Red_Hat
operator.keycloak.pod-labels."rht.prod_name"=Red_Hat_Runtimes
operator.keycloak.pod-labels."rht.prod_ver"=${SSO_QUARTER:sso_quarter_placeholder}
operator.keycloak.pod-labels."rht.comp"=SSO
operator.keycloak.pod-labels."rht.comp_ver"=${SSO_VER:${quarkus.application.version}}
operator.keycloak.pod-labels."rht.subcomp"=SSO_Server
operator.keycloak.pod-labels."rht.subcomp_t"=application
kc.operator.keycloak.pod-labels."com.company"=Red_Hat
kc.operator.keycloak.pod-labels."rht.prod_name"=Red_Hat_Runtimes
kc.operator.keycloak.pod-labels."rht.prod_ver"=${SSO_QUARTER:sso_quarter_placeholder}
kc.operator.keycloak.pod-labels."rht.comp"=SSO
kc.operator.keycloak.pod-labels."rht.comp_ver"=${SSO_VER:${quarkus.application.version}}
kc.operator.keycloak.pod-labels."rht.subcomp"=SSO_Server
kc.operator.keycloak.pod-labels."rht.subcomp_t"=application

View file

@ -5,13 +5,13 @@ quarkus.operator-sdk.crd.validate=false
quarkus.banner.enabled=false
# Operator config
operator.keycloak.image=${RELATED_IMAGE_KEYCLOAK:quay.io/keycloak/keycloak:nightly}
operator.keycloak.image-pull-policy=Always
operator.keycloak.start-optimized=false
operator.keycloak.poll-interval-seconds=60
kc.operator.keycloak.image=${RELATED_IMAGE_KEYCLOAK:quay.io/keycloak/keycloak:nightly}
kc.operator.keycloak.image-pull-policy=Always
kc.operator.keycloak.start-optimized=false
kc.operator.keycloak.poll-interval-seconds=60
# https://quarkus.io/guides/deploying-to-kubernetes#environment-variables-from-keyvalue-pairs
quarkus.kubernetes.env.vars.related-image-keycloak=${operator.keycloak.image}
quarkus.kubernetes.env.vars.related-image-keycloak=${kc.operator.keycloak.image}
# Bundle config
quarkus.operator-sdk.bundle.package-name=keycloak-operator

View file

@ -5,7 +5,7 @@ quarkus.operator-sdk.start-operator=false
quarkus.log.level=INFO
operator.keycloak.pod-labels."test.label"=foobar
operator.keycloak.pod-labels."testLabelWithExpression"=${OPERATOR_TEST_LABEL_EXPRESSION}
kc.operator.keycloak.pod-labels."test.label"=foobar
kc.operator.keycloak.pod-labels."testLabelWithExpression"=${OPERATOR_TEST_LABEL_EXPRESSION}
# allow the watching tests to complete more quickly
operator.keycloak.poll-interval-seconds=10
kc.operator.keycloak.poll-interval-seconds=10