-
Notifications
You must be signed in to change notification settings - Fork 362
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
1 parent
25b39ce
commit b89013c
Showing
2,571 changed files
with
339,840 additions
and
18,365 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
package util | ||
|
||
import ( | ||
"github.com/pkg/errors" | ||
"os" | ||
"path/filepath" | ||
) | ||
|
||
// DiscoverKubefile tries to find a Kubefile within the provided `path`. | ||
func DiscoverKubefile(path string) (foundFile string, err error) { | ||
// Test for existence of the file | ||
target, err := os.Stat(path) | ||
if err != nil { | ||
return "", errors.Wrap(err, "discovering Kubefile") | ||
} | ||
|
||
switch mode := target.Mode(); { | ||
case mode.IsDir(): | ||
// If the path is a real directory, we assume a Kubefile within it | ||
kubefile := filepath.Join(path, "Kubefile") | ||
|
||
// Test for existence of the Kubefile file | ||
file, err := os.Stat(kubefile) | ||
if err != nil { | ||
return "", errors.Wrap(err, "cannot find Kubefile in context directory") | ||
} | ||
|
||
// The file exists, now verify the correct mode | ||
if mode := file.Mode(); mode.IsRegular() { | ||
foundFile = kubefile | ||
} else { | ||
return "", errors.Errorf("assumed Kubefile %q is not a file", kubefile) | ||
} | ||
|
||
case mode.IsRegular(): | ||
// If the context dir is a file, we assume this as Kubefile | ||
foundFile = path | ||
} | ||
|
||
return foundFile, nil | ||
} |
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,15 @@ | ||
# implementation of sealer build | ||
|
||
## Abstract | ||
|
||
Generally, the image generated from sealer build has no differences with container images. The image is compatible with OCI. Let's call it cluster image. | ||
Sealer has some special operations based on the usual build of container images. Like (1) Adding a layer for storing containers | ||
images automatically; (2) Saving cluster image information to the annotations from manifest of OCI v1 images. Sealer doesn't implement | ||
the concrete building procedure. Sealer implements build over mature tools (we choose `buildah` currently). We will have an introduction for how the | ||
sealer build implements next. | ||
|
||
## Implement | ||
|
||
### Adaptor | ||
|
||
### Store Container Images |
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.