Skip to content
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

✨ Add image resolution policy #237

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open

Conversation

avorima
Copy link
Contributor

@avorima avorima commented Dec 3, 2024

What is the purpose of this pull request/Why do we need it?

Users might want to update VM images without changing the Kubernetes version.
When using an image selector this currently requires removing labels from the old image and adding them to the new one.
I wanted to provide a better solution for this.

Issue #, if available:

Description of changes:

Add a new field resolutionPolicy to the imageSelector. Currently only two values are allowed Exact and Newest.
Exact maps to the current behavior and is the default.
Newest will use the newest entry (determined by createdDate) from the set of matching images.

Special notes for your reviewer:

Checklist:

  • Documentation updated
  • Unit Tests added
  • E2E Tests added
  • Includes emojis

@avorima avorima force-pushed the image-resolution-policy branch from 722776b to 1179cb8 Compare December 5, 2024 11:46
@avorima avorima force-pushed the image-resolution-policy branch from 1179cb8 to fd12eb9 Compare December 5, 2024 11:51
@avorima avorima force-pushed the image-resolution-policy branch from fd12eb9 to db70fe3 Compare December 5, 2024 12:04
@avorima avorima force-pushed the image-resolution-policy branch from db70fe3 to 8c16977 Compare December 5, 2024 12:25
@avorima avorima force-pushed the image-resolution-policy branch from 8c16977 to ce23e66 Compare December 5, 2024 16:01
@avorima avorima force-pushed the image-resolution-policy branch from ce23e66 to 2f49162 Compare December 5, 2024 16:32
@avorima avorima force-pushed the image-resolution-policy branch from 2f49162 to fc254ec Compare December 5, 2024 16:40
Copy link
Member

@mcbenjemaa mcbenjemaa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some remarks only

api/v1alpha1/ionoscloudmachine_types.go Show resolved Hide resolved
api/v1alpha1/ionoscloudmachine_types.go Show resolved Hide resolved
internal/service/cloud/image.go Show resolved Hide resolved
@@ -121,3 +121,17 @@ var _ = Describe("Should be able to create a cluster with 1 control-plane using
}
})
})

var _ = Describe("Should be able to create a cluster with 1 control-plane and 2 workers using an image selector", func() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it okay with long e2e runs?

We already have cases; if you want, you can set the flavor to one of them.

Another suggestion would be to label test cases and control them with PR labels.
for example capmox, have something like this:
ionos-cloud/cluster-api-provider-proxmox#352 (comment)

But. the whole e2e topic is not related to this PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think both code paths (image id and image selector) should be covered. i changed the conformance tests to use image selectors, so i think this test case can be removed.

Copy link

sonarqubecloud bot commented Dec 6, 2024

Copy link
Member

@mcbenjemaa mcbenjemaa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants