MCPcopy Index your code
hub / github.com/devspace-sh/devspace / fromSyncConfig

Function fromSyncConfig

cmd/sync.go:279–301  ·  view source on GitHub ↗
(devPod *latest.DevPod, containerName string, sc *latest.SyncConfig)

Source from the content-addressed store, hash-verified

277}
278
279func fromSyncConfig(devPod *latest.DevPod, containerName string, sc *latest.SyncConfig) (nameConfig, error) {
280 localPath, remotePath, err := sync.ParseSyncPath(sc.Path)
281 if err != nil {
282 return nameConfig{}, err
283 }
284
285 selector := ""
286 if devPod.ImageSelector != "" {
287 selector = "img-selector: " + devPod.ImageSelector
288 } else if len(devPod.LabelSelector) > 0 {
289 selector = "selector: " + labels.Set(devPod.LabelSelector).String()
290 }
291 if containerName != "" {
292 selector += "/" + containerName
293 }
294
295 return nameConfig{
296 name: fmt.Sprintf("%s: Sync %s: %s <-> %s ", devPod.Name, selector, localPath, remotePath),
297 devPod: devPod,
298 containerName: containerName,
299 syncConfig: sc,
300 }, nil
301}
302
303func (cmd *SyncCmd) applyFlagsToSyncConfig(syncConfig *latest.SyncConfig, options targetselector.Options) (targetselector.Options, error) {
304 if cmd.Path != "" {

Callers 1

RunMethod · 0.85

Calls 3

ParseSyncPathFunction · 0.92
StringMethod · 0.45
SetMethod · 0.45

Tested by

no test coverage detected