Skip to content

Conversation

@mac641
Copy link
Contributor

@mac641 mac641 commented Nov 14, 2025

Description

References

TODO

  • how are oci credentials supposed to be retrieved?
  • add tests

@mac641 mac641 requested a review from a team as a code owner November 14, 2025 14:27
@mac641
Copy link
Contributor Author

mac641 commented Nov 14, 2025

@majst01 okay, so this is what I came up with. Can you do a review, pls?

Besides, I'm wondering if it's suitable to retrieve the oci credentials from env vars. Can you help me out here?

@majst01
Copy link
Contributor

majst01 commented Nov 15, 2025

@majst01 okay, so this is what I came up with. Can you do a review, pls?

Besides, I'm wondering if it's suitable to retrieve the oci credentials from env vars. Can you help me out here?

The OCI creadentials should be passed as optional fields from the pixiecore to the metal-hammer:

https://github.com/metal-stack/metal-hammer/blob/master/cmd/pixie-client.go#L14

Ideally a slice of registryconfig which contains the registry url, the username and the password should come from pixiecore.

@mac641
Copy link
Contributor Author

mac641 commented Nov 19, 2025

@majst01 does this work? https://github.com/metal-stack/metal-hammer/pull/175/files#diff-cfcd5a78ad9476ee24d7680dd023e71136f329c771d76ae6837ba68320b6379cR37

what does machine.Allocation.Image.URL contain? Is it the full oci url or just the image name, e.g. debian:12?

@majst01
Copy link
Contributor

majst01 commented Nov 20, 2025

@majst01 does this work? https://github.com/metal-stack/metal-hammer/pull/175/files#diff-cfcd5a78ad9476ee24d7680dd023e71136f329c771d76ae6837ba68320b6379cR37

what does machine.Allocation.Image.URL contain? Is it the full oci url or just the image name, e.g. debian:12?

It contains the full URL as configured in the image

@mac641 mac641 force-pushed the oci-puller branch 3 times, most recently from 0bfe689 to 7052ccb Compare December 4, 2025 14:24
@mac641 mac641 force-pushed the oci-puller branch 7 times, most recently from ad2bb15 to 2506148 Compare January 16, 2026 11:51
@mac641 mac641 force-pushed the oci-puller branch 7 times, most recently from 7b7365d to 2a95918 Compare January 22, 2026 15:37
Comment on lines +45 to +50
for _, c := range ociConfigs {
err = img.NewImage(h.log).OciPull(ctx, c.RegistryURL, h.chrootPrefix, c.Username, c.Password)
if err != nil {
return nil, err
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

The ociconfig should be a map from registry -> credentials, then you can simple get the credentials required for this registry and no need to iterate

// keep this until https://github.com/u-root/u-root/pull/3451 is merged and released
github.com/u-root/u-root => github.com/majst01/u-root v0.0.0-20250910091544-306665b6f8e8

google.golang.org/genproto => google.golang.org/genproto v0.0.0-20250826171959-ef028d996bc1
Copy link
Contributor

Choose a reason for hiding this comment

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

why is this required ?

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 had an import cycle which was fixed by this. If you have any idea on how to solve this differently, I'm happy to implement it.

@Gerrit91 Gerrit91 moved this to In Progress in Development Jan 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: In Progress

Development

Successfully merging this pull request may close these issues.

3 participants