manifest

package
v0.0.0-...-52527b8 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: Apache-2.0 Imports: 16 Imported by: 1

Documentation

Index

Constants

View Source
const (
	CapabilityAnnotation  = "capability.openshift.io/name"
	DefaultClusterProfile = "self-managed-high-availability"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Manifest

type Manifest struct {
	// OriginalFilename is set to the filename this manifest was loaded from.
	// It is not guaranteed to be set or be unique, but will be set when
	// loading from disk to provide a better debug capability.
	OriginalFilename string

	Raw []byte
	GVK schema.GroupVersionKind

	Obj *unstructured.Unstructured
	// contains filtered or unexported fields
}

Manifest stores Kubernetes object in Raw from a file. It stores the id and the GroupVersionKind for the manifest. Raw and Obj should always be kept in sync such that each provides the same data but in different formats. To ensure Raw and Obj are always in sync, they should not be set directly but rather only be set by calling either method ManifestsFromFiles or ParseManifests.

func ManifestsFromFiles

func ManifestsFromFiles(files []string) ([]Manifest, error)

ManifestsFromFiles reads files and returns Manifests in the same order. 'files' should be list of absolute paths for the manifests on disk. An error is returned for each manifest that defines a duplicate resource as compared to other manifests defined within the 'files' list. Duplicate resources have the same group, kind, name, and namespace.

func ParseManifests

func ParseManifests(r io.Reader) ([]Manifest, error)

ParseManifests parses a YAML or JSON document that may contain one or more kubernetes resources. An error is returned if the input cannot be parsed or contains a duplicate resource.

func (*Manifest) GetManifestCapabilities

func (m *Manifest) GetManifestCapabilities() []configv1.ClusterVersionCapability

GetManifestCapabilities returns the manifest's capabilities.

func (*Manifest) Include

func (m *Manifest) Include(excludeIdentifier *string, requiredFeatureSet *string, profile *string, capabilities *configv1.ClusterVersionCapabilitiesStatus, overrides []configv1.ComponentOverride) error

Include returns an error if the manifest fails an inclusion filter and should be excluded from further processing by cluster version operator. Pointer arguments can be set nil to avoid excluding based on that filter. For example, setting profile non-nil and capabilities nil will return an error if the manifest's profile does not match, but will never return an error about capability issues.

func (*Manifest) IncludeAllowUnknownCapabilities

func (m *Manifest) IncludeAllowUnknownCapabilities(excludeIdentifier *string, requiredFeatureSet *string, profile *string,
	capabilities *configv1.ClusterVersionCapabilitiesStatus, overrides []configv1.ComponentOverride, allowUnknownCapabilities bool) error

IncludeAllowUnknownCapabilities returns an error if the manifest fails an inclusion filter and should be excluded from further processing by cluster version operator. Pointer arguments can be set nil to avoid excluding based on that filter. For example, setting profile non-nil and capabilities nil will return an error if the manifest's profile does not match, but will never return an error about capability issues. allowUnknownCapabilities only applies to capabilities filtering. When set to true a manifest will not be excluded simply because it contains an unknown capability. This is necessary to allow updates to an OCP version containing newly defined capabilities.

func (Manifest) SameResourceID

func (m Manifest) SameResourceID(manifest Manifest) bool

func (*Manifest) String

func (m *Manifest) String() string

func (*Manifest) UnmarshalJSON

func (m *Manifest) UnmarshalJSON(in []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for the Manifest type. It unmarshals bytes of a single kubernetes object to Manifest.

Jump to

Keyboard shortcuts

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