Commit 1e5f5fa
committed
store: GenerateName: optimize check if name is taken
The function was using NodeGroupByName, which validated the name to
be in the correct format, but also if the information on disk was
correct, obtained the last activity date, etc.
Given that names generated should always match the correct format,
and we're only looking for _possible_ conflicts, we can simplify
the validation. The results of the generated name will still be
validated when used, as the Create function calls `NodeGroupByName`
as part of creating;
https://github.com/docker/buildx/blob/2d65b12a65ab5529c6eba55605a790580dad5f4b/builder/builder.go#L358-L387
Signed-off-by: Sebastiaan van Stijn <[email protected]>1 parent b642e05 commit 1e5f5fa
2 files changed
+10
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
98 | 98 | | |
99 | 99 | | |
100 | 100 | | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
101 | 109 | | |
102 | 110 | | |
103 | 111 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
6 | 5 | | |
7 | 6 | | |
8 | 7 | | |
| |||
44 | 43 | | |
45 | 44 | | |
46 | 45 | | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
| 46 | + | |
| 47 | + | |
53 | 48 | | |
54 | | - | |
55 | 49 | | |
56 | 50 | | |
57 | 51 | | |
0 commit comments