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 exported main function #473

Open
alex123012 opened this issue Apr 24, 2024 · 1 comment
Open

Add exported main function #473

alex123012 opened this issue Apr 24, 2024 · 1 comment

Comments

@alex123012
Copy link
Contributor

alex123012 commented Apr 24, 2024

Is your feature request related to a problem? Please describe.

Writing go hooks requires to clone addon-operator repo or copy cmd/addon-operator/main.go file to own repo

Describe the solution you'd like to see

Add easy-to-import main function.
For example, move all cmd/addon-operator/main.go logic to pkg/app/main.go file, make main func exported and import it in cmd/addon-operator/main.go like this:

package main

import (
	"github.com/flant/addon-operator/pkg/app"
)

func main() {
	app.Run() // app.Main()/app.RunAddonOperator()/anything else
}

Another solution would be adding smth like "hooks discovery" script or package, that will scan repo with go hooks on build time and generate shallow imports of them with sdk

Describe alternatives you've considered
Simple copy of cmd/addon-operator/main.go

@raabdullaev
Copy link
Contributor

@alex123012 are you interested in this feature? Maybe you'll implement it by yourself? :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants