(args string, aliases map[string]int)
| 444 | } |
| 445 | |
| 446 | func copyNotes(args string, aliases map[string]int) []string { |
| 447 | var notes []string |
| 448 | source := detectCopySourceStage(args) |
| 449 | if source == "" { |
| 450 | notes = append(notes, "Takes files from the build context, so editing those files will invalidate this layer.") |
| 451 | return notes |
| 452 | } |
| 453 | |
| 454 | lowered := strings.ToLower(source) |
| 455 | if idx, ok := aliases[lowered]; ok { |
| 456 | notes = append(notes, fmt.Sprintf("Copies from stage %d (%s). Cache depends on that stage's output instead of local files.", idx, source)) |
| 457 | } else { |
| 458 | notes = append(notes, fmt.Sprintf("Copies from %q. Make sure the stage or image exists.", source)) |
| 459 | } |
| 460 | return notes |
| 461 | } |
| 462 | |
| 463 | func detectCopySourceStage(args string) string { |
| 464 | tokens := strings.Fields(args) |
no test coverage detected