Skip to content

Commit

Permalink
fix: Remove Kustomize v5 deprecation warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
ruivieira committed Feb 24, 2025
1 parent 5986605 commit 698f808
Show file tree
Hide file tree
Showing 7 changed files with 39 additions and 37 deletions.
46 changes: 17 additions & 29 deletions config/base/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,11 @@ resources:
- ../rbac
- ../manager

commonLabels:
app.kubernetes.io/part-of: trustyai
labels:
- pairs:
app.kubernetes.io/part-of: trustyai
includeSelectors: true
includeTemplates: true

configMapGenerator:
- env: params.env
Expand All @@ -19,32 +22,17 @@ configurations:
generatorOptions:
disableNameSuffixHash: true

vars:
- name: trustyaiServiceImage
objref:
replacements:
# Operator image replacement
- source:
kind: ConfigMap
name: config
apiVersion: v1
fieldref:
fieldpath: data.trustyaiServiceImage
- name: trustyaiOperatorImage
objref:
kind: ConfigMap
name: config
apiVersion: v1
fieldref:
fieldpath: data.trustyaiOperatorImage
- name: oauthProxyImage
objref:
kind: ConfigMap
name: config
apiVersion: v1
fieldref:
fieldpath: data.oauthProxyImage
- name: kServeServerless
objref:
kind: ConfigMap
name: config
apiVersion: v1
fieldref:
fieldpath: data.kServeServerless
version: v1
fieldPath: data.trustyaiOperatorImage
targets:
- select:
group: apps
kind: Deployment
name: controller-manager
fieldPaths:
- spec.template.spec.containers.0.image
2 changes: 1 addition & 1 deletion config/crd/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ resources:
- bases/trustyai.opendatahub.io_guardrailsorchestrators.yaml
#+kubebuilder:scaffold:crdkustomizeresource

patchesStrategicMerge: []
patches: []
#+kubebuilder:scaffold:crdkustomizewebhookpatch
#+kubebuilder:scaffold:crdkustomizecainjectionpatch

Expand Down
2 changes: 1 addition & 1 deletion config/manager/manager.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ spec:
- --leader-elect
- --enable-services
- "TAS,LMES,GORCH"
image: $(trustyaiOperatorImage)
image: "quay.io/trustyai/trustyai-service-operator:latest"
name: manager
securityContext:
runAsNonRoot: true
Expand Down
4 changes: 2 additions & 2 deletions config/overlays/lmes/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ kind: Kustomization
resources:
- ../../base

patchesStrategicMerge:
- lmes-only-patch.yaml
patches:
- path: lmes-only-patch.yaml
4 changes: 2 additions & 2 deletions config/overlays/odh-kueue/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ kind: Kustomization
resources:
- ../../base

patchesStrategicMerge:
- patch.yaml
patches:
- path: patch.yaml

configMapGenerator:
- env: params.env
Expand Down
4 changes: 2 additions & 2 deletions config/overlays/testing/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
resources:
- ../../base

patchesStrategicMerge:
- image-pull-policy.yaml
patches:
- path: image-pull-policy.yaml
14 changes: 14 additions & 0 deletions tests/smoke/test_smoke.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ CRD_PATH="./tests/smoke/manifests/trustyai-cr.yaml"
PVC_NAME="trustyai-service-pvc"
SERVICE_NAME_1="trustyai-service"
SERVICE_NAME_2="trustyai-service-tls"
DEPLOYMENT_NAME="trustyai-service-operator"

EXPECTED_IMAGE="smoke/operator:pr-${{ github.event.pull_request.number || env.PR_NUMBER }}"


log_success() {
local message=$1
Expand Down Expand Up @@ -56,6 +60,16 @@ check_resource service "$SERVICE_NAME_2" "$NAMESPACE"
# Check for the PVC creation
check_resource pvc "$PVC_NAME" "$NAMESPACE"

# Check for correct Operator image assignment
OPERATOR_IMAGE=$(kubectl get deployment "${DEPLOYMENT_NAME}" -n system \
-o jsonpath='{.spec.template.spec.containers[0].image}')

if [[ "${OPERATOR_IMAGE}" == "${EXPECTED_IMAGE}" ]]; then
log_success "Operator image is correct: ${OPERATOR_IMAGE}"
else
log_failure "Operator image mismatch! Expected ${EXPECTED_IMAGE}, got ${OPERATOR_IMAGE}"
fi

kubectl delete namespace "$NAMESPACE"

sleep 10
Expand Down

0 comments on commit 698f808

Please sign in to comment.