-
Notifications
You must be signed in to change notification settings - Fork 556
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
chore: split config.Registries
into the separate resource.
#9780
base: main
Are you sure you want to change the base?
Conversation
bac4314
to
afa039e
Compare
config.Registry
into the separate resource.config.Registries
into the separate resource.
afa039e
to
b7bb576
Compare
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.
Maybe this could also remove those config definitions from the old place as well?
internal/app/machined/pkg/controllers/files/cri_registry_config.go
Outdated
Show resolved
Hide resolved
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.
the image/resolver (via PullImage) hasn't been updated
b7bb576
to
d0f1a62
Compare
@smira I think all paths leading to |
// This is a hack, but I (Dmitry) don't have enough patience to figure out why we don't support complex maps | ||
return "resource/definitions/cri/registry.proto", "talos.resource.definitions.cri.RegistryMirrorConfig" | ||
case typeData{"github.com/siderolabs/talos/pkg/machinery/resources/cri", "RegistryConfig"}: | ||
// This is a hack, but I (Dmitry) don't have enough patience to figure out why we don't support complex maps |
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.
the author gave up 😛
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.
Yeah...
) | ||
|
||
// RegistriesSpecType is type of RegistriesSpec resource. | ||
const RegistriesSpecType = resource.Type("Registries.net.talos.dev") |
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.
if we call it registries
, we should name the constant RegistriesType
, and cascading down.
I would probably name it RegistriesConfig
though
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.
Done!
const RegistriesID resource.ID = "registries" | ||
|
||
// RegistriesSpec resource holds info about container registries. | ||
type RegistriesSpec = typed.Resource[RegistriesSpecSpec, RegistriesSpecExtension] |
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.
add it to the cri_test.go
in this folder to catch some issues quickly
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.
Yup!
@@ -1506,13 +1507,19 @@ func Upgrade(_ runtime.Sequence, data any) (runtime.TaskExecutionFunc, string) { | |||
|
|||
logger.Printf("performing upgrade via %q", in.GetImage()) | |||
|
|||
rgs, err := safe.ReaderGetByID[*crires.RegistriesSpec](ctx, r.State().V1Alpha2().Resources(), crires.RegistriesID) |
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 certainly has a race condition (not here, but more on the install sequence)
a proper way would be to block for the config to be available
rgs, err := safe.ReaderGetByID[*crires.RegistriesSpec](ctx, r.State().V1Alpha2().Resources(), crires.RegistriesID) | |
rgs, err := safe.StateWaitFor[*crires.RegistriesSpec](ctx, r.State().V1Alpha2().Resources(), crires.RegistriesID, state.WithEventTypes(state.Created, state.Updated)) |
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.
Done!
d0f1a62
to
65d4127
Compare
Integration provision passes, so upgrades work. I'll remove the label to speed-up process. |
Required for siderolabs#9614 Closes siderolabs#9766 Signed-off-by: Dmitriy Matrenichev <[email protected]>
65d4127
to
3ffb2e1
Compare
Required for #9614
Closes #9766