-
Notifications
You must be signed in to change notification settings - Fork 10
Added Topology labels #1418
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
Merged
Merged
Added Topology labels #1418
Changes from 3 commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
c77bc94
1411 Topology Labels
friegger 20e32d4
Add reuse information
friegger 3ccaa27
Readd volumesnapshots and generate with latest binaries
friegger 58cf151
Use a map for the labels
friegger 2ce3329
Merge remote-tracking branch 'origin/main' into feat/1411-add-topolog…
friegger 3d73029
Remove unused helper fn
friegger 77d7b35
Update docs
friegger fca3299
Remove obsolete fields
friegger d93967f
Add volume support
friegger 9108661
Extract setting the labels to the common utils package
friegger df83d30
Add topology labels also to buckets
friegger fa6c02e
Add missing license info
friegger 64075ce
Inline labelschanged into if statement
friegger febd9dd
Remove unnecessary assignment
friegger 36eed39
Merge branch 'main' into feat/1411-add-topology-labels
friegger cb8f290
Apply review comments
friegger 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
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
47 changes: 47 additions & 0 deletions
47
poollet/machinepoollet/controllers/machinepool_init_test.go
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 |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| // SPDX-FileCopyrightText: 2025 SAP SE or an SAP affiliate company and IronCore contributors | ||
| // SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| package controllers_test | ||
|
|
||
| import ( | ||
| "context" | ||
|
|
||
| computev1alpha1 "github.com/ironcore-dev/ironcore/api/compute/v1alpha1" | ||
| "github.com/ironcore-dev/ironcore/poollet/machinepoollet/controllers" | ||
| . "github.com/onsi/ginkgo/v2" | ||
| . "github.com/onsi/gomega" | ||
| metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | ||
| . "sigs.k8s.io/controller-runtime/pkg/envtest/komega" | ||
| ) | ||
|
|
||
| var _ = Describe("MachinePoolInit", func() { | ||
| It("should add topology labels", func(ctx SpecContext) { | ||
| initializedCalled := false | ||
|
|
||
| mpi := &controllers.MachinePoolInit{ | ||
| Client: k8sClient, | ||
| MachinePoolName: "test-pool", | ||
| ProviderID: "provider-123", | ||
| TopologyRegionLabel: "foo-region-1", | ||
| TopologyZoneLabel: "foo-zone-1", | ||
| OnInitialized: func(ctx context.Context) error { | ||
| initializedCalled = true | ||
| return nil | ||
| }, | ||
| } | ||
|
|
||
| Expect(mpi.Start(ctx)).ToNot(HaveOccurred()) | ||
| Expect(initializedCalled).To(BeTrue()) | ||
|
|
||
| pool := &computev1alpha1.MachinePool{ | ||
| ObjectMeta: metav1.ObjectMeta{ | ||
| Name: "test-pool", | ||
| }, | ||
| } | ||
|
|
||
| Eventually(Object(pool)).Should(SatisfyAll( | ||
| HaveField("ObjectMeta.Labels", HaveKeyWithValue("topology.ironcore.dev/region", "foo-region-1")), | ||
| HaveField("ObjectMeta.Labels", HaveKeyWithValue("topology.ironcore.dev/zone", "foo-zone-1")), | ||
| )) | ||
| }) | ||
| }) |
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.