patchgen

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2025 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const IntentSchema = `` /* 1227-byte string literal not displayed */

Variables

This section is empty.

Functions

This section is empty.

Types

type Intent

type Intent struct {
	IntentType string `json:"intent_type"`

	Target string `json:"target"`

	Namespace string `json:"namespace"`

	Replicas int `json:"replicas"`

	Reason string `json:"reason,omitempty"`

	Source string `json:"source,omitempty"`

	CorrelationID string `json:"correlation_id,omitempty"`
}

func LoadIntent

func LoadIntent(path string) (*Intent, error)

type KptInfo

type KptInfo struct {
	Description string `yaml:"description"`
}

type KptMetadata

type KptMetadata struct {
	Name string `yaml:"name"`
}

type KptMutator

type KptMutator struct {
	Image string `yaml:"image"`

	ConfigMap map[string]string `yaml:"configMap"`
}

type KptPipeline

type KptPipeline struct {
	Mutators []KptMutator `yaml:"mutators"`
}

type Kptfile

type Kptfile struct {
	APIVersion string `yaml:"apiVersion"`

	Kind string `yaml:"kind"`

	Metadata KptMetadata `yaml:"metadata"`

	Info KptInfo `yaml:"info"`

	Pipeline KptPipeline `yaml:"pipeline"`
}

type PatchFile

type PatchFile struct {
	APIVersion string `yaml:"apiVersion"`

	Kind string `yaml:"kind"`

	Metadata PatchMetadata `yaml:"metadata"`

	Spec PatchSpec `yaml:"spec"`
}

type PatchMetadata

type PatchMetadata struct {
	Name string `yaml:"name"`

	Namespace string `yaml:"namespace"`

	Annotations map[string]string `yaml:"annotations"`
}

type PatchPackage

type PatchPackage struct {
	Kptfile *Kptfile `yaml:"-"`

	PatchFile *PatchFile `yaml:"-"`

	OutputDir string `yaml:"-"`

	Intent *Intent `yaml:"-"`
}

func NewPatchPackage

func NewPatchPackage(intent *Intent, outputDir string) *PatchPackage

func (*PatchPackage) Generate

func (p *PatchPackage) Generate() error

func (*PatchPackage) GetPackagePath

func (p *PatchPackage) GetPackagePath() string

type PatchSpec

type PatchSpec struct {
	Replicas int `yaml:"replicas"`
}

type Validator

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

func NewValidator

func NewValidator(logger logr.Logger) (*Validator, error)

func (*Validator) ValidateIntent

func (v *Validator) ValidateIntent(intentData []byte) (*Intent, error)

func (*Validator) ValidateIntentFile

func (v *Validator) ValidateIntentFile(filePath string) (*Intent, error)

func (*Validator) ValidateIntentMap

func (v *Validator) ValidateIntentMap(intent map[string]interface{}) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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