providerimages

package
v0.0.0-...-db34340 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2026 License: Apache-2.0 Imports: 32 Imported by: 1

Documentation

Overview

Copyright 2026 Red Hat, Inc.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2024 Red Hat, Inc.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2024 Red Hat, Inc.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2026 Red Hat, Inc.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

View Source
const (

	// AttributeKeyType is the key for the provider type attribute.
	AttributeKeyType = "type"
	// AttributeKeyVersion is the key for the provider version attribute.
	AttributeKeyVersion = "version"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ProviderImageManifests

type ProviderImageManifests struct {
	ProviderMetadata

	ImageRef string
	Profile  string

	ContentID     string
	ManifestsPath string
}

ProviderImageManifests represents metadata and manifests read from a provider image.

func ReadProviderImages

func ReadProviderImages(ctx context.Context, k8sClient client.Reader, log logr.Logger, containerImages []string, providerImageDir string) ([]ProviderImageManifests, error)

ReadProviderImages returns a list of ProviderImageManifests read directly from operand container images.

containerImages is a map of provider names to provider image references

A provider image may contain a /capi-operator-manifests directory containing the following 2 files: - metadata.yaml: a YAML file whose contents are a ProviderMetadata struct - manifests.yaml: a KRM containing the provider manifests

If a provider image does not contain a /capi-operator-manifests directory, it is ignored. If a provider image contains /capi-operator-manifests but one of the required files is missing, an error is returned.

ReadProviderImages fetches each provider image. If it contains valid CAPI Operator manifests, the contents are stored in a local cache directory specified by providerImageDir. Manifests are written to a subdirectory named after the image reference.

When writing manifests to the cache, any occurrences of `manifestImageName` as specified in the provider's metadata.yaml are replaced with the image reference.

The pull secret is fetched from the "pull-secret" Secret in the "openshift-config" namespace using the provided client.Reader.

type ProviderMetadata

type ProviderMetadata struct {
	Name         string                `json:"name"`
	Attributes   map[string]string     `json:"attributes,omitempty"`
	OCPPlatform  configv1.PlatformType `json:"ocpPlatform,omitempty"`
	SelfImageRef string                `json:"selfImageRef,omitempty"`
	InstallOrder int                   `json:"installOrder,omitempty"`
}

ProviderMetadata is metadata about a provider image provided in the metadata.yaml file.

func (ProviderMetadata) MatchesPlatform

func (m ProviderMetadata) MatchesPlatform(clusterPlatform configv1.PlatformType) bool

MatchesPlatform reports whether this profile should be installed on the given cluster platform. Profiles with no OCPPlatform set (empty string) are platform-independent and match every cluster.

Jump to

Keyboard shortcuts

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