Skip to content

Commit

Permalink
Remove use of images from quay.io
Browse files Browse the repository at this point in the history
Signed-off-by: David Cassany <[email protected]>
  • Loading branch information
davidcassany committed Oct 24, 2023
1 parent 1f53971 commit 782f57c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 70 deletions.
6 changes: 3 additions & 3 deletions controllers/seedimage_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ var _ = Describe("reconcile seed image", func() {
BeforeEach(func() {
r = &SeedImageReconciler{
Client: cl,
SeedImageImage: "quay.io/costoolkit/seedimage-builder:latest",
SeedImageImage: "registry.suse.com/rancher/seedimage-builder:latest",
SeedImageImagePullPolicy: corev1.PullIfNotPresent,
}

Expand Down Expand Up @@ -187,7 +187,7 @@ var _ = Describe("reconcileBuildImagePod", func() {
BeforeEach(func() {
r = &SeedImageReconciler{
Client: cl,
SeedImageImage: "quay.io/costoolkit/seedimage-builder:latest",
SeedImageImage: "registry.suse.com/rancher/seedimage-builder:latest",
SeedImageImagePullPolicy: corev1.PullIfNotPresent,
}

Expand Down Expand Up @@ -496,7 +496,7 @@ var _ = Describe("updateStatusFromPod", func() {
BeforeEach(func() {
r = &SeedImageReconciler{
Client: cl,
SeedImageImage: "quay.io/costoolkit/seedimage-builder:latest",
SeedImageImage: "registry.suse.com/rancher/seedimage-builder:latest",
}
seedImg = &elementalv1.SeedImage{
Status: elementalv1.SeedImageStatus{
Expand Down
74 changes: 7 additions & 67 deletions tests/e2e/upgrades_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import (
"github.com/rancher/elemental-operator/tests/catalog"
)

const discoveryPluginImage = `"quay.io/costoolkit/upgradechannel-discovery:v0.4.0"`
const channelImage = `"registry.suse.com/rancher/elemental-teal-channel:1.3.4"`

func getPlan(s string) (up *upgradev1.Plan, err error) {
up = &upgradev1.Plan{}
Expand Down Expand Up @@ -232,17 +232,13 @@ var _ = Describe("ManagedOSImage Upgrade e2e tests", func() {
"custom",
"1m",
map[string]runtime.RawExtension{
"image": {Raw: []byte(discoveryPluginImage)},
"envs": {Raw: []byte(
`[{"name": "REPOSITORY","value": "https://github.com/rancher-sandbox/upgradechannel-discovery-test-repo"}]`,
)},
"args": {Raw: []byte(`["git"]`)},
"image": {Raw: []byte(channelImage)},
},
nil,
)
defer k.Delete("managedosversionchannel", "-n", fleetNamespace, "testchannel3")

waitTestChannelPopulate(k, mr, "testchannel3", "foo/bar:v0.1.0-beta1", "v0.1.0-beta1")
waitTestChannelPopulate(k, mr, "testchannel3", "registry.suse.com/rancher/elemental-teal/5.4", "1.2.2")

err := k.ApplyJSON("", osImage, catalog.NewManagedOSImage(
fleetNamespace,
Expand All @@ -255,9 +251,9 @@ var _ = Describe("ManagedOSImage Upgrade e2e tests", func() {

checkUpgradePod(k,
And(
ContainElement("METADATA_UPGRADEIMAGE=foo/bar:v0.1.0-beta1"),
ContainElement("METADATA_UPGRADEIMAGE=registry.suse.com/rancher/elemental-teal/5.4:1.2.2"),
),
Equal("foo/bar:v0.1.0-beta1"),
Equal("registry.suse.com/rancher/elemental-teal/5.4:1.2.2"),
Equal([]string{"/usr/sbin/suc-upgrade"}),
BeNil(),
And(
Expand All @@ -273,11 +269,7 @@ var _ = Describe("ManagedOSImage Upgrade e2e tests", func() {
"custom",
"1m",
map[string]runtime.RawExtension{
"image": {Raw: []byte(discoveryPluginImage)},
"envs": {Raw: []byte(
`[{"name": "REPOSITORY","value": "https://github.com/rancher-sandbox/upgradechannel-discovery-test-repo"}]`,
)},
"args": {Raw: []byte(`["git"]`)},
"image": {Raw: []byte(channelImage)},
},
&upgradev1.ContainerSpec{
Image: "Foobarz",
Expand All @@ -287,7 +279,7 @@ var _ = Describe("ManagedOSImage Upgrade e2e tests", func() {
)
defer k.Delete("managedosversionchannel", "-n", fleetNamespace, "testchannel4")

waitTestChannelPopulate(k, mr, "testchannel4", "foo/bar:v0.1.0-beta1", "v0.1.0-beta1")
waitTestChannelPopulate(k, mr, "testchannel4", "registry.suse.com/rancher/elemental-teal/5.4", "1.2.2")

err := k.ApplyJSON("", osImage, catalog.NewManagedOSImage(
fleetNamespace,
Expand All @@ -310,57 +302,5 @@ var _ = Describe("ManagedOSImage Upgrade e2e tests", func() {
),
)
})

It("tries to apply an upgrade", func() {
mr := catalog.NewManagedOSVersionChannel(
fleetNamespace,
"testchannel5",
"custom",
"1m",
map[string]runtime.RawExtension{
"image": {Raw: []byte(discoveryPluginImage)},
"envs": {Raw: []byte(
`[
{"name": "REPOSITORY","value": "rancher/elemental"},
{"name": "IMAGE_PREFIX","value": "quay.io/costoolkit/elemental"},
{"name": "VERSION_SUFFIX","value": "-amd64"},
{"name": "PRE_RELEASES","value": "true"}
]`,
)},
"args": {Raw: []byte(`["github"]`)},
},
nil,
)
defer k.Delete("managedosversionchannel", "-n", fleetNamespace, "testchannel5")

waitTestChannelPopulate(k, mr, "testchannel5", "quay.io/costoolkit/elemental:v0.1.0-amd64", "v0.1.0-amd64")

err := k.ApplyJSON("", osImage,
catalog.NewManagedOSImage(fleetNamespace, osImage, []elementalv1.BundleTarget{}, "", "v0.1.0-amd64"))
Expect(err).ToNot(HaveOccurred())

checkUpgradePod(k,
And(
ContainElement("METADATA_UPGRADEIMAGE=quay.io/costoolkit/elemental:v0.1.0-amd64"),
),
Equal("quay.io/costoolkit/elemental:v0.1.0-amd64"),
Equal([]string{"/usr/sbin/suc-upgrade"}),
BeNil(),
And(
ContainElement("host-root=/host"),
),
)

Eventually(func() string {
podName := upgradePod(k)
str, _ := kubectl.Run("logs", "-n", cattleSystemNamespace, podName)
fmt.Println(str)
return str
}, 5*time.Minute, 2*time.Second).Should(
And(
ContainSubstring("Starting elemental version"),
ContainSubstring("Could not find device for COS_RECOVERY label: no device found"),
))
})
})
})

0 comments on commit 782f57c

Please sign in to comment.