fix(ceph): use the configured runtime image (#4381)
Signed-off-by: Mohammed Naser <435815+mnaser@users.noreply.github.com> Co-authored-by: Mohammed Naser <435815+mnaser@users.noreply.github.com>
This commit is contained in:
1 parent
7746f25d8b
commit
9835bb30fd
5 files changed
+43
-1
No files matched your search
@@ -29,12 +29,14 @@
|
||||
- name: Set a fact with the "atmosphere_images" for other plays
|
||||
ansible.builtin.set_fact:
|
||||
atmosphere_images: "{{ atmosphere_images }}"
|
||||
ceph_version: "{{ ceph_version }}"
|
||||
tags:
|
||||
- always
|
||||
|
||||
- import_playbook: vexxhost.ceph.site
|
||||
vars:
|
||||
containerd_pause_image: "{{ atmosphere_images['pause'] }}"
|
||||
cephadm_image: "{{ atmosphere_images['ceph'] }}"
|
||||
|
||||
- hosts: "{{ target | default('all') }}"
|
||||
gather_facts: false
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
fixes:
|
||||
- |
|
||||
The Ceph deployment now passes the configured Ceph image to the upstream
|
||||
Ceph collection. This keeps the Ceph bootstrap and client commands on the
|
||||
same runtime image and avoids incompatible keyring formats.
|
||||
@@ -33,6 +33,20 @@ func getKubernetesVersion() (string, error) {
|
||||
return version, nil
|
||||
}
|
||||
|
||||
func getCephVersion() (string, error) {
|
||||
path, err := yaml.PathString("$.ceph_version")
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
var version string
|
||||
if err := path.Read(bytes.NewReader(varsFile), &version); err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
return version, nil
|
||||
}
|
||||
|
||||
func GetImages() (map[string]string, error) {
|
||||
// Replace {{ release }} with the actual release value
|
||||
modifiedVarsFile := []byte(strings.ReplaceAll(string(varsFile), "{{ atmosphere_release }}", release))
|
||||
@@ -47,6 +61,13 @@ func GetImages() (map[string]string, error) {
|
||||
}
|
||||
modifiedVarsFile = []byte(strings.ReplaceAll(string(modifiedVarsFile), "{{ atmosphere_kubernetes_version }}", kubernetesVersion))
|
||||
|
||||
// Resolve the Ceph version from the same vars file as the image template.
|
||||
cephVersion, err := getCephVersion()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
modifiedVarsFile = []byte(strings.ReplaceAll(string(modifiedVarsFile), "{{ ceph_version }}", cephVersion))
|
||||
|
||||
path, err := yaml.PathString("$._atmosphere_images")
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
# under the License.
|
||||
|
||||
atmosphere_release: main
|
||||
ceph_version: 18.2.7
|
||||
|
||||
_atmosphere_images:
|
||||
alertmanager: "{{ atmosphere_image_prefix }}quay.io/prometheus/alertmanager:v0.27.0"
|
||||
@@ -20,7 +21,7 @@ _atmosphere_images:
|
||||
barbican_db_sync: "{{ atmosphere_image_prefix }}ghcr.io/vexxhost/barbican:main@sha256:eab0ec0be8f8e5b3534131c494943ed5fc7379dc166db8b7b7c8ac802359330b"
|
||||
bootstrap: "{{ atmosphere_image_prefix }}ghcr.io/vexxhost/heat:main@sha256:3be2b3d1ab07714491f915307416d288783e484669a4b58a8fe3b7412b97044c"
|
||||
ceph_config_helper: "{{ atmosphere_image_prefix }}ghcr.io/vexxhost/libvirtd:main@sha256:3d8ac580f9a3235c9fdd27cda89717a651e34c9b029ae884d8b3fdbcc7bde2a8"
|
||||
ceph: "{{ atmosphere_image_prefix }}quay.io/ceph/ceph:v18.2.7"
|
||||
ceph: "{{ atmosphere_image_prefix }}quay.io/ceph/ceph:v{{ ceph_version }}"
|
||||
cert_manager_helm_chart: "{{ atmosphere_image_prefix }}ghcr.io/vexxhost/charts/cert-manager:v1.15.5"
|
||||
cert_manager_cainjector: "{{ atmosphere_image_prefix }}quay.io/jetstack/cert-manager-cainjector:v1.15.5"
|
||||
cert_manager_controller: "{{ atmosphere_image_prefix }}quay.io/jetstack/cert-manager-controller:v1.15.5"
|
||||
|
||||
@@ -33,6 +33,19 @@ func TestImageHasPrefix(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestGetImagesResolvesTemplates(t *testing.T) {
|
||||
images, err := GetImages()
|
||||
require.NoError(t, err)
|
||||
require.NotEmpty(t, images)
|
||||
|
||||
for name, image := range images {
|
||||
t.Run(name, func(t *testing.T) {
|
||||
assert.NotContains(t, image, "{{")
|
||||
assert.NotContains(t, image, "}}")
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
func TestImageExist(t *testing.T) {
|
||||
images, err := GetImages()
|
||||
require.NoError(t, err)
|
||||
|
||||
Reference in new issue
Block a user