Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #44079 from thaJeztah/c8d_build
containerd integration: Make build work
- Loading branch information
Showing
122 changed files
with
17,370 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
package exporter | ||
|
||
const Moby = "moby" |
2 changes: 1 addition & 1 deletion
2
builder/builder-next/exporter/export.go → ...lder-next/exporter/mobyexporter/export.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package containerimage | ||
package mobyexporter | ||
|
||
import ( | ||
"context" | ||
|
2 changes: 1 addition & 1 deletion
2
builder/builder-next/exporter/writer.go → ...lder-next/exporter/mobyexporter/writer.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package containerimage | ||
package mobyexporter | ||
|
||
import ( | ||
"context" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package overrides | ||
|
||
import ( | ||
"errors" | ||
|
||
"github.com/docker/distribution/reference" | ||
) | ||
|
||
// SanitizeRepoAndTags parses the raw names to a slice of repoAndTag. | ||
// It removes duplicates and validates each repoName and tag to not contain a digest. | ||
func SanitizeRepoAndTags(names []string) (repoAndTags []string, err error) { | ||
uniqNames := map[string]struct{}{} | ||
for _, repo := range names { | ||
if repo == "" { | ||
continue | ||
} | ||
|
||
ref, err := reference.ParseNormalizedNamed(repo) | ||
if err != nil { | ||
return nil, err | ||
} | ||
|
||
if _, ok := ref.(reference.Digested); ok { | ||
return nil, errors.New("build tag cannot contain a digest") | ||
} | ||
|
||
nameWithTag := reference.TagNameOnly(ref).String() | ||
if _, exists := uniqNames[nameWithTag]; !exists { | ||
uniqNames[nameWithTag] = struct{}{} | ||
repoAndTags = append(repoAndTags, nameWithTag) | ||
} | ||
} | ||
return repoAndTags, nil | ||
} |
Oops, something went wrong.