Skip to content

Commit

Permalink
chore: use naming convention for resources created by nim
Browse files Browse the repository at this point in the history
Signed-off-by: Tomer Figenblat <tfigenbl@redhat.com>
  • Loading branch information
TomerFi committed Dec 23, 2024
1 parent 4fad7e6 commit 9ddf8d7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
3 changes: 0 additions & 3 deletions internal/controller/constants/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,4 @@ const (
// NIM
const (
NimApplyConfigFieldManager = "nim-account-controller"
NimDataConfigMapName = "nvidia-nim-images-data"
NimRuntimeTemplateName = "nvidia-nim-serving-template"
NimPullSecretName = "nvidia-nim-image-pull"
)
6 changes: 3 additions & 3 deletions internal/controller/nim/account_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ func (r *AccountReconciler) reconcileNimConfig(
return nil, dErr
}

cmCfg := ssacorev1.ConfigMap(constants.NimDataConfigMapName, namespace).
cmCfg := ssacorev1.ConfigMap(fmt.Sprintf("%s-cm", *ownerCfg.Name), namespace).
WithData(data).
WithOwnerReferences(ownerCfg).
WithLabels(labels)
Expand All @@ -303,7 +303,7 @@ func (r *AccountReconciler) reconcileNimConfig(
func (r *AccountReconciler) reconcileRuntimeTemplate(ctx context.Context, account *v1.Account) (*templatev1.Template, error) {
template := &templatev1.Template{
ObjectMeta: metav1.ObjectMeta{
Name: constants.NimRuntimeTemplateName,
Name: fmt.Sprintf("%s-template", account.Name),
Namespace: account.Namespace,
},
}
Expand Down Expand Up @@ -355,7 +355,7 @@ func (r *AccountReconciler) reconcileNimPullSecret(
}

secretCfg := ssacorev1.
Secret(constants.NimPullSecretName, namespace).
Secret(fmt.Sprintf("%s-pull", *ownerCfg.Name), namespace).
WithData(map[string][]byte{corev1.DockerConfigJsonKey: credsJson}).
WithType(corev1.SecretTypeDockerConfigJson).
WithOwnerReferences(ownerCfg).
Expand Down

0 comments on commit 9ddf8d7

Please sign in to comment.