api

package
v0.8.8 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	SchemeGroupVersion = schema.GroupVersion{
		Group:   "repo.github.upbound.io",
		Version: "v1alpha1",
	}
	AddToScheme = schemeBuilder.AddToScheme
)

SchemeGroupVersion mirrors the upjet-github provider CRD API group installed in the cluster. upbound/provider-github does not ship importable Go types — these structs own the schema locally.

Functions

This section is empty.

Types

type GitHubProvider

type GitHubProvider struct {
	Client   ctrlclient.Client
	Scheme   *runtime.Scheme
	Log      logr.Logger
	Recorder events.EventRecorder
}

GitHubProvider implements Provider against the upjet-github Crossplane provider, ensuring the Repository and RepositoryWebhook resources that back a GitRepository CR.

func NewGitHubProvider

func NewGitHubProvider(
	c ctrlclient.Client,
	scheme *runtime.Scheme,
	log logr.Logger,
	rec events.EventRecorder,
) *GitHubProvider

NewGitHubProvider constructs a GitHubProvider.

func (*GitHubProvider) Ensure

Ensure reconciles the upjet-github Repository (and, if webhooks are declared, RepositoryWebhook) resources backing cr against spec.

func (*GitHubProvider) Teardown

Teardown deletes the Crossplane Repository and RepositoryWebhook this provider created. Mandatory, not optional — Ensure links these objects to the GitRepository CR by label only (sources.blanketops.dev/gitrepository), never by ownerReference, and both are cluster-scoped. Kubernetes GC has no mechanism to reclaim them; without this, deleting the GitRepository CR leaves Crossplane managing a live GitHub repository and webhook forever.

Idempotent — a missing Repository or RepositoryWebhook is not an error.

type Provider

type Provider interface {
	Ensure(ctx context.Context, cr *sourcesv1alpha1.GitRepository, spec domain.GitRepository) (domain.Result, error)
}

Provider is the orchestration interface for GitRepository backend providers. Each implementation is responsible for ensuring the provider-specific resources that back a GitRepository CR.

Current implementations:

  • GitHubProvider (github.go) — upjet-github Crossplane provider

The BackendSelector resolves the correct Provider from spec.contract.provider.

type ProviderConfigRef

type ProviderConfigRef struct {
	Name string `json:"name"`
}

ProviderConfigRef identifies the Crossplane ProviderConfig to use.

type Repository

type Repository struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`
	Spec              RepositorySpec `json:"spec"`
}

Repository mirrors the upjet-github provider's Repository CRD. upbound/provider-github does not ship importable Go types, so this struct owns the schema locally.

func (*Repository) DeepCopyObject

func (r *Repository) DeepCopyObject() runtime.Object

type RepositoryParameters

type RepositoryParameters struct {
	Name       *string `json:"name"`
	Visibility *string `json:"visibility"`
}

RepositoryParameters are the upjet-github Terraform parameters for a Repository.

type RepositorySpec

type RepositorySpec struct {
	ProviderConfigRef ProviderConfigRef    `json:"providerConfigRef"`
	ForProvider       RepositoryParameters `json:"forProvider"`
}

RepositorySpec is the spec of a Repository resource.

type RepositoryWebhook

type RepositoryWebhook struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`
	Spec              RepositoryWebhookSpec `json:"spec"`
}

RepositoryWebhook mirrors the upjet-github provider's RepositoryWebhook CRD. See Repository for why this is defined locally.

func (*RepositoryWebhook) DeepCopyObject

func (r *RepositoryWebhook) DeepCopyObject() runtime.Object

type RepositoryWebhookConfigurationParameters

type RepositoryWebhookConfigurationParameters struct {
	URLSecretRef SecretKeyRef `json:"urlSecretRef"`
}

RepositoryWebhookConfigurationParameters mirrors the Terraform configuration block. URLSecretRef sources the hook URL from a Secret — Crossplane's native pattern for sensitive fields.

type RepositoryWebhookParameters

type RepositoryWebhookParameters struct {
	Active        *bool                                      `json:"active"`
	Events        []*string                                  `json:"events"`
	Repository    *string                                    `json:"repository"`
	Configuration []RepositoryWebhookConfigurationParameters `json:"configuration"`
}

RepositoryWebhookParameters are the upjet-github Terraform parameters for a RepositoryWebhook.

type RepositoryWebhookSpec

type RepositoryWebhookSpec struct {
	ProviderConfigRef ProviderConfigRef           `json:"providerConfigRef"`
	ForProvider       RepositoryWebhookParameters `json:"forProvider"`
}

RepositoryWebhookSpec is the spec of a RepositoryWebhook resource.

type SecretKeyRef

type SecretKeyRef struct {
	Name      string `json:"name"`
	Namespace string `json:"namespace"`
	Key       string `json:"key"`
}

SecretKeyRef is a reference to a key within a Kubernetes Secret.

Jump to

Keyboard shortcuts

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