adding installation registry to version catalogue

* modified image_repositories section schema in version catalogue.
  new type : type map[string]ImageRepositorySpec
  old type : string.
* replaced registry attribute in Installation resource from
  version-catalogue image_repositories section.
* updated old attributes from  image_repositories section as per new
  schema.

Closes: #590
Change-Id: I2159e23b8a63b5f48d2f4e79b56c2bc021646c77
This commit is contained in:
shon phand 2021-06-30 18:10:23 +00:00
parent 7d91e48781
commit e9f35dabe8
6 changed files with 48 additions and 6 deletions

View File

@ -162,4 +162,10 @@ spec:
kubernetes: v1.18.6
image_repositories: k8s.gcr.io
image_repositories:
cni:
name: tigera-operator
repository: quay.io
controlplane:
name: kubeadm-clusterConfiguration
repository: k8s.gcr.io

View File

@ -196,8 +196,34 @@ spec:
are grouped by airshipctl function -> images in function.
type: object
image_repositories:
additionalProperties:
description: ImageRepositorySpec defines the spec for a repository
that includes repository URL, Name and one of Hash/Tag/SHA/Digest.
properties:
digest:
type: string
hash:
type: string
name:
description: Name is an optional property that is used to specify
the name of an image. Typically, this format is only needed
for charts such as dex-aio, which uses "repo", "name", and
"tag" properties to declare images, rather than the more commonly
used "repository" and "tag". In such cases, "repository" should
contain only the name of the repository (e.g. "quay.io") and
the "name" property should contain the image name (e.g. "metal3-io/ironic").
type: string
repository:
type: string
sha:
type: string
tag:
type: string
required:
- repository
type: object
description: Allows for the specification of the image repositories
type: string
type: object
images:
additionalProperties:
additionalProperties:

View File

@ -17,3 +17,13 @@ replacements:
kind: Deployment
name: tigera-operator
fieldrefs: ["{.spec.template.spec.containers[?(.name == 'tigera-operator')].image}"]
- source:
objref:
kind: VersionsCatalogue
name: versions-airshipctl
fieldref: "{.spec.image_repositories.cni.repository}"
target:
objref:
kind: Installation
name: default
fieldrefs: ["{.spec.registry}"]

View File

@ -13,7 +13,7 @@ replacements:
objref:
kind: VersionsCatalogue
name: versions-airshipctl
fieldref: "{.spec.image_repositories}"
fieldref: "{.spec.image_repositories.controlplane.repository}"
target:
objref:
name: ephemeral-bmc-secret

View File

@ -35,7 +35,7 @@ replacements:
objref:
kind: VersionsCatalogue
name: versions-airshipctl
fieldref: "{.spec.image_repositories}"
fieldref: "{.spec.image_repositories.controlplane.repository}"
target:
objref:
kind: KubeadmControlPlane

View File

@ -165,7 +165,7 @@ type VersionsCatalogueSpec struct {
Kubernetes string `json:"kubernetes,omitempty"`
// Allows for the specification of the image repositories
ImageRepositories string `json:"image_repositories,omitempty"`
ImageRepositories map[string]ImageRepositorySpec `json:"image_repositories,omitempty"`
}
// +kubebuilder:object:root=true