Skip to content

Commit

Permalink
fixup! Extract GetSyncFilesFromAttributes as an exported function in …
Browse files Browse the repository at this point in the history
…adapters
  • Loading branch information
rm3l committed Feb 8, 2023
1 parent a16059d commit d1a7381
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions pkg/devfile/adapters/kubernetes/component/adapter.go
Original file line number Diff line number Diff line change
Expand Up @@ -234,10 +234,11 @@ func (a Adapter) Push(ctx context.Context, parameters adapters.PushParameters, c
}

cmdKind := devfilev1.RunCommandGroupKind
cmdName := parameters.DevfileRunCmd
if parameters.Debug {
cmdKind = devfilev1.DebugCommandGroupKind
cmdName = parameters.DevfileDebugCmd
}
devfileCmd := pushDevfileCommands[cmdKind]

syncParams := sync.SyncParameters{
Path: parameters.Path,
Expand All @@ -248,7 +249,7 @@ func (a Adapter) Push(ctx context.Context, parameters adapters.PushParameters, c

CompInfo: compInfo,
ForcePush: !deploymentExists || podChanged,
Files: adapters.GetSyncFilesFromAttributes(devfileCmd),
Files: adapters.GetSyncFilesFromAttributes(pushDevfileCommands[cmdKind]),
}

execRequired, err := a.syncClient.SyncFiles(syncParams)
Expand All @@ -269,11 +270,6 @@ func (a Adapter) Push(ctx context.Context, parameters adapters.PushParameters, c
}
componentStatus.PostStartEventsDone = true

cmdName := parameters.DevfileRunCmd
if parameters.Debug {
cmdName = parameters.DevfileDebugCmd
}

cmd, err := libdevfile.ValidateAndGetCommand(a.Devfile, cmdName, cmdKind)
if err != nil {
return err
Expand Down

0 comments on commit d1a7381

Please sign in to comment.