app

package
v0.3.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 13, 2019 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	RunCmd = &cobra.Command{
		Use:   "run",
		Short: "start alameda admission-controller server",
		Long:  "",
		RunE: func(cmd *cobra.Command, args []string) error {

			flag.Parse()

			initConfig()
			initLog()

			if err := prepareRequirements(); err != nil {
				panic(err)
			}
			if err := setupRequirements(); err != nil {
				panic(err)
			}

			datahubResourceRecommendator, err := datahub.NewDatahubResourceRecommendatorWithConfig(config.Datahub)
			if err != nil {
				panic(err.Error())
			}
			admissionController, err := server.NewAdmissionControllerWithConfig(server.Config{Enable: config.Enable}, datahubResourceRecommendator)
			if err != nil {
				panic(err.Error())
			}

			mux := http.NewServeMux()
			registerHandlerFunc(mux, admissionController)

			server := newHTTPServer(*config, mux)
			if err := server.ListenAndServeTLS("", ""); err != nil {
				panic(err.Error())
			}

			return nil
		},
	}
)
View Source
var (
	VersionCmd = &cobra.Command{
		Use:   "version",
		Short: "Display the alameda admission-controller version",
		Long:  "",
		Run: func(cmd *cobra.Command, args []string) {
			app.PrintSoftwareVer()
		},
	}
)

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL