Skip to content

Commit

Permalink
Use both current and legacy component name to filter out DevFlags (#1461
Browse files Browse the repository at this point in the history
)
  • Loading branch information
lburgazzoli authored Dec 19, 2024
1 parent bc10dfc commit d564e94
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 17 deletions.
18 changes: 11 additions & 7 deletions controllers/components/kserve/kserve_controller_actions.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,15 +115,19 @@ func devFlags(ctx context.Context, rr *odhtypes.ReconciliationRequest) error {
kSourcePath := kserveManifestSourcePath

for _, subcomponent := range df.Manifests {
if strings.Contains(subcomponent.URI, componentName) {
if err := deploy.DownloadManifests(ctx, componentName, subcomponent); err != nil {
return err
}
if !strings.Contains(subcomponent.URI, componentName) && !strings.Contains(subcomponent.URI, LegacyComponentName) {
continue
}

if subcomponent.SourcePath != "" {
kSourcePath = subcomponent.SourcePath
}
if err := deploy.DownloadManifests(ctx, componentName, subcomponent); err != nil {
return err
}

if subcomponent.SourcePath != "" {
kSourcePath = subcomponent.SourcePath
}

break
}

rr.Manifests = []odhtypes.ManifestInfo{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ func devFlags(ctx context.Context, rr *odhtypes.ReconciliationRequest) error {
}

for _, subcomponent := range df.Manifests {
if !strings.Contains(subcomponent.URI, ComponentName) {
if !strings.Contains(subcomponent.URI, ComponentName) && !strings.Contains(subcomponent.URI, LegacyComponentName) {
continue
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,16 +49,20 @@ func devFlags(ctx context.Context, rr *odhtypes.ReconciliationRequest) error {
// Implement devflags support logic
// If dev flags are set, update default manifests path
for _, subcomponent := range df.Manifests {
if strings.Contains(subcomponent.URI, ComponentName) {
// Download modelmeshserving
if err := odhdeploy.DownloadManifests(ctx, ComponentName, subcomponent); err != nil {
return err
}
// If overlay is defined, update paths
if subcomponent.SourcePath != "" {
rr.Manifests[0].SourcePath = subcomponent.SourcePath
}
if !strings.Contains(subcomponent.URI, ComponentName) && !strings.Contains(subcomponent.URI, LegacyComponentName) {
continue
}

// Download modelmeshserving
if err := odhdeploy.DownloadManifests(ctx, ComponentName, subcomponent); err != nil {
return err
}
// If overlay is defined, update paths
if subcomponent.SourcePath != "" {
rr.Manifests[0].SourcePath = subcomponent.SourcePath
}

break
}

return nil
Expand Down

0 comments on commit d564e94

Please sign in to comment.