resources

package
v1.19.0 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2020 License: Apache-2.0 Imports: 42 Imported by: 23

Documentation

Index

Constants

View Source
const (
	DefaultOriginPullSecretName      = "samples-registry-credentials"
	DefaultOriginPullSecretNamespace = "openshift"
)

Variables

View Source
var (
	BackupServiceAccountName = "rhmi-backupjob"
	BackupRoleName           = "rhmi-backupjob"
	BackupRoleBindingName    = "rhmi-backupjob"
)
View Source
var (
	OwnerLabelKey = integreatlyv1alpha1.SchemeGroupVersion.Group + "/installation-uid"
)
View Source
var (
	Scheme = scheme.Scheme
)

Functions

func AddFinalizer

func AddFinalizer(ctx context.Context, inst *integreatlyv1alpha1.RHMI, client k8sclient.Client, finalizer string) error

AddFinalizer adds a finalizer to the custom resource. This allows us to clean up oauth clients and other cluster level objects owned by the installation before the cr is deleted

func CopyDefaultPullSecretToNameSpace

func CopyDefaultPullSecretToNameSpace(context context.Context, destNamespace, destName string, inst *integreatlyv1alpha1.RHMI, client k8sclient.Client) error

CopyDefaultPullSecretToNamespace copies the default pull secret to a target namespace

func CopySecret

func CopySecret(ctx context.Context, client k8sclient.Client, srcName, srcNamespace, destName, destNamespace string) error

CopySecret will copy or update the destination secret from the source secret

func CreateNSWithProjectRequest

func CreateNSWithProjectRequest(ctx context.Context, namespace string, client k8sclient.Client, inst *integreatlyv1alpha1.RHMI) (*v1.Namespace, error)

func CreateOrUpdate

func CreateOrUpdate(ctx context.Context, serverClient k8sclient.Client, obj runtime.Object) error

func CreatePostgresAvailabilityAlert

func CreatePostgresAvailabilityAlert(ctx context.Context, client k8sclient.Client, inst *v1alpha1.RHMI, cr *crov1.Postgres) (*prometheusv1.PrometheusRule, error)

CreatePostgresAvailabilityAlert creates a PrometheusRule alert to watch for the availability of a Postgres instance

func CreateRedisAvailabilityAlert

func CreateRedisAvailabilityAlert(ctx context.Context, client k8sclient.Client, inst *v1alpha1.RHMI, cr *crov1.Redis) (*prometheusv1.PrometheusRule, error)

CreateRedisAvailabilityAlert creates a PrometheusRule alert to watch for the availability of a Redis cacheu

func Exists

func Exists(ctx context.Context, serverClient k8sclient.Client, obj runtime.Object) (bool, error)

func GetNS

func GetNS(ctx context.Context, namespace string, client k8sclient.Client) (*corev1.Namespace, error)

GetNS gets the specified corev1.Namespace from the k8s API server

func IsOwnedBy

func IsOwnedBy(o metav1.Object, owner *integreatlyv1alpha1.RHMI) bool

func LoadKubernetesResource

func LoadKubernetesResource(jsonData []byte, namespace string) (runtime.Object, error)

func PrepareObject

func PrepareObject(ns metav1.Object, install *integreatlyv1alpha1.RHMI)

func ReconcileBackup

func ReconcileBackup(ctx context.Context, serverClient k8sclient.Client, config BackupConfig, configManager productsConfig.ConfigReadWriter) error

func ReconcileRHSSOPostgresCredentials

func ReconcileRHSSOPostgresCredentials(ctx context.Context, installation *integreatlyv1alpha1.RHMI, serverClient k8sclient.Client, name, ns string) (*corev1.Secret, error)

ReconcileRHSSOPostgresCredentials Provisions postgres and creates external database secret based on Installation CR, secret will be nil while the postgres instance is provisioning

func RemoveFinalizer

func RemoveFinalizer(ctx context.Context, inst *integreatlyv1alpha1.RHMI, client k8sclient.Client, finalizer string) error

RemoveFinalizer removes a given finalizer from the installation custom resource

func RemoveNamespace

