Skip to content

Conversation

@nsricardor
Copy link
Contributor

@nsricardor nsricardor commented Dec 2, 2025

This PR implements the file storage provisioner, refactors the file storage agent into a driver package, and extends the file-storage attachments CRD with VLANID and IP range support.
Note: The driver package will be migrated to its own standalone application in a future update.

@codecov
Copy link

codecov bot commented Dec 3, 2025

Codecov Report

❌ Patch coverage is 0% with 335 lines in your changes missing coverage. Please review.
✅ Project coverage is 4.85%. Comparing base (c497537) to head (bfb0899).

Files with missing lines Patch % Lines
pkg/file-storage/provisioners/driver/driver.go 0.00% 157 Missing ⚠️
...kg/provisioners/managers/file-storage/provision.go 0.00% 66 Missing ⚠️
.../provisioners/managers/file-storage/provisioner.go 0.00% 46 Missing ⚠️
pkg/apis/unikorn/v1alpha1/zz_generated.deepcopy.go 0.00% 21 Missing ⚠️
...kg/file-storage/provisioners/driver/conversions.go 0.00% 21 Missing ⚠️
.../provisioners/managers/file-storage/deprovision.go 0.00% 12 Missing ⚠️
pkg/file-storage/provisioners/driver/nats.go 0.00% 10 Missing ⚠️
pkg/file-storage/provisioners/provisioners.go 0.00% 2 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##            main    #251      +/-   ##
========================================
- Coverage   4.95%   4.85%   -0.11%     
========================================
  Files         68      71       +3     
  Lines      13645   13935     +290     
========================================
  Hits         676     676              
- Misses     12897   13187     +290     
  Partials      72      72              

☔ 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.

@nsricardor nsricardor requested a review from spjmurray December 3, 2025 07:12
@nsricardor nsricardor changed the title WIP: Implement file-storage provisioner WIP: Implement file-storage provisioner [INST-277] Dec 3, 2025
@nsricardor nsricardor changed the title WIP: Implement file-storage provisioner [INST-277] Implement file-storage provisioner [INST-277] Dec 3, 2025
@nsricardor nsricardor requested a review from squaremo December 3, 2025 10:45
Copy link
Contributor

@spjmurray spjmurray left a comment

Choose a reason for hiding this comment

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

In general philosophically happy, just a few things to think on.

type Attachment struct {
// NetworkID is the network ID for the attachment.
NetworkID string `json:"networkID"`
// SegmentationID is the VLAN ID for the attachment.
Copy link
Contributor

Choose a reason for hiding this comment

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

Technically yes, it's VLAN now, but could be GRE/VXLAN etc etc, so good prescient name!

// Start is the start IP address for the attachment.
Start unikornv1core.IPv4Address `json:"startIP"`
// End is the end IP address for the attachment.
End unikornv1core.IPv4Address `json:"endIP"`
Copy link
Contributor

Choose a reason for hiding this comment

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

It may be easier to have this as a pointer with omit_empty as this handles a single IP address with nil, rather than all clients having to compare start and end for equality. Your choice!

err error
)

if strings.HasPrefix(options.URL, "tls") {
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd feel more comfortable calling u, err := url.Parse(options.URL) and then u.Scheme for this matcher, just to be super safe. You can then validate the other allowable option nats too. And to that end, you may as well do the parsing and validation in the options loader.


log.V(1).Info("attaching network", "vlan", vlan)

// Add references to any resources we consume.
Copy link
Contributor

Choose a reason for hiding this comment

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

This will inhibit network deletion until it's detached, good! We probably want to add something into the network deletion API that says "deny request if there are any file storage references"?

return err
}
}

Copy link
Contributor

Choose a reason for hiding this comment

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

Are we missing a call to remove the storage -> network reference here?

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants