Skip to content

Machine create#128

Open
majst01 wants to merge 119 commits intomainfrom
machine-create
Open

Machine create#128
majst01 wants to merge 119 commits intomainfrom
machine-create

Conversation

@majst01
Copy link
Copy Markdown
Contributor

@majst01 majst01 commented Feb 10, 2026

Description

Machine Create

Depends on:

TODO:

Machine Creation leads actually to:

{"time":"2026-04-08T12:35:32.896634996Z","level":"ERROR","msg":"report","machineID":"00000000-0000-0000-0000-ac1f6bd3909c","error":"rpc error: code = Unknown desc = the machine \"00000000-0000-0000-0000-ac1f6bd3909c\" could not be enslaved 
into the vrf because no vrf was found, error: %!w(<nil>)"}

@metal-robot metal-robot bot added the area: control-plane Affects the metal-stack control-plane area. label Feb 10, 2026
@codecov
Copy link
Copy Markdown

codecov bot commented Feb 22, 2026

Codecov Report

❌ Patch coverage is 73.92523% with 279 lines in your changes missing coverage. Please review.
✅ Project coverage is 72.17%. Comparing base (e9ec0d9) to head (6bb90dd).

Files with missing lines Patch % Lines
pkg/repository/machine-create.go 71.42% 54 Missing and 48 partials ⚠️
pkg/repository/ip.go 26.86% 49 Missing ⚠️
pkg/repository/machine.go 76.40% 13 Missing and 8 partials ⚠️
pkg/repository/size-reservation.go 73.13% 10 Missing and 8 partials ⚠️
pkg/repository/machine-validation.go 89.54% 9 Missing and 7 partials ⚠️
cmd/server/server.go 0.00% 14 Missing ⚠️
pkg/db/metal/network.go 30.00% 14 Missing ⚠️
pkg/db/metal/ip.go 57.69% 9 Missing and 2 partials ⚠️
pkg/db/metal/machine.go 84.12% 7 Missing and 3 partials ⚠️
pkg/repository/asn.go 53.84% 3 Missing and 3 partials ⚠️
... and 5 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #128      +/-   ##
==========================================
+ Coverage   71.09%   72.17%   +1.07%     
==========================================
  Files         190      194       +4     
  Lines       14170    15147     +977     
==========================================
+ Hits        10074    10932     +858     
- Misses       3099     3130      +31     
- Partials      997     1085      +88     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@simcod simcod moved this to In Progress in Development Mar 9, 2026
@majst01 majst01 marked this pull request as ready for review April 7, 2026 13:38
@majst01 majst01 requested a review from a team as a code owner April 7, 2026 13:38
@majst01 majst01 self-assigned this Apr 7, 2026
if err != nil {
return result, err
}
if imageVersion.Patch() == 0 {
Copy link
Copy Markdown

@l0wl3vel l0wl3vel Apr 9, 2026

Choose a reason for hiding this comment

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

It looks like this will result in the latest version of the image being used if the patch is either not set (which defaults to patch == 0) or a version with patch set to 0 like v1.0.0. Is this intended?

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.

Yes this is true, but you are partly right, this might be irritating if some metal-stack deployments really configured images with 1.0.0 or similar. We usually only have images where patch is equal to the release date like so:

debian-12.0.20260408

Copy link
Copy Markdown

@l0wl3vel l0wl3vel Apr 9, 2026

Choose a reason for hiding this comment

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

I see. Can lead to confusing outcomes for users familiar with semver. Passing in explicit versions and having them sometimes treated like a constraint is unexpected.

We could consider allowing users to pass in semver constraints into machine creation requests instead. For your example that would mean we would pass in ~12.0, which would match the current behavior without surprises. example

Not sure if this is in scope here, but what better place could there be to do this than a v2 API.

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.

Nice idea, but actually even gardener does not support semver version qualifiers for images.

Comment thread pkg/repository/machine-create.go
Comment thread pkg/repository/machine-create.go Outdated
return nil, nil, fmt.Errorf("unable to allocate an ip in network: %s %w", network.network.ID, err)
}
ip := &metal.IP{
IPAddress: ipAddress,
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.

No AllocationUUID set. Probable this should also just call the IP repository in the long run?

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.

done

Comment thread pkg/db/metal/machine.go
Comment on lines +241 to +242
NetworkType *NetworkType `rethinkdb:"networktype"`
NATType *NATType `rethinkdb:"nattype"`
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.

should be no pointer

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: control-plane Affects the metal-stack control-plane area.

Projects

Status: In Progress

Development

Successfully merging this pull request may close these issues.

6 participants