v1alpha1

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package v1alpha1 contains API Schema definitions for the redhatcop v1alpha1 API group +kubebuilder:object:generate=true +groupName=redhatcop.redhat.io

Index

Constants

This section is empty.

Variables

View Source
var (
	// GroupVersion is group version used to register these objects
	GroupVersion = schema.GroupVersion{Group: "redhatcop.redhat.io", Version: "v1alpha1"}

	// SchemeBuilder is used to add go types to the GroupVersionKind scheme
	SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion}

	// AddToScheme adds the types in this group-version to the given scheme.
	AddToScheme = SchemeBuilder.AddToScheme
)

Functions

This section is empty.

Types

type GitHubServerConfig

type GitHubServerConfig struct {
	// GitAPIServerURL the url of the git server api
	// +kubebuilder:validation:Pattern=`^https?:\/\/(?:www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b(?:[-a-zA-Z0-9()@:%_\+.~#?&\/=]*)$`
	// +kubebuilder:default="https://api.github.com/"
	GitHubAPIServerURL string `json:"gitHubAPIServerURL,omitempty"`
	// GitServerCredentials credentials to use when authenticating to the git server, must contain a "token" key
	GitServerCredentials corev1.LocalObjectReference `json:"gitServerCredentials,omitempty"`
}

func (*GitHubServerConfig) DeepCopy

func (in *GitHubServerConfig) DeepCopy() *GitHubServerConfig

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GitHubServerConfig.

func (*GitHubServerConfig) DeepCopyInto

func (in *GitHubServerConfig) DeepCopyInto(out *GitHubServerConfig)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type GitLabServerConfig

type GitLabServerConfig struct {
	// GitAPIServerURL the url of the git server api
	// +kubebuilder:validation:Pattern=`^https?:\/\/(?:www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b(?:[-a-zA-Z0-9()@:%_\+.~#?&\/=]*)$`
	// +kubebuilder:default="https://gitlab.com/"
	GitLabAPIServerURL string `json:"gitLabAPIServerURL,omitempty"`
	// GitServerCredentials credentials to use when authenticating to the git server, must contain a "token" key
	GitServerCredentials corev1.LocalObjectReference `json:"gitServerCredentials,omitempty"`
}

func (*GitLabServerConfig) DeepCopy

func (in *GitLabServerConfig) DeepCopy() *GitLabServerConfig

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GitLabServerConfig.

func (*GitLabServerConfig) DeepCopyInto

func (in *GitLabServerConfig) DeepCopyInto(out *GitLabServerConfig)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type GitWebhook

type GitWebhook struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`

	Spec   GitWebhookSpec   `json:"spec,omitempty"`
	Status GitWebhookStatus `json:"status,omitempty"`
}

GitWebhook is the Schema for the gitwebhooks API

func (*GitWebhook) DeepCopy

func (in *GitWebhook) DeepCopy() *GitWebhook

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GitWebhook.

func (*GitWebhook) DeepCopyInto

func (in *GitWebhook) DeepCopyInto(out *GitWebhook)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*GitWebhook) DeepCopyObject

func (in *GitWebhook) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

func (*GitWebhook) Default

func (r *GitWebhook) Default()

Default implements webhook.Defaulter so a webhook will be registered for the type

func (*GitWebhook) GetGitCredential

func (m *GitWebhook) GetGitCredential(ctx context.Context, gitServerConfig interface{}) (string, error)

func (*GitWebhook) GetWebhookSecret

func (m *GitWebhook) GetWebhookSecret(ctx context.Context) (string, error)

func (*GitWebhook) SetupWebhookWithManager

func (r *GitWebhook) SetupWebhookWithManager(mgr ctrl.Manager) error

func (*GitWebhook) ValidateCreate

func (r *GitWebhook) ValidateCreate() error

ValidateCreate implements webhook.Validator so a webhook will be registered for the type

func (*GitWebhook) ValidateDelete

func (r *GitWebhook) ValidateDelete() error

ValidateDelete implements webhook.Validator so a webhook will be registered for the type

func (*GitWebhook) ValidateUpdate

func (r *GitWebhook) ValidateUpdate(old runtime.Object) error

ValidateUpdate implements webhook.Validator so a webhook will be registered for the type

type GitWebhookList

type GitWebhookList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []GitWebhook `json:"items"`
}

GitWebhookList contains a list of GitWebhook

func (*GitWebhookList) DeepCopy

func (in *GitWebhookList) DeepCopy() *GitWebhookList

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GitWebhookList.

func (*GitWebhookList) DeepCopyInto

func (in *GitWebhookList) DeepCopyInto(out *GitWebhookList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*GitWebhookList) DeepCopyObject

func (in *GitWebhookList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type GitWebhookSpec

type GitWebhookSpec struct {

	// GitLab the configuration to connect to the gitlab server. only one of gitlab or github is allowed
	GitLab *GitLabServerConfig `json:"gitLab,omitempty"`

	// GitHub the configuration to connect to the gitlab server
	GitHub *GitHubServerConfig `json:"gitHub,omitempty"`

	// RepositoryOwner The owner of the repository, can be either an organization or a user
	// +kubebuilder:validation:Required
	RepositoryOwner string `json:"repositoryOwner,omitempty"`

	// RepositoryName The name of the repository
	// +kubebuilder:validation:Required
	RepositoryName string `json:"repositoryName,omitempty"`

	// RepositoryName The name of the repository
	// +kubebuilder:validation:Required
	// +kubebuilder:validation:Enum="user";"organization"
	// +kubebuilder:default="organization"
	OwnerType string `json:"ownerType,omitempty"`

	// WebhookURL The URL of the webhook to be called
	// +kubebuilder:validation:Required
	// +kubebuilder:validation:Pattern=`^https?:\/\/(?:www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b(?:[-a-zA-Z0-9()@:%_\+.~#?&\/=]*)$`
	WebhookURL string `json:"webhookURL,omitempty"`

	// InsecureSSL whether to not verify the certificate of the server serving the webhook
	InsecureSSL bool `json:"insecureSSL,omitempty"`

	// WebhookSecret The secret to be used in the webhook callbacks. The key "secret" will be used to retrieve the secret/token
	WebhookSecret corev1.LocalObjectReference `json:"webhookSecret,omitempty"`

	// Events The list of events that this webbook should be notified for
	// +listType=set
	Events []string `json:"events,omitempty"`

	// ContentType the content type of the webhook playload (github only, will be ignored for gitlab)
	// +kubebuilder:default="json"
	ContentType string `json:"content,omitempty"`

	// Active whether this webhook should be actibe (github only, will be ignored for gitlab)
	// +kubebuilder:default=true
	Active bool `json:"active,omitempty"`

	// PushEventBranchFilter filter for push event on branches (gitlab only, will be ignored for github)
	PushEventBranchFilter string `json:"pushEventBranchFilter,omitempty"`
}

GitWebhookSpec defines the desired state of GitWebhook

func (*GitWebhookSpec) DeepCopy

func (in *GitWebhookSpec) DeepCopy() *GitWebhookSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GitWebhookSpec.

func (*GitWebhookSpec) DeepCopyInto

func (in *GitWebhookSpec) DeepCopyInto(out *GitWebhookSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type GitWebhookStatus

type GitWebhookStatus struct {
	// +patchMergeKey=type
	// +patchStrategy=merge
	// +listType=map
	// +listMapKey=type
	Conditions []metav1.Condition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type"`
}

GitWebhookStatus defines the observed state of GitWebhook

func (*GitWebhookStatus) DeepCopy

func (in *GitWebhookStatus) DeepCopy() *GitWebhookStatus

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GitWebhookStatus.

func (*GitWebhookStatus) DeepCopyInto

func (in *GitWebhookStatus) DeepCopyInto(out *GitWebhookStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type WebHook

type WebHook interface {
	Reconcile(ctx context.Context) error
	Delete(ctx context.Context) error
}

+kubebuilder:object:generate=false

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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