merger

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2026 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Overview

pkg/merger/file.go

pkg/merger/file_auth.go

pkg/merger/helm.go

pkg/merger/helper.go

pkg/merger/merger.go

pkg/merger/parse.go

pkg/merger/registry.go

pkg/merger/registry_v2.go

Index

Constants

This section is empty.

Variables

View Source
var ParseKatalogDoc = parseKatalogDoc

Export

Functions

func ExportedGitHubRawURL

func ExportedGitHubRawURL(repoURL, ref, filePath string) string

Exported for tests

func ExportedGitLabRawURL

func ExportedGitLabRawURL(repoURL, ref, filePath string) string

Exported for tests

func ExportedIsGitHubURL

func ExportedIsGitHubURL(u string) bool

ExportedIsGitHubURL

func ExportedIsGitLabURL

func ExportedIsGitLabURL(u string) bool

ExportedIsGitLab

func ExportedLoadRegistrySource

func ExportedLoadRegistrySource(m *Merger, src orktypes.RegistrySource) (map[string]orktypes.CRDEntry, error)

ExportedLoadRegistrySource loads from the deprecated catalog-map registry protocol (sources.registry with katalog: map[string]RegistryRef). Tests that verify catalog-map-based registry loading use this export.

func ExportedValidatePatternStructure

func ExportedValidatePatternStructure(dir, url, version string) error

ExportedValidatePatternStructure

Types

type Merger

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

Merger loads one or more Katalog files, resolves their sources (files, URLs, Helm charts), merges all CRD entries, and exposes the result through Enabled(), All(), and Get().

Entry point: one or more file paths from the CLI or konstructOrkestra. Everything else — source resolution, Helm rendering, deduplication — is internal to the merger.

Merge rules:

  • Sources within a Katalog are loaded before spec.crds
  • Inline spec.crds win on name conflict (local overrides remote)
  • Duplicate names across independent Katalog files are errors
  • disabled CRDs are preserved and filtered by Enabled()

func New

func New(paths ...string) *Merger

New creates a Merger with the given entry point file paths or URLs. Accepts one or more paths — the same as passing --katalog multiple times or comma separated.

func (*Merger) APIMetadata

func (m *Merger) APIMetadata() apiMetadata

APIMetadata returns the merged result as a KatalogMeta with apiversion and kind.

func (*Merger) Add

func (m *Merger) Add(paths ...string) *Merger

Add appends additional entry point paths after construction. Returns the Merger for chaining.

func (*Merger) All

func (m *Merger) All() map[string]orktypes.CRDEntry

All returns all CRD entries including disabled ones.

func (*Merger) Count

func (m *Merger) Count() int

Count returns total CRD count across all sources.

func (*Merger) Enabled

func (m *Merger) Enabled() map[string]orktypes.CRDEntry

Enabled returns only CRD entries where enabled: true.

func (*Merger) EnabledCount

func (m *Merger) EnabledCount() int

EnabledCount returns the number of enabled CRDs.

func (*Merger) Get

func (m *Merger) Get(name string) (orktypes.CRDEntry, bool)

Get returns a CRD entry by name. Returns (entry, true) if found.

func (*Merger) GetRegistryURL

func (m *Merger) GetRegistryURL() string

func (*Merger) Merge

func (m *Merger) Merge() error

Merge loads all entry points and their declared sources, resolves Helm charts, and produces a single deduplicated CRD map. Safe to call multiple times — re-merges on each call.

func (*Merger) SetRegistryURL

func (m *Merger) SetRegistryURL(url string)

func (*Merger) ToProviders

func (m *Merger) ToProviders() []orktypes.KatalogProviderRequirement

ToProviders returns the top-level provider requirements of the merged result. Used by KomposeKatalogFromYaml to populate Katalog.Providers.

func (*Merger) ToSecurity

func (m *Merger) ToSecurity() orktypes.KatalogSecurity

ToSecurity returns the security config of the merged result as a KatalogSecurity Used by NewKatalog consume the merged result.

func (*Merger) ToSpec

func (m *Merger) ToSpec() orktypes.KatalogSpec

ToSpec returns the merged result as a KatalogSpec. Used by NewKatalog and generate.Registry to consume the merged result.

func (*Merger) ToUI

func (m *Merger) ToUI() *orktypes.KatalogForUI

ToUI returns a UI-friendly representation of the merged Katalog. This method extracts only the fields needed for display in the Control Center:

  • API version and kind (always "Katalog" at runtime)
  • Metadata (name, description, version, author, license)
  • All merged CRD definitions

Internal fields (Scheme, GroupVersionKind, etc.) are excluded because they have `yaml:"-" json:"-"` tags and won't be serialized to JSON.

This method is used by the /katalog/raw endpoint to provide a clean, readable view of the Katalog that created the current operator.

Jump to

Keyboard shortcuts

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