upgradeinspectorv4

package
v0.0.0-...-66c7a0d Latest Latest
Warning

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

Go to latest
Published: Dec 26, 2024 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MIN_HAB_FREE_SPACE float64 = 5.5
	MIN_REQ_SPACE_STR          = "The %s directory should have at least %.1fGB of free space"
	ENSURE_SPACE               = "\nPlease ensure the available free space is %.1fGB\nand run "
	UPGRADE_CMD                = "chef-automate upgrade run --major"
	ES_DATA                    = "/svc/automate-elasticsearch/data"
)
View Source
const (
	INDEX_BATCH_SIZE int    = 10
	MSG_ES_CHECKING  string = "Elasticsearch indices are in version 6"
	BIG_SPACE               = "                "
	INDEX_ACTION            = `` /* 322-byte string literal not displayed */

)
View Source
const (
	S3_REGEX   = "https?://s3.(.*).amazonaws.com"
	NEW_S3_URL = "https://s3.amazonaws.com"
)
View Source
const (
	HAB_DIR            string = "/hab"
	UPGRADE_TERMINATED string = "Upgrade process terminated."
)
View Source
const (
	ES_URL = "http://localhost:10141/_cluster/settings"
)

Variables

This section is empty.

Functions

func NewUpgradeInspectorV4

func NewUpgradeInspectorV4(w *cli.Writer, upgradeUtils UpgradeV4Utils, fileUtils fileutils.FileUtils, timeout int64) inspector.Inspector

Types

type DisableShardingInspection

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

func NewDisableShardingInspection

func NewDisableShardingInspection(w *cli.Writer, utls UpgradeV4Utils) *DisableShardingInspection

func (*DisableShardingInspection) ExitHandler

func (ds *DisableShardingInspection) ExitHandler() error

func (*DisableShardingInspection) GetInstallationType

func (ds *DisableShardingInspection) GetInstallationType() inspector.InstallationType

func (*DisableShardingInspection) GetShortInfo

func (ds *DisableShardingInspection) GetShortInfo() []string

func (*DisableShardingInspection) Inspect

func (ds *DisableShardingInspection) Inspect() (err error)

func (*DisableShardingInspection) RollBackHandler

func (ds *DisableShardingInspection) RollBackHandler() (err error)

func (*DisableShardingInspection) ShowInfo

func (ds *DisableShardingInspection) ShowInfo(index *int) error

func (*DisableShardingInspection) Skip

func (ds *DisableShardingInspection) Skip()

type DiskSpaceInspection

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

func NewDiskSpaceInspection

func NewDiskSpaceInspection(w *cli.Writer, isExternal bool, osDestDir string, fileUtils fileutils.FileUtils) *DiskSpaceInspection

func (*DiskSpaceInspection) ExitHandler

func (ds *DiskSpaceInspection) ExitHandler() error

func (*DiskSpaceInspection) GetInstallationType

func (ds *DiskSpaceInspection) GetInstallationType() inspector.InstallationType

func (*DiskSpaceInspection) GetShortInfo

func (ds *DiskSpaceInspection) GetShortInfo() []string

func (*DiskSpaceInspection) GetSpaceNeeded

func (ds *DiskSpaceInspection) GetSpaceNeeded(habRootPath string) (habFreeSpace float64, esDataSize float64, err error)

func (*DiskSpaceInspection) Inspect

func (ds *DiskSpaceInspection) Inspect() error

func (*DiskSpaceInspection) ShowInfo

func (ds *DiskSpaceInspection) ShowInfo(index *int) (err error)

func (*DiskSpaceInspection) Skip

func (ds *DiskSpaceInspection) Skip()

type ESIndexInspection

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

func NewESIndexInspection

func NewESIndexInspection(w *cli.Writer, utls UpgradeV4Utils, esBasePath string) *ESIndexInspection

func (*ESIndexInspection) ExitHandler

func (es *ESIndexInspection) ExitHandler() error

func (*ESIndexInspection) GetInstallationType

