Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move inspect-builder and inspect-buildpack to relevant subcommands #1071

Merged
merged 6 commits into from
Mar 5, 2021

Conversation

dfreilich
Copy link
Member

Summary

Output

Before

$  pack
CLI for building apps using Cloud Native Buildpacks

Usage:
  pack [command]

Available Commands:
...
  inspect-image         Show information about a built image
  inspect-buildpack     Show information about a buildpack
  inspect-builder       Show information about a builder
...

After

$  out/pack
CLI for building apps using Cloud Native Buildpacks

Usage:
  pack [command]

Available Commands:
  build                 Generate app image from source code
  builder               Interact with builders
  buildpack             Interact with buildpacks
  config                Interact with your local pack config file
  inspect               Show information about a built app image
...
$  out/pack builder
Interact with builders

Usage:
  pack builder [command]

Aliases:
  builder, builders

Available Commands:
  create      Create builder image
  inspect     Show information about a builder
  suggest     List the recommended builders
$  out/pack buildpack
Interact with buildpacks

Usage:
  pack buildpack [command]

Aliases:
  buildpack, buildpacks

Available Commands:
  inspect     Show information about a buildpack
  package     Package a buildpack in OCI format.
  pull        Pull a buildpack from a registry and store it locally
  register    Register a buildpack to a registry
  yank        Yank a buildpack from a registry
$  out/pack inspect buildpacksio/pack
Inspecting image: buildpacksio/pack

REMOTE:

Stack: io.paketo.stacks.tiny
...
$  out/pack builder inspect
Inspecting default builder: paketobuildpacks/builder:base
...
$  out/pack builder inspect cnbs/sample-builder:alpine
Inspecting builder: cnbs/sample-builder:alpine

REMOTE:
 $  out/pack buildpack inspect paketo-buildpacks/go
Inspecting buildpack: paketo-buildpacks/go

REGISTRY IMAGE:
...

Documentation

  • Should this change be documented?
    • No → This will be done automatically through generation of pack documents

Related

Resolves #920
Resolves #597 (finally)

@dfreilich dfreilich requested a review from a team as a code owner February 10, 2021 11:23
@github-actions github-actions bot added type/chore Issue that requests non-user facing changes. type/enhancement Issue that requests a new feature or improvement. labels Feb 10, 2021
@github-actions github-actions bot added this to the 0.18.0 milestone Feb 10, 2021
@codecov
Copy link

codecov bot commented Feb 10, 2021

Codecov Report

Merging #1071 (8bf0cd5) into main (124f17d) will increase coverage by 0.13%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1071      +/-   ##
==========================================
+ Coverage   80.38%   80.51%   +0.13%     
==========================================
  Files         133      135       +2     
  Lines        8170     8221      +51     
==========================================
+ Hits         6567     6618      +51     
  Misses       1174     1174              
  Partials      429      429              
Flag Coverage Δ
os_linux 79.98% <100.00%> (+0.20%) ⬆️
os_macos 77.49% <100.00%> (+0.17%) ⬆️
os_windows 80.42% <100.00%> (+0.13%) ⬆️
unit 79.98% <100.00%> (+0.15%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Comment on lines +36 to +39
imageName := cfg.DefaultBuilder
if len(args) >= 1 {
imageName = args[0]
}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was previously an undocumented feature. I've added it to the long description of the command now.

buildpackName := args[0]
registry := flags.Registry
if registry == "" {
registry = cfg.DefaultRegistryName
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a slight change of behavior – in inspect-builder, it checks the configs default-registry, rather than default-registry-name, but given that default-registry is deprecated, I thought it appropriate to use the newer default-registry-name for the updated command.

@dfreilich dfreilich removed the type/chore Issue that requests non-user facing changes. label Feb 10, 2021
dfreilich added a commit that referenced this pull request Feb 15, 2021
* Remove trust-builder, untrust-builder, and list-trusted-builders acceptance tests (they are currently tested under the config when block

* Move inspect-buildpack into the buildpack block, to allow for easier restructuring for #1071

Signed-off-by: David Freilich <dfreilich@vmware.com>
…uilder and inspect-buildpack commands

* Rename inspect-image to inspect, and add alias for inspect-image
* Change behavior for inspect-buildpack to look at default registry name in config, rather than deprecated default registry

Signed-off-by: David Freilich <dfreilich@vmware.com>
Signed-off-by: David Freilich <dfreilich@vmware.com>
Signed-off-by: David Freilich <dfreilich@vmware.com>
Signed-off-by: David Freilich <dfreilich@vmware.com>
@github-actions github-actions bot added the type/chore Issue that requests non-user facing changes. label Mar 5, 2021
Signed-off-by: David Freilich <dfreilich@vmware.com>
Signed-off-by: David Freilich <dfreilich@vmware.com>
last := len(parts) - 1
cmdParts = append(cmdParts, parts[:last]...)
search = parts[last]
} else {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change was to enable seeing whether pack supports a top-level command, which otherwise didn't work appropriately.

@dfreilich dfreilich merged commit eb64185 into main Mar 5, 2021
@dfreilich dfreilich deleted the 920-inspect-command branch March 5, 2021 13:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/chore Issue that requests non-user facing changes. type/enhancement Issue that requests a new feature or improvement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

pack inspect subcommand Use resource-based subcommands
1 participant