-
Notifications
You must be signed in to change notification settings - Fork 103
Update backup agent default image type to unified #2351
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
hxu
wants to merge
6
commits into
FoundationDB:main
Choose a base branch
from
hxu:hxu/backup-default-image-type
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3576,7 +3576,7 @@ var _ = Describe("pod_models", func() { | |
fdbv1beta2.BackupDeploymentLabel: string(cluster.ObjectMeta.UID), | ||
})) | ||
Expect(deployment.ObjectMeta.Annotations).To(Equal(map[string]string{ | ||
"foundationdb.org/last-applied-spec": "8d2e3abf517313fabdf4e19e50b46f9d5b63e5c5d587a01565008945a2dec87f", | ||
"foundationdb.org/last-applied-spec": "946b41ecc6985d5f56d9749e9366132ba4e8cb250eb3bcfe73b037ad1f47c7f4", | ||
})) | ||
}) | ||
|
||
|
@@ -3639,7 +3639,7 @@ var _ = Describe("pod_models", func() { | |
It("should set the image and command for the backup agent", func() { | ||
Expect( | ||
container.Image, | ||
).To(Equal(fmt.Sprintf("foundationdb/foundationdb:%s", cluster.Spec.Version))) | ||
).To(Equal(fmt.Sprintf("foundationdb/fdb-kubernetes-monitor:%s", cluster.Spec.Version))) | ||
Expect(container.Command).To(Equal([]string{"backup_agent"})) | ||
Expect(container.Args).To(Equal([]string{ | ||
"--log", | ||
|
@@ -3690,13 +3690,18 @@ var _ = Describe("pod_models", func() { | |
It("should set the image and command for the container", func() { | ||
Expect( | ||
container.Image, | ||
).To(Equal(fmt.Sprintf("foundationdb/foundationdb-kubernetes-sidecar:%s-1", cluster.Spec.Version))) | ||
).To(Equal(fmt.Sprintf("foundationdb/fdb-kubernetes-monitor:%s", cluster.Spec.Version))) | ||
Expect(container.Args).To(Equal([]string{ | ||
"--copy-file", | ||
"fdb.cluster", | ||
"--require-not-empty", | ||
"fdb.cluster", | ||
"--init-mode", | ||
"--mode", | ||
"init", | ||
"--output-dir", | ||
"/var/output-files", | ||
"--input-dir", | ||
"/var/input-files", | ||
})) | ||
}) | ||
|
||
|
@@ -3897,7 +3902,7 @@ var _ = Describe("pod_models", func() { | |
"foundationdb.org/backup-for": string(cluster.ObjectMeta.UID), | ||
})) | ||
Expect(deployment.ObjectMeta.Annotations).To(Equal(map[string]string{ | ||
"foundationdb.org/last-applied-spec": "879780b88956de7a05e245cdbf16c565b95fe5c956e3a89e7ea259cd9b209d97", | ||
"foundationdb.org/last-applied-spec": "23b6a2501f83a4cfcf760f639b1d841203ef4f44d496da072ebd1542870ad53f", | ||
})) | ||
|
||
Expect( | ||
|
@@ -3925,7 +3930,7 @@ var _ = Describe("pod_models", func() { | |
).To(Equal("foundationdb/foundationdb:dev")) | ||
Expect( | ||
deployment.Spec.Template.Spec.InitContainers[0].Image, | ||
).To(Equal("foundationdb/foundationdb-kubernetes-sidecar:dev-1")) | ||
).To(Equal("foundationdb/foundationdb:dev")) | ||
}) | ||
}) | ||
|
||
|
@@ -3963,37 +3968,36 @@ var _ = Describe("pod_models", func() { | |
}) | ||
}) | ||
|
||
When("using the unified image", func() { | ||
When("using the split image", func() { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I assumed that we still want to test the split image behavior, so test swaps with |
||
BeforeEach(func() { | ||
imageType := fdbv1beta2.ImageTypeUnified | ||
imageType := fdbv1beta2.ImageTypeSplit | ||
backup.Spec.ImageType = &imageType | ||
deployment, err = GetBackupDeployment(backup) | ||
Expect(err).NotTo(HaveOccurred()) | ||
Expect(deployment).NotTo(BeNil()) | ||
}) | ||
|
||
It("should use the unified image as main and init container", func() { | ||
Expect(deployment.Spec.Template.Spec.InitContainers).To(HaveLen(1)) | ||
Expect(deployment.Spec.Template.Spec.Containers).To(HaveLen(1)) | ||
It( | ||
"should use the split image as main container and the sidecar image as the init container", | ||
func() { | ||
Expect(deployment.Spec.Template.Spec.InitContainers).To(HaveLen(1)) | ||
Expect(deployment.Spec.Template.Spec.Containers).To(HaveLen(1)) | ||
|
||
Expect( | ||
deployment.Spec.Template.Spec.InitContainers[0].Image, | ||
).To(HavePrefix(fdbv1beta2.FoundationDBKubernetesBaseImage)) | ||
Expect(deployment.Spec.Template.Spec.InitContainers[0].Args).To(ConsistOf( | ||
"--copy-file", | ||
"fdb.cluster", | ||
"--require-not-empty", | ||
"fdb.cluster", | ||
"--mode", | ||
"init", | ||
"--output-dir", | ||
"/var/output-files", | ||
"--input-dir", | ||
"/var/input-files")) | ||
Expect( | ||
deployment.Spec.Template.Spec.Containers[0].Image, | ||
).To(HavePrefix(fdbv1beta2.FoundationDBKubernetesBaseImage)) | ||
}) | ||
Expect( | ||
deployment.Spec.Template.Spec.InitContainers[0].Image, | ||
).To(HavePrefix(fdbv1beta2.FoundationDBSidecarBaseImage)) | ||
Expect(deployment.Spec.Template.Spec.InitContainers[0].Args).To(ConsistOf( | ||
"--copy-file", | ||
"fdb.cluster", | ||
"--require-not-empty", | ||
"fdb.cluster", | ||
"--init-mode", | ||
)) | ||
Expect( | ||
deployment.Spec.Template.Spec.Containers[0].Image, | ||
).To(HavePrefix(fdbv1beta2.FoundationDBBaseImage)) | ||
}, | ||
) | ||
}) | ||
}) | ||
|
||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test seemed a bit suspect to me -- shouldn't the init container be the fdb-kubernetes-monitor? The failure message indicated that it was actually the same image as the main container.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In this test the image config is changed and the main image config is set to
foundationdb/foundationdb:dev
. Since the default image is now the unified image for the backup pods, the init image and the main image will be the same, in this casefoundationdb/foundationdb:dev
and the sidecar image config will be ignored.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got it. Even though this is valid from the operator's perspective, this would not actually work right, because the foundationdb image can't be used as the init container image?