(devPod *latest.DevPod, containerName string, sc *latest.SyncConfig)
| 277 | } |
| 278 | |
| 279 | func 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 | |
| 303 | func (cmd *SyncCmd) applyFlagsToSyncConfig(syncConfig *latest.SyncConfig, options targetselector.Options) (targetselector.Options, error) { |
| 304 | if cmd.Path != "" { |
no test coverage detected