addon-operator icon indicating copy to clipboard operation
addon-operator copied to clipboard

Add exported main function

Open alex123012 opened this issue 1 year ago • 1 comments

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

alex123012 avatar Apr 24 '24 10:04 alex123012

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

raabdullaev avatar Aug 07 '24 11:08 raabdullaev