func (es *ESIndexInspection) GetInstallationType() inspector.InstallationType

func (*ESIndexInspection) GetShortInfo

func (es *ESIndexInspection) GetShortInfo() []string

func (*ESIndexInspection) Inspect

func (es *ESIndexInspection) Inspect() (err error)

func (*ESIndexInspection) ShowInfo

func (es *ESIndexInspection) ShowInfo(index *int) error

func (*ESIndexInspection) Skip

func (es *ESIndexInspection) Skip()

type ESSettings

type ESSettings struct {
	TotalShardSettings int64 `json:"totalShardSettings" toml:"totalShardSettings"`
}

type EnableMaintenanceInspection

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

func NewEnableMaintenanceInspection

func NewEnableMaintenanceInspection(w *cli.Writer, utls UpgradeV4Utils, timeout int64) *EnableMaintenanceInspection

func (*EnableMaintenanceInspection) ExitHandler

func (em *EnableMaintenanceInspection) ExitHandler() error

func (*EnableMaintenanceInspection) GetInstallationType

func (em *EnableMaintenanceInspection) GetInstallationType() inspector.InstallationType

func (*EnableMaintenanceInspection) GetShortInfo

func (em *EnableMaintenanceInspection) GetShortInfo() []string

func (*EnableMaintenanceInspection) Inspect

func (em *EnableMaintenanceInspection) Inspect() (err error)

func (*EnableMaintenanceInspection) RollBackHandler

func (em *EnableMaintenanceInspection) RollBackHandler() (err error)

func (*EnableMaintenanceInspection) ShowInfo

func (em *EnableMaintenanceInspection) ShowInfo(index *int) error

func (*EnableMaintenanceInspection) Skip

func (em *EnableMaintenanceInspection) Skip()

type EnsureStatusInspection

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

func NewEnsureStatusInspection

func NewEnsureStatusInspection(w *cli.Writer, upgradeUtils UpgradeV4Utils) *EnsureStatusInspection

func (*EnsureStatusInspection) ExitHandler

func (es *EnsureStatusInspection) ExitHandler() error

func (*EnsureStatusInspection) GetInstallationType

func (es *EnsureStatusInspection) GetInstallationType() inspector.InstallationType

func (*EnsureStatusInspection) GetShortInfo

func (es *EnsureStatusInspection) GetShortInfo() []string

func (*EnsureStatusInspection) Inspect

func (es *EnsureStatusInspection) Inspect() (err error)

func (*EnsureStatusInspection) ShowInfo

func (es *EnsureStatusInspection) ShowInfo(index *int) error

func (*EnsureStatusInspection) Skip

func (es *EnsureStatusInspection) Skip()

type IndexData

type IndexData struct {
	Name          string
	MajorVersion  int64
	CreatedString string
	IsDeleted     bool
}

type IndexInfo

type IndexInfo struct {
	Settings struct {
		Index struct {
			Version struct {
				CreatedString string `json:"created_string"`
				Created       string `json:"created"`
			} `json:"version"`
		} `json:"index"`
	} `json:"settings"`
}

type IndicesShardTotal

type IndicesShardTotal struct {
	Indices struct {
		Shards struct {
			Total int64 `json:"total"`
		} `json:"shards"`
	} `json:"indices"`
}

type MockUpgradeV4UtilsImp

type MockUpgradeV4UtilsImp struct {
	IsExternalElasticSearchFunc func(timeout int64) bool
	ExecRequestFunc             func(url, methodType string, requestBody io.Reader) ([]byte, error)
	GetESBasePathFunc           func(timeout int64) string
	GetBackupS3URLFunc          func(timeout int64) (string, error)
	PatchS3backupURLFunc        func(timeout int64) (stdOut, stdErr string, err error)
	GetMaintenanceStatusFunc    func(timeout int64) (bool, error)
	SetMaintenanceModeFunc      func(timeout int64, status bool) (stdOut, stdErr string, err error)
	GetServicesStatusFunc       func() (bool, error)
}

