Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
feat(local-stages-storage): introduce local storage independent of co…
…ntainer backend implementation * DockerServerStagesStorage removed, LocalStagesStorage introduced. * Implemented missing methods of both DockerServerBackend and BuildahBackend needed for independent LocalStagesStorage. * Multiarch manifests posting not implemented yet for docker server and buildah backends. * Arbitrary manifests posting not implemented yet for buildah backend. Signed-off-by: Timofey Kirillov <timofey.kirillov@flant.com>
- Loading branch information
1 parent
1737cc7
commit e6aa7f1
Showing
25 changed files
with
872 additions
and
642 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
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
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,31 @@ | ||
package thirdparty | ||
|
||
import "strings" | ||
|
||
func MatchesAncestor(imgName, imgID, argName string) bool { | ||
if MatchesID(imgID, argName) { | ||
return true | ||
} | ||
return MatchesReference(imgName, argName) | ||
} | ||
|
||
func MatchesID(imageID, argID string) bool { | ||
return strings.HasPrefix(imageID, argID) | ||
} | ||
|
||
func MatchesReference(name, argName string) bool { | ||
if argName == "" { | ||
return true | ||
} | ||
splitName := strings.Split(name, ":") | ||
// If the arg contains a tag, we handle it differently than if it does not | ||
if strings.Contains(argName, ":") { | ||
splitArg := strings.Split(argName, ":") | ||
return strings.HasSuffix(splitName[0], splitArg[0]) && (splitName[1] == splitArg[1]) | ||
} | ||
return strings.HasSuffix(splitName[0], argName) | ||
} | ||
|
||
func MatchesCtrName(ctrName, argName string) bool { | ||
return strings.Contains(ctrName, argName) | ||
} |
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
Oops, something went wrong.