install

package
v0.36.6 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2021 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Command = &cobra.Command{
	Use:    "install",
	Short:  "Install New Relic.",
	PreRun: client.RequireClient,
	Run: func(cmd *cobra.Command, args []string) {
		ic := types.InstallerContext{
			AssumeYes:          assumeYes,
			LocalRecipes:       localRecipes,
			RecipeNames:        recipeNames,
			RecipePaths:        recipePaths,
			SkipIntegrations:   skipIntegrations,
			SkipLoggingInstall: skipLoggingInstall,
			SkipApm:            skipApm,
			SkipInfraInstall:   skipInfra,
		}

		logLevel := configAPI.GetLogLevel()
		config.InitFileLogger(logLevel)

		err := assertProfileIsValid()
		if err != nil {
			log.Fatal(err)
		}

		i := NewRecipeInstaller(ic, client.NRClient)

		if err := i.Install(); err != nil {
			if err == types.ErrInterrupt {
				return
			}

			if _, ok := err.(*types.UpdateRequiredError); ok {
				return
			}

			fallbackErrorMsg := fmt.Sprintf("We encountered an issue during the installation: %s.", err)
			fallbackHelpMsg := "If this problem persists, visit the documentation and support page for additional help here at https://one.newrelic.com/-/06vjAeZLKjP."

			if _, ok := err.(*types.UncaughtError); ok {
				fmt.Print(fallbackErrorMsg)
				fmt.Printf("\nFor more information about about what happened, rerun the command using the --debug flag.\n")
				fmt.Print("\n  newrelic install --debug \n\n")
				fmt.Print(fallbackHelpMsg)
			} else {
				log.Debug(fallbackErrorMsg)
				log.Debug(fallbackHelpMsg)
			}

			fmt.Print("\n\n")
		}
	},
}

Command represents the install command.

Functions

This section is empty.

Types

type ConfigValidator added in v0.28.0

type ConfigValidator interface {
	Validate(ctx context.Context) error
}

type Discoverer added in v0.28.0

type Discoverer interface {
	Discover(context.Context) (*types.DiscoveryManifest, error)
}

Discoverer is responsible for discovering informataion about the host system.

type FileFilterer added in v0.28.0

type FileFilterer interface {
	Filter(context.Context, []types.OpenInstallationRecipe) ([]types.OpenInstallationLogMatch, error)
}

FileFilterer determines the existence of files on the underlying filesystem.

type LicenseKeyFetcher added in v0.20.6

type LicenseKeyFetcher interface {
	FetchLicenseKey(context.Context) (string, error)
}

func NewServiceLicenseKeyFetcher added in v0.20.6

func NewServiceLicenseKeyFetcher(client recipes.NerdGraphClient) LicenseKeyFetcher

type MockLicenseKeyFetcher added in v0.20.6

type MockLicenseKeyFetcher struct {
	FetchLicenseKeyFunc func(ctx context.Context) (string, error)
}

func NewMockLicenseKeyFetcher added in v0.20.6

func NewMockLicenseKeyFetcher() *MockLicenseKeyFetcher

func (*MockLicenseKeyFetcher) FetchLicenseKey added in v0.20.6

func (f *MockLicenseKeyFetcher) FetchLicenseKey(ctx context.Context) (string, error)

type Prompter added in v0.28.0

type Prompter interface {
	PromptYesNo(msg string) (bool, error)
	MultiSelect(msg string, options []string) ([]string, error)
}

type RecipeFileFetcher added in v0.28.0

type RecipeFileFetcher interface {
	FetchRecipeFile(recipeURL *url.URL) (*types.OpenInstallationRecipe, error)
	LoadRecipeFile(filename string) (*types.OpenInstallationRecipe, error)
}

type RecipeFilterRunner added in v0.28.0

type RecipeFilterRunner interface {
	RunFilterAll(ctx context.Context, r []types.OpenInstallationRecipe, m *types.DiscoveryManifest) []types.OpenInstallationRecipe
	EnsureDoesNotFilter(ctx context.Context, r []types.OpenInstallationRecipe, m *types.DiscoveryManifest) error
}

type RecipeInstallFunc added in v0.28.0

type RecipeInstaller

type RecipeInstaller struct {
	types.InstallerContext
	// contains filtered or unexported fields
}

func NewRecipeInstaller

func NewRecipeInstaller(ic types.InstallerContext, nrClient *newrelic.NewRelic) *RecipeInstaller

func (*RecipeInstaller) Install

func (i *RecipeInstaller) Install() error

type RecipeRepository added in v0.28.0

type RecipeRepository interface {
	FindAll(m types.DiscoveryManifest) []types.OpenInstallationRecipe
}

type RecipeValidator added in v0.28.0

type RecipeValidator interface {
	ValidateRecipe(context.Context, types.DiscoveryManifest, types.OpenInstallationRecipe) (entityGUID string, err error)
}

RecipeValidator validates installation of a recipe.

type RecipeVarPreparer added in v0.28.0

type RecipeVarPreparer interface {
	Prepare(m types.DiscoveryManifest, r types.OpenInstallationRecipe, assumeYes bool, licenseKey string) (types.RecipeVars, error)
}

type ServiceLicenseKeyFetcher added in v0.20.6

type ServiceLicenseKeyFetcher struct {
	// contains filtered or unexported fields
}

relies on the Nerdgraph service

func (*ServiceLicenseKeyFetcher) FetchLicenseKey added in v0.20.6

func (f *ServiceLicenseKeyFetcher) FetchLicenseKey(ctx context.Context) (string, error)

Directories

Path Synopsis
Code generated by tutone: DO NOT EDIT
Code generated by tutone: DO NOT EDIT

Jump to

Keyboard shortcuts

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