func (*MockUpgradeV4UtilsImp) ExecRequest

func (utl *MockUpgradeV4UtilsImp) ExecRequest(url, methodType string, requestBody io.Reader) ([]byte, error)

func (*MockUpgradeV4UtilsImp) GetBackupS3URL

func (utl *MockUpgradeV4UtilsImp) GetBackupS3URL(timeout int64) (string, error)

func (*MockUpgradeV4UtilsImp) GetESBasePath

func (utl *MockUpgradeV4UtilsImp) GetESBasePath(timeout int64) string

func (*MockUpgradeV4UtilsImp) GetMaintenanceStatus

func (utl *MockUpgradeV4UtilsImp) GetMaintenanceStatus(timeout int64) (bool, error)

func (*MockUpgradeV4UtilsImp) GetServicesStatus

func (utl *MockUpgradeV4UtilsImp) GetServicesStatus() (bool, error)

func (*MockUpgradeV4UtilsImp) IsExternalElasticSearch

func (utl *MockUpgradeV4UtilsImp) IsExternalElasticSearch(timeout int64) bool

func (*MockUpgradeV4UtilsImp) PatchS3backupURL

func (utl *MockUpgradeV4UtilsImp) PatchS3backupURL(timeout int64) (stdOut, stdErr string, err error)

func (*MockUpgradeV4UtilsImp) SetMaintenanceMode

func (utl *MockUpgradeV4UtilsImp) SetMaintenanceMode(timeout int64, status bool) (stdOut, stdErr string, err error)

type PlannedDownTimeInspection

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

func NewPlannedDownTimeInspection

func NewPlannedDownTimeInspection(w *cli.Writer) *PlannedDownTimeInspection

func (*PlannedDownTimeInspection) ShowInfo

func (pd *PlannedDownTimeInspection) ShowInfo(index *int) error

type ReplaceS3UrlInspection

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

func NewReplaceS3UrlInspection

func NewReplaceS3UrlInspection(w *cli.Writer, utls UpgradeV4Utils, timeout int64) *ReplaceS3UrlInspection

func (*ReplaceS3UrlInspection) ExitHandler

func (ru *ReplaceS3UrlInspection) ExitHandler() error

func (*ReplaceS3UrlInspection) GetInstallationType

func (ru *ReplaceS3UrlInspection) GetInstallationType() inspector.InstallationType

func (*ReplaceS3UrlInspection) GetShortInfo

func (ru *ReplaceS3UrlInspection) GetShortInfo() []string

func (*ReplaceS3UrlInspection) Inspect

func (ru *ReplaceS3UrlInspection) Inspect() (err error)

func (*ReplaceS3UrlInspection) ShowInfo

func (ru *ReplaceS3UrlInspection) ShowInfo(index *int) error

func (*ReplaceS3UrlInspection) Skip

func (ru *ReplaceS3UrlInspection) Skip()

type StoreESSettingsInspection

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

func NewStoreESSettingsInspection

func NewStoreESSettingsInspection(w *cli.Writer, utls UpgradeV4Utils, fileutils fileutils.FileUtils, timeout int64) *StoreESSettingsInspection

func (*StoreESSettingsInspection) ExitHandler

func (ses *StoreESSettingsInspection) ExitHandler() error

func (*StoreESSettingsInspection) GetInstallationType

func (ses *StoreESSettingsInspection) GetInstallationType() inspector.InstallationType

func (*StoreESSettingsInspection) GetShortInfo

func (ses *StoreESSettingsInspection) GetShortInfo() []string

func (*StoreESSettingsInspection) Inspect

func (ses *StoreESSettingsInspection) Inspect() error

func (*StoreESSettingsInspection) ShowInfo

func (ses *StoreESSettingsInspection) ShowInfo(index *int) error

func (*StoreESSettingsInspection) Skip

func (ses *StoreESSettingsInspection) Skip()

type TakeBackupInspection

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

