Skip to content

Commit

Permalink
Move parameter to global ldapSync
Browse files Browse the repository at this point in the history
  • Loading branch information
DebakelOrakel committed Sep 25, 2024
1 parent f98ebfe commit 85455bc
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 13 deletions.
2 changes: 1 addition & 1 deletion component/ldap.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ local syncConfig(namespace, idp, sa) =
local container(command) = kube.Container(command) {
image: std.join(':', std.prune([ params.images.sync.image, params.images.sync.tag ])),
securityContext: security_context,
command: std.get(custom_command, command, [
command: std.get(params.ldapSync.command, command, [
'oc',
'adm',
'groups',
Expand Down
27 changes: 27 additions & 0 deletions docs/modules/ROOT/pages/references/parameters.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,18 @@ default::
[source,yaml]
----
schedule: '%d * * * *'
command: {}
----

=== `ldapSync.schedule`

[horizontal]
type:: string
default::
+
[source,yaml]
----
schedule: '%d * * * *'
----

This parameter allows configuring the LDAP sync CronJob schedule.
Expand All @@ -146,6 +158,21 @@ The component will apply the logic documented in the Project Syn Jsonnet best pr

NOTE: The component may break if you specify a schedule which doesn't contain exactly one `%d` format specifier.

=== `ldapSync.command`

[horizontal]
type:: dict
default::
+
[source,yaml]
----
command: {}
----

This parameter allows overwriting the commands used for `sync` and `prune`.

NOTE: The command defined here will apply to all LDAP idedtity providers.

== `secrets`

[horizontal]
Expand Down
14 changes: 9 additions & 5 deletions tests/defaults.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,6 @@ parameters:
-----BEGIN CERTIFICATE-----
-----END CERTIFICATE-----
sync:
command:
prune:
- oc
- adm
- do-nothing
rfc2307:
groupsQuery:
baseDN: ou=Groups,dc=company,dc=tld
Expand Down Expand Up @@ -119,3 +114,12 @@ parameters:
clientSecret:
name: oidc-client
issuer: https://sso.company.tld/auth/realms/master

ldapSync:
command:
prune:
- oc
- adm
- do
- something
- else
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,9 @@ spec:
command:
- oc
- adm
- do-nothing
- do
- something
- else
env: []
image: image-registry.openshift-image-registry.svc:5000/openshift/cli
imagePullPolicy: IfNotPresent
Expand Down Expand Up @@ -313,12 +315,9 @@ spec:
command:
- oc
- adm
- groups
- prune
- --sync-config=/etc/sync-config/config.yaml
- --confirm
- --blacklist=/etc/sync-config/blacklist.txt
- --whitelist=/etc/sync-config/whitelist.txt
- do
- something
- else
env: []
image: image-registry.openshift-image-registry.svc:5000/openshift/cli
imagePullPolicy: IfNotPresent
Expand Down

0 comments on commit 85455bc

Please sign in to comment.