-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
23 changed files
with
884 additions
and
18 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
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 |
---|---|---|
@@ -1,9 +1,41 @@ | ||
package staging | ||
|
||
// ByAge implements sort.Interface for []Person based on | ||
// the Age field. | ||
type sortStageImageNamed []StagedImageNamed | ||
// sortStageImageNamedByName implements sort.Interface for []StagedImageNamed | ||
// based on the FullName field in an ascending order. | ||
type sortStagedImageNamedByName []StagedImageNamed | ||
|
||
func (a sortStageImageNamed) Len() int { return len(a) } | ||
func (a sortStageImageNamed) Less(i, j int) bool { return a[i].Ref.FullName() < a[j].Ref.FullName() } | ||
func (a sortStageImageNamed) Swap(i, j int) { a[i], a[j] = a[j], a[i] } | ||
func (a sortStagedImageNamedByName) Len() int { return len(a) } | ||
func (a sortStagedImageNamedByName) Less(i, j int) bool { | ||
return a[i].Ref.FullName() < a[j].Ref.FullName() | ||
} | ||
func (a sortStagedImageNamedByName) Swap(i, j int) { a[i], a[j] = a[j], a[i] } | ||
|
||
// sortStageImageNamedByNameDesc implements sort.Interface for []StagedImageNamed | ||
// based on the FullName field in an descending order. | ||
type sortStagedImageNamedByNameDesc []StagedImageNamed | ||
|
||
func (a sortStagedImageNamedByNameDesc) Len() int { return len(a) } | ||
func (a sortStagedImageNamedByNameDesc) Less(i, j int) bool { | ||
return a[i].Ref.FullName() > a[j].Ref.FullName() | ||
} | ||
func (a sortStagedImageNamedByNameDesc) Swap(i, j int) { a[i], a[j] = a[j], a[i] } | ||
|
||
// sortStagedImageNamedByAge implements sort.Interface for []StagedImageNamed | ||
// based on the CreationTime field in an ascending order. | ||
type sortStagedImageNamedByAge []StagedImageNamed | ||
|
||
func (a sortStagedImageNamedByAge) Len() int { return len(a) } | ||
func (a sortStagedImageNamedByAge) Less(i, j int) bool { | ||
return a[i].CreationTime.Before(a[j].CreationTime) | ||
} | ||
func (a sortStagedImageNamedByAge) Swap(i, j int) { a[i], a[j] = a[j], a[i] } | ||
|
||
// sortStagedImageNamedByAgeDesc implements sort.Interface for []StagedImageNamed | ||
// based on the CreationTime field in an descending order. | ||
type sortStagedImageNamedByAgeDesc []StagedImageNamed | ||
|
||
func (a sortStagedImageNamedByAgeDesc) Len() int { return len(a) } | ||
func (a sortStagedImageNamedByAgeDesc) Less(i, j int) bool { | ||
return a[i].CreationTime.After(a[j].CreationTime) | ||
} | ||
func (a sortStagedImageNamedByAgeDesc) Swap(i, j int) { a[i], a[j] = a[j], a[i] } |
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,26 @@ | ||
#!/usr/bin/env sh | ||
set -e | ||
|
||
help() { | ||
echo "Help..." | ||
} | ||
|
||
install() { | ||
# Let's copy our a machine-id if we | ||
# haven't currently stored it. | ||
if [ ! -e /etc/darch/hooks/current-machine-id ]; then | ||
if [ -e /etc/machine-id ]; then | ||
cp /etc/machine-id /etc/darch/hooks/current-machine-id | ||
fi | ||
fi | ||
|
||
cp /etc/darch/hooks/current-machine-id . || true | ||
} | ||
|
||
run() { | ||
if [ -e "$DARCH_HOOK_DIR/current-machine-id" ]; then | ||
rm -f "$DARCH_ROOT_FS/etc/machine-id" | ||
mkdir -p "$DARCH_ROOT_FS/etc" || true | ||
cp "$DARCH_HOOK_DIR/current-machine-id" "$DARCH_ROOT_FS/etc/machine-id" | ||
fi | ||
} |
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.