Skip to content

Commit

Permalink
Fix: Ensure odh-model-controller Deployment Waits for ConfigMap (open…
Browse files Browse the repository at this point in the history
…datahub-io#361)

* initial commit to fix NIM and deployment issues

Signed-off-by: mtrujillo <[email protected]>

* update to set default on nimState

Signed-off-by: mtrujillo <[email protected]>

* updated optinal to false

Signed-off-by: mtrujillo <[email protected]>

---------

Signed-off-by: mtrujillo <[email protected]>
  • Loading branch information
trujillm authored Feb 4, 2025
1 parent f7fdf0a commit 7806732
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import (
"crypto/tls"
"flag"
"os"
"slices"
"strconv"

// Import all Kubernetes client auth plugins (e.g. Azure, GCP, OIDC, etc.)
Expand Down Expand Up @@ -305,7 +304,10 @@ func setupNim(mgr manager.Manager, signalHandlerCtx context.Context, kubeClient
var err error

nimState := os.Getenv("NIM_STATE")
if !slices.Contains([]string{"removed", ""}, nimState) {
if nimState == "" {
nimState = "managed"
}
if nimState != "removed" {
if err = (&nim.AccountReconciler{
Client: mgr.GetClient(),
Scheme: mgr.GetScheme(),
Expand Down
2 changes: 1 addition & 1 deletion config/manager/manager.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ spec:
configMapKeyRef:
name: odh-model-controller-parameters
key: nim-state
optional: true
optional: false
livenessProbe:
httpGet:
path: /healthz
Expand Down

0 comments on commit 7806732

Please sign in to comment.