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

Add pack remove-registry command #877

Merged
merged 2 commits into from
Oct 20, 2020
Merged

Add pack remove-registry command #877

merged 2 commits into from
Oct 20, 2020

Conversation

elbandito
Copy link
Member

Summary

This PR provides a new pack command for removing registries via pack remove-registry

Output

New

❯ pack
CLI for building apps using Cloud Native Buildpacks

Usage:
  pack [command]

Available Commands:
  remove-registry           Remove registry

Use "pack [command] --help" for more information about a command.
❯ pack remove-registry --help
Remove registry

Usage:
  pack remove-registry <name> [flags]

Examples:
pack remove-registry myregistry

Flags:
  -h, --help   Help for 'remove-registry'

Global Flags:
      --no-color     Disable color output
  -q, --quiet        Show less output
      --timestamps   Enable timestamps in output
  -v, --verbose      Show more output

Documentation

  • Should this change be documented?
    • [ X ] Yes, see #___
    • No

Related

Resolves #745

@elbandito elbandito marked this pull request as ready for review October 5, 2020 22:18
@elbandito elbandito requested a review from a team as a code owner October 5, 2020 22:18
@elbandito elbandito requested a review from jromero October 5, 2020 22:18
@codecov
Copy link

codecov bot commented Oct 5, 2020

Codecov Report

Merging #877 into main will increase coverage by 0.16%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #877      +/-   ##
==========================================
+ Coverage   76.15%   76.30%   +0.16%     
==========================================
  Files          87       88       +1     
  Lines        4464     4493      +29     
==========================================
+ Hits         3399     3428      +29     
  Misses        710      710              
  Partials      355      355              
Flag Coverage Δ
#os_linux 76.26% <ø> (+0.16%) ⬆️
#os_macos 72.94% <ø> (+0.18%) ⬆️
#os_windows 100.00% <ø> (ø)
#unit 76.30% <ø> (+0.16%) ⬆️

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

internal/commands/remove_registry_test.go Outdated Show resolved Hide resolved
internal/commands/remove_registry.go Outdated Show resolved Hide resolved
@elbandito elbandito force-pushed the remove_registry branch 6 times, most recently from f9009ee to b2a5386 Compare October 6, 2020 23:38
@elbandito elbandito requested a review from jromero October 7, 2020 14:47
}
config.Write(cfg, cfgPath)

logger.Infof("Successfully removed %s to from registries", style.Symbol(registryName))
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
logger.Infof("Successfully removed %s to from registries", style.Symbol(registryName))
logger.Infof("Successfully removed %s from registries", style.Symbol(registryName))

return nil
}),
}
cmd.Example = "pack remove-registry myregistry"
Copy link
Member

Choose a reason for hiding this comment

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

nit: Move to the definition of the cobra.Command

Comment on lines +24 to +28
if registryName == config.OfficialRegistryName {
return errors.Errorf("%s is a reserved registry name, please provide a different registry",
style.Symbol(config.OfficialRegistryName))
}
Copy link
Member

Choose a reason for hiding this comment

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

Are we sure this is the desired behavior? Users could want to remove it for security/compliance purposes, for instance

Copy link
Member Author

Choose a reason for hiding this comment

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

The desired behavior is to always provide a functioning default registry by default, which is why we have this in place. For the question on security/compliance, I'm not concerned at this point. I'd rather get some customer feedback before making too many assumptions.

Signed-off-by: Travis <longoria.public@gmail.com>
@jromero jromero changed the title feat: pack remove-registry Add pack remove-registry command Oct 20, 2020
@jromero jromero added this to the 0.15.0 milestone Oct 20, 2020
@jromero jromero added experimental Issue or PR refers to an experimental feature. type/enhancement Issue that requests a new feature or improvement. labels Oct 20, 2020
@jromero jromero merged commit 2a32bd9 into main Oct 20, 2020
@jromero jromero deleted the remove_registry branch October 20, 2020 16:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
experimental Issue or PR refers to an experimental feature. type/enhancement Issue that requests a new feature or improvement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Buildpack Registry config commands
3 participants