func NewTakeBackupInspection

func NewTakeBackupInspection(w *cli.Writer) *TakeBackupInspection

func (*TakeBackupInspection) ShowInfo

func (tb *TakeBackupInspection) ShowInfo(index *int) error

type UpgradeInspectorV4

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

func (*UpgradeInspectorV4) AddDefaultInspections

func (ui *UpgradeInspectorV4) AddDefaultInspections()

func (*UpgradeInspectorV4) AddInspection

func (ui *UpgradeInspectorV4) AddInspection(inspection inspector.Inspection)

func (*UpgradeInspectorV4) Inspect

func (ui *UpgradeInspectorV4) Inspect() (err error)

func (*UpgradeInspectorV4) RollBackChangesOnError

func (ui *UpgradeInspectorV4) RollBackChangesOnError() (err error)

func (*UpgradeInspectorV4) RunExitAction

func (ui *UpgradeInspectorV4) RunExitAction() error

func (*UpgradeInspectorV4) RunUpgradeInspector

func (ui *UpgradeInspectorV4) RunUpgradeInspector(osDestDir string, skipStorageCheck bool) (isError bool)

func (*UpgradeInspectorV4) SetOSDestDir

func (ui *UpgradeInspectorV4) SetOSDestDir(path string)

func (*UpgradeInspectorV4) SetSkipStoragecheckFlag

func (ui *UpgradeInspectorV4) SetSkipStoragecheckFlag(check bool)

func (*UpgradeInspectorV4) ShowInfo

func (ui *UpgradeInspectorV4) ShowInfo() error

func (*UpgradeInspectorV4) ShowInspectionList

func (ui *UpgradeInspectorV4) ShowInspectionList()

type UpgradeV4Utils

type UpgradeV4Utils interface {
	IsExternalElasticSearch(timeout int64) bool
	ExecRequest(url, methodType string, requestBody io.Reader) ([]byte, error)
	GetESBasePath(timeout int64) string
	GetBackupS3URL(timeout int64) (string, error)
	PatchS3backupURL(timeout int64) (stdOut, stdErr string, err error)
	GetMaintenanceStatus(timeout int64) (bool, error)
	SetMaintenanceMode(timeout int64, status bool) (stdOut, stdErr string, err error)
	GetServicesStatus() (bool, error)
}

func NewUpgradeV4Utils

func NewUpgradeV4Utils() UpgradeV4Utils

type UpgradeV4UtilsImp

type UpgradeV4UtilsImp struct{}

func (*UpgradeV4UtilsImp) ExecRequest

func (cu *UpgradeV4UtilsImp) ExecRequest(url, methodType string, requestBody io.Reader) ([]byte, error)

func (*UpgradeV4UtilsImp) GetBackupS3URL

func (cu *UpgradeV4UtilsImp) GetBackupS3URL(timeout int64) (string, error)

func (*UpgradeV4UtilsImp) GetESBasePath

func (cu *UpgradeV4UtilsImp) GetESBasePath(timeout int64) string

func (*UpgradeV4UtilsImp) GetMaintenanceStatus

func (cu *UpgradeV4UtilsImp) GetMaintenanceStatus(timeout int64) (bool, error)

func (*UpgradeV4UtilsImp) GetServicesStatus

func (cu *UpgradeV4UtilsImp) GetServicesStatus() (bool, error)

func (*UpgradeV4UtilsImp) IsExternalElasticSearch

func (cu *UpgradeV4UtilsImp) IsExternalElasticSearch(timeout int64) bool

func (*UpgradeV4UtilsImp) PatchS3backupURL

func (cu *UpgradeV4UtilsImp) PatchS3backupURL(timeout int64) (stdOut, stdErr string, err error)

func (*UpgradeV4UtilsImp) SetMaintenanceMode

func (cu *UpgradeV4UtilsImp) SetMaintenanceMode(timeout int64, status bool) (stdOut, stdErr string, err error)

Jump to

Keyboard shortcuts

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