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

Packer Plugin SDK for Subcommand #179

Open
gintering1000 opened this issue Apr 28, 2023 · 0 comments
Open

Packer Plugin SDK for Subcommand #179

gintering1000 opened this issue Apr 28, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@gintering1000
Copy link

gintering1000 commented Apr 28, 2023

Please search the existing issues for relevant feature requests, and use the
reaction feature
(https://blog.github.com/2016-03-10-add-reactions-to-pull-requests-issues-and-comments/)
to add upvotes to pre-existing requests.

Community Note

Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request.
Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request.
If you are interested in working on this issue or have submitted a pull request, please leave a comment.

Description

I am docker user. docker can manage image by tar file.
Docker can manage image by tar 'file' for local file operator
( Command-based centralized management of images related to operating systems )

# Save Image to File
docker image save [disk_file.tar] [loaded_dockerimage]

# Load from File
docker image load [disk_file.tar]

# Upload to Official/Selfhost Registry
docker push [loaded_dockerimage]

# Download to Official/Selfhost Registry
docker pull [dockerimagename from dockerhub]

Packer can't manage ISOfile by command

# Save Image to File : This is What I want to make
packer push packer.box

# Load from File : This is What I want to make
packer image load [disk_file.iso]

# Upload to Official/Selfhost Registry : Maybe HCL PackerHub
packer push [packer.box]

# Download to Official/Selfhost Registry : Maybe HCL PackerHub
packer pull [packer.box]

image

this is difference between Docker and Packer
So I'd like to make ISO manager by packer command
Even I can use Other tool, but Packer is only provisioning tool for ISOFile
And I Hope packer be All-in-One Tool.

Use Case(s)

subcommand Is main program feature
so.. if you make some feature for plugin developer, they can control subsubcommand

your team can make new SDK for this.
( and packer command team also have to make new subcommand for this. for example : packer plugincli )

# packer plugin [SubCLI] [Option]
packer plugincli isomanager -save Centos.iso
packer plugincli isomanager -load Centos.iso
packer plugincli isomanager -info Centos-Stream8
packer plugincli isomanager -list Windows

Any relevant use-cases that you see.

Potential configuration

import (
  "github.com/hashicorp/packer-plugin-sdk/plugin"
)

// this part
type ExampleCLI struct{}

type ExampleBuilder struct{}
type FooPostProcessor struct{}
type BarProvisioner struct{}

func main() {
    pps := plugin.NewSet()

    // this part
    pps.RegisterCLI("isomanager", new(ExampleCLI))

    pps.RegisterBuilder("example", new(ExampleBuilder))
    pps.RegisterBuilder(plugin.DEFAULT_NAME, new(AnotherBuilder))
    pps.RegisterPostProcessor("foo", new(FooPostProcessor))
    pps.RegisterProvisioner("bar", new(BarProvisioner))
    err := pps.Run()
    if err != nil {
        fmt.Fprintln(os.Stderr, err.Error())
        os.Exit(1)
    }
}

Potential References

@gintering1000 gintering1000 added the enhancement New feature or request label Apr 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant