internal

package
v0.0.0-...-dc8ed20 Latest Latest
Warning

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

Go to latest
Published: May 21, 2021 License: Apache-2.0, Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	GitKymaProject = "kyma-project"
	GitKymaRepo    = "kyma"
)

GitKymaProject and GitKymaRepo define public Kyma GitHub parameters used for external evaluation.

View Source
const (
	LicenceTypeLite = "TestDevelopmentAndDemo"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AvsEvaluationStatus

type AvsEvaluationStatus struct {
	Current  string `json:"current_value"`
	Original string `json:"original_value"`
}

type AvsLifecycleData

type AvsLifecycleData struct {
	AvsEvaluationInternalId int64 `json:"avs_evaluation_internal_id"`
	AVSEvaluationExternalId int64 `json:"avs_evaluation_external_id"`

	AvsInternalEvaluationStatus AvsEvaluationStatus `json:"avs_internal_evaluation_status"`
	AvsExternalEvaluationStatus AvsEvaluationStatus `json:"avs_external_evaluation_status"`

	AVSInternalEvaluationDeleted bool `json:"avs_internal_evaluation_deleted"`
	AVSExternalEvaluationDeleted bool `json:"avs_external_evaluation_deleted"`
}

type CloudProvider

type CloudProvider string
const (
	Azure           CloudProvider = "Azure"
	AWS             CloudProvider = "AWS"
	Gcp             CloudProvider = "GCP"
	UnknownProvider CloudProvider = "unknown"
)

type ComponentConfigurationInputList

type ComponentConfigurationInputList []*gqlschema.ComponentConfigurationInput

func (ComponentConfigurationInputList) DeepCopy

type ConnectivityData

type ConnectivityData struct {
	Instance ServiceManagerInstanceInfo `json:"instance"`

	BindingID string `json:"bindingId"`
	Overrides string `json:"overrides"`
}

type DeprovisioningOperation

type DeprovisioningOperation struct {
	Operation

	SMClientFactory SMClientFactory `json:"-"`

	// Temporary indicates that this deprovisioning operation must not remove the instance
	Temporary bool `json:"temporary"`
}

DeprovisioningOperation holds all information about de-provisioning operation

func NewDeprovisioningOperationWithID

func NewDeprovisioningOperationWithID(operationID string, instance *Instance) (DeprovisioningOperation, error)

NewDeprovisioningOperationWithID creates a fresh (just starting) instance of the DeprovisioningOperation with provided ID

func NewSuspensionOperationWithID

func NewSuspensionOperationWithID(operationID string, instance *Instance) DeprovisioningOperation

NewSuspensionOperationWithID creates a fresh (just starting) instance of the DeprovisioningOperation which does not remove the instance.

func (*DeprovisioningOperation) ServiceManagerClient

func (do *DeprovisioningOperation) ServiceManagerClient(log logrus.FieldLogger) (servicemanager.Client, error)

type ERSContext

type ERSContext struct {
	TenantID        string                  `json:"tenant_id"`
	SubAccountID    string                  `json:"subaccount_id"`
	GlobalAccountID string                  `json:"globalaccount_id"`
	ServiceManager  *ServiceManagerEntryDTO `json:"sm_platform_credentials,omitempty"`
	Active          *bool                   `json:"active,omitempty"`
	UserID          string                  `json:"user_id"`
}

type EmsData

type EmsData struct {
	Instance ServiceManagerInstanceInfo `json:"instance"`

	BindingID string `json:"bindingId"`
	Overrides string `json:"overrides"`
}

type EventHub

type EventHub struct {
	Deleted bool `json:"event_hub_deleted"`
}

type Instance

type Instance struct {
	InstanceID      string
	RuntimeID       string
	GlobalAccountID string
	SubAccountID    string
	ServiceID       string
	ServiceName     string
	ServicePlanID   string
	ServicePlanName string

	DashboardURL   string
	Parameters     ProvisioningParameters
	ProviderRegion string

	InstanceDetails InstanceDetails

	CreatedAt time.Time
	UpdatedAt time.Time
	DeletedAt time.Time

	Version int
}

func (*Instance) GetInstanceDetails

func (i *Instance) GetInstanceDetails() (InstanceDetails, error)

type InstanceDetails

type InstanceDetails struct {
	Avs      AvsLifecycleData `json:"avs"`
	EventHub EventHub         `json:"eh"`

	SubAccountID string           `json:"sub_account_id"`
	RuntimeID    string           `json:"runtime_id"`
	ShootName    string           `json:"shoot_name"`
	ShootDomain  string           `json:"shoot_domain"`
	XSUAA        XSUAAData        `json:"xsuaa"`
	Ems          EmsData          `json:"ems"`
	Connectivity ConnectivityData `json:"connectivity"`
}

type InstanceStats

type InstanceStats struct {
	TotalNumberOfInstances int
	PerGlobalAccountID     map[string]int
}

InstanceStats provide number of instances per Global Account ID

type InstanceWithOperation

type InstanceWithOperation struct {
	Instance

	Type        sql.NullString
	State       sql.NullString
	Description sql.NullString
}

type Operation

type Operation struct {
	// following fields are serialized to JSON and stored in the storage
	InstanceDetails

	ID        string        `json:"-"`
	Version   int           `json:"-"`
	CreatedAt time.Time     `json:"-"`
	UpdatedAt time.Time     `json:"-"`
	Type      OperationType `json:"-"`

	InstanceID             string                    `json:"-"`
	ProvisionerOperationID string                    `json:"-"`
	State                  domain.LastOperationState `json:"-"`
	Description            string                    `json:"-"`
	ProvisioningParameters ProvisioningParameters    `json:"-"`

	// OrchestrationID specifies the origin orchestration which triggers the operation, empty for OSB operations (provisioning/deprovisioning)
	OrchestrationID string              `json:"-"`
	FinishedStages  map[string]struct{} `json:"-"`
}

func (*Operation) FinishStage

func (o *Operation) FinishStage(stageName string)

func (*Operation) IsFinished

func (o *Operation) IsFinished() bool

func (*Operation) IsStageFinished

func (o *Operation) IsStageFinished(stage string) bool

type OperationStats

type OperationStats struct {
	Provisioning   map[domain.LastOperationState]int
	Deprovisioning map[domain.LastOperationState]int
}

OperationStats provide number of operations per type and state

type OperationType

type OperationType string

OperationType defines the possible types of an asynchronous operation to a broker.

const (
	// OperationTypeProvision means provisioning OperationType
	OperationTypeProvision OperationType = "provision"
	// OperationTypeDeprovision means deprovision OperationType
	OperationTypeDeprovision OperationType = "deprovision"
	// OperationTypeUndefined means undefined OperationType
	OperationTypeUndefined OperationType = ""
	// OperationTypeUpgradeKyma means upgrade Kyma OperationType
	OperationTypeUpgradeKyma OperationType = "upgradeKyma"
	// OperationTypeUpgradeCluster means upgrade cluster (shoot) OperationType
	OperationTypeUpgradeCluster OperationType = "upgradeCluster"
)

type Orchestration

type Orchestration struct {
	OrchestrationID string
	Type            orchestration.Type
	State           string
	Description     string
	CreatedAt       time.Time
	UpdatedAt       time.Time
	Parameters      orchestration.Parameters
}

Orchestration holds all information about an orchestration. Orchestration performs operations of a specific type (UpgradeKymaOperation, UpgradeClusterOperation) on specific targets of SKRs.

func (*Orchestration) IsCanceled

func (o *Orchestration) IsCanceled() bool

IsCanceled returns true if orchestration's cancellation endpoint was ever triggered

func (*Orchestration) IsFinished

func (o *Orchestration) IsFinished() bool

type ProvisionerInputCreator

type ProvisionerInputCreator interface {
	SetProvisioningParameters(params ProvisioningParameters) ProvisionerInputCreator
	SetShootName(string) ProvisionerInputCreator
	SetLabel(key, value string) ProvisionerInputCreator
	// Deprecated, use: AppendOverrides
	SetOverrides(component string, overrides []*gqlschema.ConfigEntryInput) ProvisionerInputCreator
	AppendOverrides(component string, overrides []*gqlschema.ConfigEntryInput) ProvisionerInputCreator
	AppendGlobalOverrides(overrides []*gqlschema.ConfigEntryInput) ProvisionerInputCreator
	CreateProvisionRuntimeInput() (gqlschema.ProvisionRuntimeInput, error)
	CreateUpgradeRuntimeInput() (gqlschema.UpgradeRuntimeInput, error)
	CreateUpgradeShootInput() (gqlschema.UpgradeShootInput, error)
	EnableOptionalComponent(componentName string) ProvisionerInputCreator
}

type ProvisioningOperation

type ProvisioningOperation struct {
	Operation

	RuntimeVersion RuntimeVersionData `json:"runtime_version"`
	DashboardURL   string             `json:"dashboardURL"`

	// following fields are not stored in the storage
	InputCreator ProvisionerInputCreator `json:"-"`

	SMClientFactory SMClientFactory `json:"-"`
}

ProvisioningOperation holds all information about provisioning operation

func NewProvisioningOperation

func NewProvisioningOperation(instanceID string, parameters ProvisioningParameters) (ProvisioningOperation, error)

NewProvisioningOperation creates a fresh (just starting) instance of the ProvisioningOperation

func NewProvisioningOperationWithID

func NewProvisioningOperationWithID(operationID, instanceID string, parameters ProvisioningParameters) (ProvisioningOperation, error)

NewProvisioningOperationWithID creates a fresh (just starting) instance of the ProvisioningOperation with provided ID

func (*ProvisioningOperation) ProvideServiceManagerCredentials

func (po *ProvisioningOperation) ProvideServiceManagerCredentials(log logrus.FieldLogger) (*servicemanager.Credentials, error)

func (*ProvisioningOperation) ServiceManagerClient

func (po *ProvisioningOperation) ServiceManagerClient(log logrus.FieldLogger) (servicemanager.Client, error)

type ProvisioningParameters

type ProvisioningParameters struct {
	PlanID     string                    `json:"plan_id"`
	ServiceID  string                    `json:"service_id"`
	ErsContext ERSContext                `json:"ers_context"`
	Parameters ProvisioningParametersDTO `json:"parameters"`

	// PlatformRegion defines the Platform region send in the request path, terminology:
	//  - `Platform` is a place where KEB is registered and which later sends request to KEB.
	//  - `Region` value is use e.g. for billing integration such as EDP.
	PlatformRegion string `json:"platform_region"`

	PlatformProvider CloudProvider `json:"platform_provider"`
}

func (ProvisioningParameters) IsEqual

type ProvisioningParametersDTO

type ProvisioningParametersDTO struct {
	Name         string  `json:"name"`
	TargetSecret *string `json:"targetSecret"`
	VolumeSizeGb *int    `json:"volumeSizeGb"`
	MachineType  *string `json:"machineType"`
	Region       *string `json:"region"`
	Purpose      *string `json:"purpose"`
	// LicenceType - based on this parameter, some options can be enabled/disabled when preparing the input
	// for the provisioner e.g. use default overrides for SKR instead overrides from resource
	// with "provisioning-runtime-override" label when LicenceType is "TestDevelopmentAndDemo"
	LicenceType                 *string  `json:"licence_type"`
	Zones                       []string `json:"zones"`
	ZonesCount                  *int     `json:"zonesCount"`
	AutoScalerMin               *int     `json:"autoScalerMin"`
	AutoScalerMax               *int     `json:"autoScalerMax"`
	MaxSurge                    *int     `json:"maxSurge"`
	MaxUnavailable              *int     `json:"maxUnavailable"`
	OptionalComponentsToInstall []string `json:"components"`
	KymaVersion                 string   `json:"kymaVersion"`
	//Provider - used in Trial plan to determine which cloud provider to use during provisioning
	Provider *CloudProvider `json:"provider"`
}

type RuntimeState

type RuntimeState struct {
	ID string `json:"id"`

	CreatedAt time.Time `json:"created_at"`

	RuntimeID   string `json:"runtimeId"`
	OperationID string `json:"operationId"`

	KymaConfig    gqlschema.KymaConfigInput     `json:"kymaConfig"`
	ClusterConfig gqlschema.GardenerConfigInput `json:"clusterConfig"`
}

func NewRuntimeState

func NewRuntimeState(runtimeID, operationID string, kymaConfig *gqlschema.KymaConfigInput, clusterConfig *gqlschema.GardenerConfigInput) RuntimeState

type RuntimeVersionData

type RuntimeVersionData struct {
	Version string               `json:"version"`
	Origin  RuntimeVersionOrigin `json:"origin"`
}

RuntimeVersionData describes the Kyma Version used for the cluster provisioning or upgrade

func NewRuntimeVersionFromAccountMapping

func NewRuntimeVersionFromAccountMapping(version string) *RuntimeVersionData

func NewRuntimeVersionFromDefaults

func NewRuntimeVersionFromDefaults(version string) *RuntimeVersionData

func NewRuntimeVersionFromParameters

func NewRuntimeVersionFromParameters(version string) *RuntimeVersionData

func (RuntimeVersionData) IsEmpty

func (rv RuntimeVersionData) IsEmpty() bool

type RuntimeVersionOrigin

type RuntimeVersionOrigin string

RuntimeVersionOrigin defines the possible sources of the Kyma Version parameter

const (
	Parameters     RuntimeVersionOrigin = "parameters"
	Defaults       RuntimeVersionOrigin = "defaults"
	AccountMapping RuntimeVersionOrigin = "account-mapping"
)

type SMClientFactory

type SMClientFactory interface {
	ForCredentials(credentials *servicemanager.Credentials) servicemanager.Client
	ForCustomerCredentials(reqCredentials *servicemanager.Credentials, log logrus.FieldLogger) (servicemanager.Client, error)
	ProvideCredentials(reqCredentials *servicemanager.Credentials, log logrus.FieldLogger) (*servicemanager.Credentials, error)
}

type ServiceManagerBasicAuth

type ServiceManagerBasicAuth struct {
	Username string `json:"username"`
	Password string `json:"password"`
}

type ServiceManagerCredentials

type ServiceManagerCredentials struct {
	BasicAuth ServiceManagerBasicAuth `json:"basic"`
}

type ServiceManagerEntryDTO

type ServiceManagerEntryDTO struct {
	Credentials ServiceManagerCredentials `json:"credentials"`
	URL         string                    `json:"url"`
}

type ServiceManagerInstanceInfo

type ServiceManagerInstanceInfo struct {
	BrokerID                string `json:"brokerId"`
	ServiceID               string `json:"serviceId"`
	PlanID                  string `json:"planId"` // it is a plan.CatalogID from the Service Manager perspective
	InstanceID              string `json:"instanceId"`
	Provisioned             bool   `json:"provisioned"`
	ProvisioningTriggered   bool   `json:"provisioningTriggered"`
	DeprovisioningTriggered bool   `json:"deprovisioningTriggered"`
}

func (*ServiceManagerInstanceInfo) InstanceKey

func (*ServiceManagerInstanceInfo) ToProvisioningInput

type UpgradeClusterOperation

type UpgradeClusterOperation struct {
	Operation

	orchestration.RuntimeOperation `json:"runtime_operation"`
	InputCreator                   ProvisionerInputCreator `json:"-"`
}

UpgradeClusterOperation holds all information about upgrade cluster (shoot) operation

type UpgradeKymaOperation

type UpgradeKymaOperation struct {
	Operation

	orchestration.RuntimeOperation `json:"runtime_operation"`
	InputCreator                   ProvisionerInputCreator `json:"-"`

	RuntimeVersion RuntimeVersionData `json:"runtime_version"`

	SMClientFactory SMClientFactory `json:"-"`
}

UpgradeKymaOperation holds all information about upgrade Kyma operation

func (*UpgradeKymaOperation) ServiceManagerClient

func (uko *UpgradeKymaOperation) ServiceManagerClient(log logrus.FieldLogger) (servicemanager.Client, error)

type XSUAAData

type XSUAAData struct {
	Instance ServiceManagerInstanceInfo `json:"instance"`

	XSAppname string `json:"xsappname"`
	BindingID string `json:"bindingId"`
}

Directories

Path Synopsis
Package appinfo is responsible for defining REST endpoints which are serving overall information about created and managed resources e.g.
Package appinfo is responsible for defining REST endpoints which are serving overall information about created and managed resources e.g.
cis
e2e
This package provides a syntactic sugar and helper functions to make http things easier to read or to express
This package provides a syntactic sugar and helper functions to make http things easier to read or to express
ias
Package copied from https://github.com/kyma-project/kyma/blob/1.11.0/components/service-binding-usage-controller/internal/platform/logger/spy/logger.go Only Reset() method was added.
Package copied from https://github.com/kyma-project/kyma/blob/1.11.0/components/service-binding-usage-controller/internal/platform/logger/spy/logger.go Only Reset() method was added.
This package is NOT FOR PRODUCTION USE CASE.
This package is NOT FOR PRODUCTION USE CASE.
third_party
machinebox/graphql
Package graphql provides a low level GraphQL client.
Package graphql provides a low level GraphQL client.

Jump to

Keyboard shortcuts

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