-
Notifications
You must be signed in to change notification settings - Fork 297
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a new
manifest
command to support multi-architecture builds (#1705
) Implement Pack Manifest commands in support of https://github.com/buildpacks/rfcs/blob/main/text/0124-pack-manifest-list-commands.md Signed-off-by: Husni Faiz <[email protected]> Signed-off-by: WYGIN <[email protected]> Signed-off-by: sai kiran <[email protected]> Signed-off-by: Juan Bustamante <[email protected]> Signed-off-by: Juan Bustamante <[email protected]> Signed-off-by: Sai Kiran Maggidi <[email protected]> Signed-off-by: Juan Bustamante <[email protected]> Co-authored-by: Juan Bustamante <[email protected]> Co-authored-by: WYGIN <[email protected]> Co-authored-by: sai kiran <[email protected]> Co-authored-by: Juan Bustamante <[email protected]> Co-authored-by: Sai Kiran Maggidi <[email protected]> Co-authored-by: Juan Bustamante <[email protected]>
- Loading branch information
1 parent
d3904d6
commit 67feb16
Showing
49 changed files
with
3,624 additions
and
23 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 |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package commands | ||
|
||
import ( | ||
"github.com/spf13/cobra" | ||
|
||
"github.com/buildpacks/pack/pkg/logging" | ||
) | ||
|
||
func NewManifestCommand(logger logging.Logger, client PackClient) *cobra.Command { | ||
cmd := &cobra.Command{ | ||
Use: "manifest", | ||
Short: "Interact with OCI image indexes", | ||
Long: `An image index is a higher-level manifest which points to specific image manifests and is ideal for one or more platforms; see: https://github.com/opencontainers/image-spec/ for more details | ||
'pack manifest' commands provide tooling to create, update, or delete images indexes or push them to a remote registry. | ||
'pack' will save a local copy of the image index at '$PACK_HOME/manifests'; the environment variable 'XDG_RUNTIME_DIR' | ||
can be set to override the location, allowing manifests to be edited locally before being pushed to a registry. | ||
These commands are experimental. For more information, consult the RFC which can be found at https://github.com/buildpacks/rfcs/blob/main/text/0124-pack-manifest-list-commands.md`, | ||
RunE: nil, | ||
} | ||
|
||
cmd.AddCommand(ManifestCreate(logger, client)) | ||
cmd.AddCommand(ManifestAdd(logger, client)) | ||
cmd.AddCommand(ManifestAnnotate(logger, client)) | ||
cmd.AddCommand(ManifestDelete(logger, client)) | ||
cmd.AddCommand(ManifestInspect(logger, client)) | ||
cmd.AddCommand(ManifestPush(logger, client)) | ||
cmd.AddCommand(ManifestRemove(logger, client)) | ||
|
||
AddHelpFlag(cmd, "manifest") | ||
return cmd | ||
} |
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,27 @@ | ||
package commands | ||
|
||
import ( | ||
"github.com/spf13/cobra" | ||
|
||
"github.com/buildpacks/pack/pkg/client" | ||
"github.com/buildpacks/pack/pkg/logging" | ||
) | ||
|
||
// ManifestAdd adds a new image to a manifest list (image index). | ||
func ManifestAdd(logger logging.Logger, pack PackClient) *cobra.Command { | ||
cmd := &cobra.Command{ | ||
Use: "add [OPTIONS] <manifest-list> <manifest> [flags]", | ||
Args: cobra.MatchAll(cobra.ExactArgs(2), cobra.OnlyValidArgs), | ||
Short: "Add an image to a manifest list.", | ||
Example: `pack manifest add my-image-index my-image:some-arch`, | ||
RunE: logError(logger, func(cmd *cobra.Command, args []string) (err error) { | ||
return pack.AddManifest(cmd.Context(), client.ManifestAddOptions{ | ||
IndexRepoName: args[0], | ||
RepoName: args[1], | ||
}) | ||
}), | ||
} | ||
|
||
AddHelpFlag(cmd, "add") | ||
return cmd | ||
} |
Oops, something went wrong.