Skip to content

Commit

Permalink
Add optional fields for Keycloak CR (#2227)
Browse files Browse the repository at this point in the history
* Add optional fields for Keycloak CR

Signed-off-by: Daniel Fan <[email protected]>

* update odlm package version in go module

Signed-off-by: Daniel Fan <[email protected]>

* update keycloak resource configuration

Signed-off-by: Daniel Fan <[email protected]>

---------

Signed-off-by: Daniel Fan <[email protected]>
  • Loading branch information
Daniel-Fan authored Sep 30, 2024
1 parent af388aa commit cb8e8f5
Show file tree
Hide file tree
Showing 16 changed files with 142 additions and 4 deletions.
19 changes: 19 additions & 0 deletions controllers/constant/odlm.go
Original file line number Diff line number Diff line change
Expand Up @@ -826,6 +826,25 @@ spec:
force: true
kind: Keycloak
name: cs-keycloak
optionalFields:
- path: .spec.unsupported.podTemplate.spec.containers[0].resources
operation: remove
matchExpressions:
- objectRef:
name: keycloaks.k8s.keycloak.org
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
key: .spec.versions[0].schema.openAPIV3Schema.properties.spec.properties.resources
operator: Exists
- path: .spec.resources
operation: remove
matchExpressions:
- objectRef:
name: keycloaks.k8s.keycloak.org
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
key: .spec.versions[0].schema.openAPIV3Schema.properties.spec.properties.resources
operator: DoesNotExist
- apiVersion: v1
kind: ConfigMap
force: true
Expand Down
11 changes: 11 additions & 0 deletions controllers/rules/rules.go
Original file line number Diff line number Diff line change
Expand Up @@ -1104,6 +1104,15 @@ const ConfigurationRules = `
data:
spec:
instances: LARGEST_VALUE
resources:
limits:
cpu: LARGEST_VALUE
memory: LARGEST_VALUE
ephemeral-storage: LARGEST_VALUE
requests:
cpu: LARGEST_VALUE
memory: LARGEST_VALUE
ephemeral-storage: LARGEST_VALUE
unsupported:
podTemplate:
spec:
Expand All @@ -1112,7 +1121,9 @@ const ConfigurationRules = `
limits:
cpu: LARGEST_VALUE
memory: LARGEST_VALUE
ephemeral-storage: LARGEST_VALUE
requests:
cpu: LARGEST_VALUE
memory: LARGEST_VALUE
ephemeral-storage: LARGEST_VALUE
`
9 changes: 9 additions & 0 deletions controllers/size/large_amd64.go
Original file line number Diff line number Diff line change
Expand Up @@ -861,6 +861,15 @@ const Large = `
data:
spec:
instances: 3
resources:
limits:
cpu: 1000m
memory: 1Gi
ephemeral-storage: 512Mi
requests:
cpu: 1000m
memory: 1Gi
ephemeral-storage: 256Mi
unsupported:
podTemplate:
spec:
Expand Down
9 changes: 9 additions & 0 deletions controllers/size/large_ppc64le.go
Original file line number Diff line number Diff line change
Expand Up @@ -861,6 +861,15 @@ const Large = `
data:
spec:
instances: 3
resources:
limits:
cpu: 1000m
memory: 1Gi
ephemeral-storage: 512Mi
requests:
cpu: 1000m
memory: 1Gi
ephemeral-storage: 256Mi
unsupported:
podTemplate:
spec:
Expand Down
9 changes: 9 additions & 0 deletions controllers/size/large_s390x.go
Original file line number Diff line number Diff line change
Expand Up @@ -861,6 +861,15 @@ const Large = `
data:
spec:
instances: 3
resources:
limits:
cpu: 1000m
memory: 1Gi
ephemeral-storage: 512Mi
requests:
cpu: 1000m
memory: 1Gi
ephemeral-storage: 256Mi
unsupported:
podTemplate:
spec:
Expand Down
9 changes: 9 additions & 0 deletions controllers/size/medium_amd64.go
Original file line number Diff line number Diff line change
Expand Up @@ -861,6 +861,15 @@ const Medium = `
data:
spec:
instances: 2
resources:
limits:
cpu: 1000m
memory: 1Gi
ephemeral-storage: 512Mi
requests:
cpu: 1000m
memory: 1Gi
ephemeral-storage: 256Mi
unsupported:
podTemplate:
spec:
Expand Down
9 changes: 9 additions & 0 deletions controllers/size/medium_ppc64le.go
Original file line number Diff line number Diff line change
Expand Up @@ -861,6 +861,15 @@ const Medium = `
data:
spec:
instances: 2
resources:
limits:
cpu: 1000m
memory: 1Gi
ephemeral-storage: 512Mi
requests:
cpu: 1000m
memory: 1Gi
ephemeral-storage: 256Mi
unsupported:
podTemplate:
spec:
Expand Down
9 changes: 9 additions & 0 deletions controllers/size/medium_s390x.go
Original file line number Diff line number Diff line change
Expand Up @@ -861,6 +861,15 @@ const Medium = `
data:
spec:
instances: 2
resources:
limits:
cpu: 1000m
memory: 1Gi
ephemeral-storage: 512Mi
requests:
cpu: 1000m
memory: 1Gi
ephemeral-storage: 256Mi
unsupported:
podTemplate:
spec:
Expand Down
9 changes: 9 additions & 0 deletions controllers/size/small_amd64.go
Original file line number Diff line number Diff line change
Expand Up @@ -861,6 +861,15 @@ const Small = `
data:
spec:
instances: 2
resources:
limits:
cpu: 1000m
memory: 1Gi
ephemeral-storage: 512Mi
requests:
cpu: 1000m
memory: 1Gi
ephemeral-storage: 256Mi
unsupported:
podTemplate:
spec:
Expand Down
9 changes: 9 additions & 0 deletions controllers/size/small_ppc64le.go
Original file line number Diff line number Diff line change
Expand Up @@ -861,6 +861,15 @@ const Small = `
data:
spec:
instances: 2
resources:
limits:
cpu: 1000m
memory: 1Gi
ephemeral-storage: 512Mi
requests:
cpu: 1000m
memory: 1Gi
ephemeral-storage: 256Mi
unsupported:
podTemplate:
spec:
Expand Down
9 changes: 9 additions & 0 deletions controllers/size/small_s390x.go
Original file line number Diff line number Diff line change
Expand Up @@ -861,6 +861,15 @@ const Small = `
data:
spec:
instances: 2
resources:
limits:
cpu: 1000m
memory: 1Gi
ephemeral-storage: 512Mi
requests:
cpu: 1000m
memory: 1Gi
ephemeral-storage: 256Mi
unsupported:
podTemplate:
spec:
Expand Down
9 changes: 9 additions & 0 deletions controllers/size/starterset_amd64.go
Original file line number Diff line number Diff line change
Expand Up @@ -861,6 +861,15 @@ const StarterSet = `
data:
spec:
instances: 1
resources:
limits:
cpu: 1000m
memory: 1Gi
ephemeral-storage: 512Mi
requests:
cpu: 1000m
memory: 1Gi
ephemeral-storage: 256Mi
unsupported:
podTemplate:
spec:
Expand Down
9 changes: 9 additions & 0 deletions controllers/size/starterset_ppc64le.go
Original file line number Diff line number Diff line change
Expand Up @@ -861,6 +861,15 @@ const StarterSet = `
data:
spec:
instances: 1
resources:
limits:
cpu: 1000m
memory: 1Gi
ephemeral-storage: 512Mi
requests:
cpu: 1000m
memory: 1Gi
ephemeral-storage: 256Mi
unsupported:
podTemplate:
spec:
Expand Down
9 changes: 9 additions & 0 deletions controllers/size/starterset_s390x.go
Original file line number Diff line number Diff line change
Expand Up @@ -863,6 +863,15 @@ const StarterSet = `
data:
spec:
instances: 1
resources:
limits:
cpu: 1000m
memory: 1Gi
ephemeral-storage: 512Mi
requests:
cpu: 1000m
memory: 1Gi
ephemeral-storage: 256Mi
unsupported:
podTemplate:
spec:
Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ require (
github.com/IBM/controller-filtered-cache v0.3.5
github.com/IBM/ibm-namespace-scope-operator/v4 v4.2.4-0.20240501132320-6675f97bc34f
github.com/IBM/ibm-secretshare-operator v1.20.3
github.com/IBM/operand-deployment-lifecycle-manager/v4 v4.3.5-alpha
github.com/IBM/operand-deployment-lifecycle-manager/v4 v4.3.6-alpha
github.com/ghodss/yaml v1.0.0
github.com/ibm/ibm-cert-manager-operator v0.0.0-20230705134954-f3b9b344298a
github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826
Expand Down Expand Up @@ -90,7 +90,7 @@ require (
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
k8s.io/apiextensions-apiserver v0.24.2 // indirect
k8s.io/apiextensions-apiserver v0.24.2
k8s.io/component-base v0.24.2 // indirect
k8s.io/klog/v2 v2.60.1 // indirect
k8s.io/kube-openapi v0.0.0-20220627174259-011e075b9cb8 // indirect
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ github.com/IBM/ibm-namespace-scope-operator/v4 v4.2.4-0.20240501132320-6675f97bc
github.com/IBM/ibm-namespace-scope-operator/v4 v4.2.4-0.20240501132320-6675f97bc34f/go.mod h1:p9DwVRJG6GF3b+kWQru/4fSEr3OQhlHKVEuJZcKewLs=
github.com/IBM/ibm-secretshare-operator v1.20.3 h1:4Mz7FJ3f9TwFJqTVu4SfBHhspqtXwaCPtLnxv7DWT14=
github.com/IBM/ibm-secretshare-operator v1.20.3/go.mod h1:gAkGb8Hts8swz5Ptbvkq/S0YylHE4zOTmUvj68uTQDI=
github.com/IBM/operand-deployment-lifecycle-manager/v4 v4.3.5-alpha h1:bYH3dtALyetuAm1jY/XX3/DgA1ATCQPYVKA8MobgsVc=
github.com/IBM/operand-deployment-lifecycle-manager/v4 v4.3.5-alpha/go.mod h1:xRmAdXxi7Yq1BgEv0UVIMlOVLWNdjim+1IlGxn4zl3U=
github.com/IBM/operand-deployment-lifecycle-manager/v4 v4.3.6-alpha h1:7HXDnVk/rKNQmzm5G91qYZnroHvaTY5umWC0PgmqwhQ=
github.com/IBM/operand-deployment-lifecycle-manager/v4 v4.3.6-alpha/go.mod h1:xRmAdXxi7Yq1BgEv0UVIMlOVLWNdjim+1IlGxn4zl3U=
github.com/MakeNowJust/heredoc v0.0.0-20170808103936-bb23615498cd/go.mod h1:64YHyfSL2R96J44Nlwm39UHepQbyR5q10x7iYa1ks2E=
github.com/Masterminds/goutils v1.1.0/go.mod h1:8cTjp+g8YejhMuvIA5y2vz3BpJxksy863GQaJW2MFNU=
github.com/Masterminds/semver/v3 v3.0.3/go.mod h1:VPu/7SZ7ePZ3QOrcuXROw5FAcLl4a0cBrbBpGY/8hQs=
Expand Down

0 comments on commit cb8e8f5

Please sign in to comment.