func RemoveNamespace(ctx context.Context, inst *integreatlyv1alpha1.RHMI, client k8sclient.Client, namespace string) (integreatlyv1alpha1.StatusPhase, error)

RemoveNamespace deletes a namespace of a product

func RemoveOauthClient

func RemoveOauthClient(oauthClient oauthClient.OauthV1Interface, oauthClientName string) error

RemoveOauthClient deletes an oauth client by name

func RemoveProductFinalizer

func RemoveProductFinalizer(ctx context.Context, inst *integreatlyv1alpha1.RHMI, client k8sclient.Client, product string) error

RemoveProductFinalizer removes a given finalizer from the installation custom resource

func RuntimeObjectFromUnstructured

func RuntimeObjectFromUnstructured(u *unstructured.Unstructured) (runtime.Object, error)

func UnstructuredFromRuntimeObject

func UnstructuredFromRuntimeObject(ro runtime.Object) (*unstructured.Unstructured, error)

Types

type BackupComponent

type BackupComponent struct {
	Name     string
	Type     string
	Secret   BackupSecretLocation
	Schedule string
}

type BackupConfig

type BackupConfig struct {
	Name             string
	Namespace        string
	Components       []BackupComponent
	BackendSecret    BackupSecretLocation
	EncryptionSecret BackupSecretLocation
}

type BackupSecretLocation

type BackupSecretLocation struct {
	Name      string
	Namespace string
}

type OauthResolver

type OauthResolver struct {
	Host string
	// contains filtered or unexported fields
}

func NewOauthResolver

func NewOauthResolver(client *http.Client) *OauthResolver

func (*OauthResolver) GetOauthEndPoint

func (or *OauthResolver) GetOauthEndPoint() (*OauthServerConfig, error)

type OauthServerConfig

type OauthServerConfig struct {
	Issuer                        string   `json:"issuer"`
	AuthorizationEndpoint         string   `json:"authorization_endpoint"`
	TokenEndpoint                 string   `json:"token_endpoint"`
	ScopesSupported               []string `json:"scopes_supported"`
	ResponseTypesSupported        []string `json:"response_types_supported"`
	GrantTypesSupported           []string `json:"grant_types_supported"`
	CodeChallengeMethodsSupported []string `json:"code_challenge_methods_supported"`
}

type Reconciler

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

func (*Reconciler) ReconcileFinalizer

func (r *Reconciler) ReconcileFinalizer(ctx context.Context, client k8sclient.Client, inst *integreatlyv1alpha1.RHMI, productName string, finalFunc finalizerFunc) (integreatlyv1alpha1.StatusPhase, error)

func (*Reconciler) ReconcileNamespace

func (r *Reconciler) ReconcileNamespace(ctx context.Context, namespace string, inst *integreatlyv1alpha1.RHMI, client k8sclient.Client) (integreatlyv1alpha1.StatusPhase, error)

func (*Reconciler) ReconcileOauthClient

func (r *Reconciler) ReconcileOauthClient(ctx context.Context, inst *integreatlyv1alpha1.RHMI, client *oauthv1.OAuthClient, apiClient k8sclient.Client) (integreatlyv1alpha1.StatusPhase, error)

func (*Reconciler) ReconcilePullSecret

func (r *Reconciler) ReconcilePullSecret(ctx context.Context, namespace, secretName string, inst *integreatlyv1alpha1.RHMI, client k8sclient.Client) (integreatlyv1alpha1.StatusPhase, error)

func (*Reconciler) ReconcileSubscription

func (r *Reconciler) ReconcileSubscription(ctx context.Context, owner ownerutil.Owner, target marketplace.Target, operandNS []string, client k8sclient.Client) (integreatlyv1alpha1.StatusPhase, error)

type Version

type Version struct {
	Major int
	Minor int
	Patch int
}

func NewVersion

func NewVersion(version integreatlyv1alpha1.OperatorVersion) (*Version, error)

func (*Version) AsString

func (v *Version) AsString() string

func (*Version) Equals

func (v *Version) Equals(other *Version) bool

func (*Version) IsNewerThan

func (v *Version) IsNewerThan(other *Version) bool

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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