-
Notifications
You must be signed in to change notification settings - Fork 106
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Anthony Emengo <[email protected]>
- Loading branch information
Anthony Emengo
committed
Jan 19, 2022
1 parent
4a6089b
commit 748ef78
Showing
9 changed files
with
2,503 additions
and
5 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,45 @@ | ||
package main | ||
|
||
import ( | ||
"github.com/buildpacks/lifecycle" | ||
"github.com/buildpacks/lifecycle/cmd" | ||
) | ||
|
||
type extendCmd struct { | ||
extendArgs | ||
} | ||
|
||
type extendArgs struct { | ||
platform Platform | ||
mode string | ||
} | ||
|
||
func (e *extendCmd) DefineFlags() { | ||
// no-op | ||
} | ||
|
||
func (e *extendCmd) Args(nargs int, args []string) error { | ||
if len(args) == 0 { | ||
return nil | ||
} | ||
|
||
e.extendArgs.mode = args[0] | ||
return nil | ||
} | ||
|
||
func (e *extendCmd) Privileges() error { | ||
return nil | ||
} | ||
|
||
func (e *extendCmd) Exec() error { | ||
return e.extend() | ||
} | ||
|
||
func (e extendArgs) extend() error { | ||
extender := &lifecycle.Extender{ | ||
Logger: cmd.DefaultLogger, | ||
Mode: e.mode, | ||
} | ||
|
||
return extender.Extend() | ||
} |
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,23 @@ | ||
package lifecycle | ||
|
||
import ( | ||
"os" | ||
"os/exec" | ||
) | ||
|
||
type Extender struct { | ||
Logger Logger | ||
Mode string | ||
} | ||
|
||
func (e *Extender) Extend() error { | ||
mode := "kaniko" | ||
if e.Mode != ""{ | ||
mode = e.Mode | ||
} | ||
|
||
cmd := exec.Command("/cnb/lifecycle/extender", mode) | ||
cmd.Stdout = os.Stdout | ||
cmd.Stderr = os.Stderr | ||
return cmd.Run() | ||
} |
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 @@ | ||
module github.com/buildpacks/lifecycle/extender | ||
|
||
go 1.16 | ||
|
||
require ( | ||
github.com/redhat-buildpacks/poc/kaniko v0.0.0-00010101000000-000000000000 | ||
) | ||
|
||
replace ( | ||
github.com/Azure/go-autorest => github.com/Azure/go-autorest v14.2.0+incompatible | ||
github.com/containerd/containerd v1.4.0-0.20191014053712-acdcf13d5eaf => github.com/containerd/containerd v0.0.0-20191014053712-acdcf13d5eaf | ||
github.com/docker/docker v1.14.0-0.20190319215453-e7b5f7dbe98c => github.com/docker/docker v0.0.0-20190319215453-e7b5f7dbe98c | ||
github.com/redhat-buildpacks/poc/kaniko => ../../poc/kaniko/code | ||
github.com/tonistiigi/fsutil v0.0.0-20190819224149-3d2716dd0a4d => github.com/tonistiigi/fsutil v0.0.0-20191018213012-0f039a052ca1 | ||
) |
Oops, something went wrong.