Skip to content

Commit ca3bf0f

Browse files
shengnuoshivamerla
authored andcommitted
Fix a bug fetching dataset from HF
Signed-off-by: Sheng Lin <[email protected]>
1 parent bfe8ea0 commit ca3bf0f

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

api/apps/v1alpha1/nimcache_types.go

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ const (
211211

212212
// EnvFromSecrets return the list of secrets that should be mounted as env vars.
213213
func (s *NIMSource) EnvFromSecrets() []corev1.EnvFromSource {
214-
if s.NGC != nil && s.NGC.AuthSecret != "" {
214+
if s.NGC != nil && s.NGC.AuthSecret != "" { // nolint:gocritic
215215
return []corev1.EnvFromSource{
216216
{
217217
SecretRef: &corev1.SecretEnvSource{
@@ -231,6 +231,16 @@ func (s *NIMSource) EnvFromSecrets() []corev1.EnvFromSource {
231231
},
232232
},
233233
}
234+
} else if s.HF != nil && s.HF.AuthSecret != "" {
235+
return []corev1.EnvFromSource{
236+
{
237+
SecretRef: &corev1.SecretEnvSource{
238+
LocalObjectReference: corev1.LocalObjectReference{
239+
Name: s.HF.AuthSecret,
240+
},
241+
},
242+
},
243+
}
234244
}
235245
// no secrets to source the env variables
236246
return []corev1.EnvFromSource{}

internal/controller/nimcache_controller.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1137,7 +1137,7 @@ func (r *NIMCacheReconciler) constructJob(ctx context.Context, nimCache *appsv1a
11371137
job.Spec.Template.Spec.Containers = []corev1.Container{
11381138
{
11391139
Name: NIMCacheContainerName,
1140-
Image: nimCache.Spec.Source.DataStore.ModelPuller,
1140+
Image: hfDataSource.GetModelPuller(),
11411141
EnvFrom: nimCache.Spec.Source.EnvFromSecrets(),
11421142
Env: []corev1.EnvVar{
11431143
{

0 commit comments

Comments
 (0)