Skip to content

Commit 698f808

Browse files
committed
fix: Remove Kustomize v5 deprecation warnings
1 parent 5986605 commit 698f808

File tree

7 files changed

+39
-37
lines changed

7 files changed

+39
-37
lines changed

config/base/kustomization.yaml

+17-29
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,11 @@ resources:
66
- ../rbac
77
- ../manager
88

9-
commonLabels:
10-
app.kubernetes.io/part-of: trustyai
9+
labels:
10+
- pairs:
11+
app.kubernetes.io/part-of: trustyai
12+
includeSelectors: true
13+
includeTemplates: true
1114

1215
configMapGenerator:
1316
- env: params.env
@@ -19,32 +22,17 @@ configurations:
1922
generatorOptions:
2023
disableNameSuffixHash: true
2124

22-
vars:
23-
- name: trustyaiServiceImage
24-
objref:
25+
replacements:
26+
# Operator image replacement
27+
- source:
2528
kind: ConfigMap
2629
name: config
27-
apiVersion: v1
28-
fieldref:
29-
fieldpath: data.trustyaiServiceImage
30-
- name: trustyaiOperatorImage
31-
objref:
32-
kind: ConfigMap
33-
name: config
34-
apiVersion: v1
35-
fieldref:
36-
fieldpath: data.trustyaiOperatorImage
37-
- name: oauthProxyImage
38-
objref:
39-
kind: ConfigMap
40-
name: config
41-
apiVersion: v1
42-
fieldref:
43-
fieldpath: data.oauthProxyImage
44-
- name: kServeServerless
45-
objref:
46-
kind: ConfigMap
47-
name: config
48-
apiVersion: v1
49-
fieldref:
50-
fieldpath: data.kServeServerless
30+
version: v1
31+
fieldPath: data.trustyaiOperatorImage
32+
targets:
33+
- select:
34+
group: apps
35+
kind: Deployment
36+
name: controller-manager
37+
fieldPaths:
38+
- spec.template.spec.containers.0.image

config/crd/kustomization.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ resources:
44
- bases/trustyai.opendatahub.io_guardrailsorchestrators.yaml
55
#+kubebuilder:scaffold:crdkustomizeresource
66

7-
patchesStrategicMerge: []
7+
patches: []
88
#+kubebuilder:scaffold:crdkustomizewebhookpatch
99
#+kubebuilder:scaffold:crdkustomizecainjectionpatch
1010

config/manager/manager.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ spec:
3434
- --leader-elect
3535
- --enable-services
3636
- "TAS,LMES,GORCH"
37-
image: $(trustyaiOperatorImage)
37+
image: "quay.io/trustyai/trustyai-service-operator:latest"
3838
name: manager
3939
securityContext:
4040
runAsNonRoot: true

config/overlays/lmes/kustomization.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ kind: Kustomization
44
resources:
55
- ../../base
66

7-
patchesStrategicMerge:
8-
- lmes-only-patch.yaml
7+
patches:
8+
- path: lmes-only-patch.yaml

config/overlays/odh-kueue/kustomization.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ kind: Kustomization
44
resources:
55
- ../../base
66

7-
patchesStrategicMerge:
8-
- patch.yaml
7+
patches:
8+
- path: patch.yaml
99

1010
configMapGenerator:
1111
- env: params.env
+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
resources:
22
- ../../base
33

4-
patchesStrategicMerge:
5-
- image-pull-policy.yaml
4+
patches:
5+
- path: image-pull-policy.yaml

tests/smoke/test_smoke.sh

+14
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ CRD_PATH="./tests/smoke/manifests/trustyai-cr.yaml"
1010
PVC_NAME="trustyai-service-pvc"
1111
SERVICE_NAME_1="trustyai-service"
1212
SERVICE_NAME_2="trustyai-service-tls"
13+
DEPLOYMENT_NAME="trustyai-service-operator"
14+
15+
EXPECTED_IMAGE="smoke/operator:pr-${{ github.event.pull_request.number || env.PR_NUMBER }}"
16+
1317

1418
log_success() {
1519
local message=$1
@@ -56,6 +60,16 @@ check_resource service "$SERVICE_NAME_2" "$NAMESPACE"
5660
# Check for the PVC creation
5761
check_resource pvc "$PVC_NAME" "$NAMESPACE"
5862

63+
# Check for correct Operator image assignment
64+
OPERATOR_IMAGE=$(kubectl get deployment "${DEPLOYMENT_NAME}" -n system \
65+
-o jsonpath='{.spec.template.spec.containers[0].image}')
66+
67+
if [[ "${OPERATOR_IMAGE}" == "${EXPECTED_IMAGE}" ]]; then
68+
log_success "Operator image is correct: ${OPERATOR_IMAGE}"
69+
else
70+
log_failure "Operator image mismatch! Expected ${EXPECTED_IMAGE}, got ${OPERATOR_IMAGE}"
71+
fi
72+
5973
kubectl delete namespace "$NAMESPACE"
6074

6175
sleep 10

0 commit comments

Comments
 (0)