Skip to content

feat: global registry support#2448

Merged
danielorihuela merged 3 commits intomainfrom
feat/global-registry-support
Apr 23, 2026
Merged

feat: global registry support#2448
danielorihuela merged 3 commits intomainfrom
feat/global-registry-support

Conversation

@danielorihuela
Copy link
Copy Markdown
Contributor

@danielorihuela danielorihuela commented Apr 22, 2026

Add support for a single configurable registry.

Context

We decided after some discussions to simplify the solution. Initially, we wanted to have a global value to configure the registry, that could then be override in an agent-per-agent basis. This was too complex. We decided to only give support for using one registry at a time, which can be configured.

This PR does that. It adds a global option in agent control to configure the registry, and uses that option to decide from where to download the packages. This is not a final solution, but a "shortcut" to unblock following tasks.

Technical details

registry was removed from agent types

We no longer give support to configure the registry on the agent type configuration. It must be configured from the agent control config. In other words, all packages must be downloaded from the same registry.

shortcut solution

Removing the registry impacts several parts of the codebase. It's not a simple removal of a field. To avoid blocking other tasks, we are moving ahead with this temporal solution. Basically, we "patch" the registry before doing any operation with the oci downloader.

  • The parsed references when parsing the agent type aren't the ones that we will use
  • I added a base.io registry when templating the references that's not used but complies with the format of a reference

In a different PR, we will modify the code to reflect the correct new structure.

@danielorihuela danielorihuela changed the title Feat/global registry support feat: global registry support Apr 22, 2026
@danielorihuela danielorihuela force-pushed the feat/global-registry-support branch from ec225bf to 0aa496f Compare April 23, 2026 07:52
@danielorihuela danielorihuela added k8s-extended-e2e Trigger extended k8s e2e on a PR onhost-extended-e2e Execution of on host e2e in the current branch labels Apr 23, 2026
@danielorihuela danielorihuela force-pushed the feat/global-registry-support branch from 0aa496f to 6948f2f Compare April 23, 2026 13:03
@danielorihuela danielorihuela force-pushed the feat/global-registry-support branch from 6948f2f to 3bcd04d Compare April 23, 2026 13:51
@danielorihuela danielorihuela changed the base branch from main to feat/remove-oci-auth-support-from-agent-types April 23, 2026 13:51
@danielorihuela danielorihuela marked this pull request as ready for review April 23, 2026 13:52
@danielorihuela danielorihuela requested a review from a team as a code owner April 23, 2026 13:52
@danielorihuela danielorihuela force-pushed the feat/global-registry-support branch from 516b356 to 08ea56e Compare April 23, 2026 14:07
Base automatically changed from feat/remove-oci-auth-support-from-agent-types to main April 23, 2026 14:16
#[serde(default)]
pub self_update: SelfUpdateConfig,

/// Oci configuration (used for AC and agents packages)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

is the self update config modification missing ?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

but perhaps a separate pr is better

Copy link
Copy Markdown
Contributor Author

@danielorihuela danielorihuela Apr 23, 2026

Choose a reason for hiding this comment

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

Yes...
I managed to have it working, then I merged @paologallinaharbur changes.

I'll work on the internal struct on a different PR. But at least, with this one, I think @alvarocabanas could take his task, if he wants to.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I mean. I'm aware we have two configs for the same thing now. I just didn't want to do more changes in this PR.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I managed to have it working, then I merged @paologallinaharbur changes.

🤣

Copy link
Copy Markdown
Contributor

@gsanchezgavier gsanchezgavier left a comment

Choose a reason for hiding this comment

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

thanks! i just lefts some minor comments

.map_err(|err| OCIDownloaderError(err.to_string()))
}

fn download_package_artifact(
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

would make sense to change this fn to something that clearly states that the registry will be override?

/// Returns the [Reference] after verifying its signature. The reference always includes the `digest` to
/// assure it is the same reference whose signature was verified.
/// It returns an error if signature verification fails.
fn verified_package_signature_reference(
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

same this one

}
}

fn reference_with_registry(reference: &Reference, registry: &str) -> Reference {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nit: override_registry(

let agent_control_package_manager = OCIPackageManager::new(
OCIArtifactDownloader::new(
oci_client.clone(),
self.bootstrap_config.oci.registry.clone(),
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

o this pr is already taking car of the ac updater, you might miss to remove the config from it and perhaps something inside the updater itself


#[derive(Debug, Deserialize, Serialize, Default, Clone, PartialEq)]
pub struct BearerAuth {
pub token: String,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

at some point we are going to fetch this from other secured places but i think we can extend this without breaking

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I'm not sure about that. From where are we going to take that in the future?
We don't support secrets in the agent control config. At least for now.

Copy link
Copy Markdown
Contributor

@alvarocabanas alvarocabanas left a comment

Choose a reason for hiding this comment

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

LGTM

oci:
auth:
bearer:
token: "token"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

So we go for bearer: token: at the end.. ok.

@danielorihuela danielorihuela merged commit 50e0568 into main Apr 23, 2026
48 checks passed
@danielorihuela danielorihuela deleted the feat/global-registry-support branch April 23, 2026 15:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

k8s-extended-e2e Trigger extended k8s e2e on a PR onhost-extended-e2e Execution of on host e2e in the current branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants