-
Notifications
You must be signed in to change notification settings - Fork 32
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
feat: add cloud provider resources and role #449
Merged
talos-bot
merged 1 commit into
siderolabs:main
from
utkuozdemir:cloud-provider-groundwork
Jul 28, 2024
Merged
feat: add cloud provider resources and role #449
talos-bot
merged 1 commit into
siderolabs:main
from
utkuozdemir:cloud-provider-groundwork
Jul 28, 2024
Conversation
This file contains 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
utkuozdemir
force-pushed
the
cloud-provider-groundwork
branch
from
July 8, 2024 20:37
ca50e88
to
6f2eaec
Compare
utkuozdemir
changed the title
feat: add cloud provider resources and role
WIP: feat: add cloud provider resources and role
Jul 10, 2024
utkuozdemir
force-pushed
the
cloud-provider-groundwork
branch
3 times, most recently
from
July 11, 2024 10:15
5c7aaee
to
3fc6dbe
Compare
utkuozdemir
force-pushed
the
cloud-provider-groundwork
branch
2 times, most recently
from
July 13, 2024 23:44
9753e33
to
85869eb
Compare
utkuozdemir
changed the title
WIP: feat: add cloud provider resources and role
feat: add cloud provider resources and role
Jul 15, 2024
utkuozdemir
commented
Jul 15, 2024
Comment on lines
+261
to
+298
func (st *State) filterEvents(ctx context.Context, cloudProviderID string, eventCh chan<- state.Event) chan state.Event { | ||
innerEventCh := make(chan state.Event) | ||
|
||
panichandler.Go(func() { | ||
defer close(eventCh) | ||
|
||
for { | ||
select { | ||
case <-ctx.Done(): | ||
return | ||
|
||
case event, ok := <-innerEventCh: | ||
if !ok { | ||
return | ||
} | ||
|
||
if event.Type == state.Bootstrapped || event.Type == state.Errored { | ||
channel.SendWithContext(ctx, eventCh, event) | ||
|
||
continue | ||
} | ||
|
||
if event.Resource != nil { | ||
resCloudProviderID, cpOk := event.Resource.Metadata().Labels().Get(omni.LabelCloudProviderID) | ||
if !cpOk || cloudProviderID != resCloudProviderID { | ||
continue // discard | ||
} | ||
} | ||
|
||
channel.SendWithContext(ctx, eventCh, event) | ||
} | ||
} | ||
}, st.logger) | ||
|
||
return innerEventCh | ||
} |
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.
@smira I am not sure if I got this filtering logic right, pls have a look :)
utkuozdemir
force-pushed
the
cloud-provider-groundwork
branch
3 times, most recently
from
July 17, 2024 08:12
37b0505
to
5552da1
Compare
Unix4ever
reviewed
Jul 19, 2024
Unix4ever
reviewed
Jul 19, 2024
Unix4ever
approved these changes
Jul 22, 2024
/m |
utkuozdemir
force-pushed
the
cloud-provider-groundwork
branch
from
July 22, 2024 10:20
5552da1
to
4b6686b
Compare
Unix4ever
force-pushed
the
cloud-provider-groundwork
branch
from
July 24, 2024 18:05
4b6686b
to
5d1c3af
Compare
/m |
Unix4ever
force-pushed
the
cloud-provider-groundwork
branch
from
July 26, 2024 17:20
5d1c3af
to
611e298
Compare
Add the new resources for the cloud provider feature: `CloudConfigs`, `MachineRequests` and `MachineRequestStatuses`. Add a new role, `CloudProvider` with access to the resources a cloud provider plugin requires. Introduce the concept of "cloud provider service accounts" which are a special type of service accounts in the format `cloud-provider:<id>`. They must have the `CloudProvider` role and their id is matched against the label `omni.sidero.dev/cloud-provider-id` label on the `MachineRequest*` type resources. Signed-off-by: Utku Ozdemir <[email protected]>
utkuozdemir
force-pushed
the
cloud-provider-groundwork
branch
from
July 28, 2024 20:48
611e298
to
4ec7a43
Compare
/m |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Add the new resources for the cloud provider feature:
CloudConfigs
,MachineRequests
andMachineRequestStatuses
.Add a new role,
CloudProvider
with access to the resources a cloud provider plugin requires.Introduce the concept of "cloud provider service accounts" which are a special type of service accounts in the format
cloud-provider:<id>
. They must have theCloudProvider
role and their id is matched against the labelomni.sidero.dev/cloud-provider-id
label on theMachineRequest*
type resources.