-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
21 changed files
with
2,805 additions
and
239 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
FROM metalstack/builder:latest as builder | ||
|
||
FROM alpine:3.12 | ||
FROM alpine:3.13 | ||
RUN apk -U add ca-certificates | ||
COPY --from=builder /work/bin/metal-api /metal-api | ||
CMD ["/metal-api"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package datastore | ||
|
||
import "github.com/metal-stack/metal-api/cmd/metal-api/internal/metal" | ||
|
||
// FindFilesystemLayout return a filesystemlayout for a given id. | ||
func (rs *RethinkStore) FindFilesystemLayout(id string) (*metal.FilesystemLayout, error) { | ||
var fl metal.FilesystemLayout | ||
err := rs.findEntityByID(rs.filesystemLayoutTable(), &fl, id) | ||
if err != nil { | ||
return nil, err | ||
} | ||
return &fl, nil | ||
} | ||
|
||
// ListFilesystemLayouts returns all filesystemlayouts. | ||
func (rs *RethinkStore) ListFilesystemLayouts() (metal.FilesystemLayouts, error) { | ||
fls := make(metal.FilesystemLayouts, 0) | ||
err := rs.listEntities(rs.filesystemLayoutTable(), &fls) | ||
return fls, err | ||
} | ||
|
||
// CreateFilesystemLayout creates a new filesystemlayout. | ||
func (rs *RethinkStore) CreateFilesystemLayout(fl *metal.FilesystemLayout) error { | ||
return rs.createEntity(rs.filesystemLayoutTable(), fl) | ||
} | ||
|
||
// DeleteFilesystemLayout deletes a filesystemlayout. | ||
func (rs *RethinkStore) DeleteFilesystemLayout(fl *metal.FilesystemLayout) error { | ||
return rs.deleteEntity(rs.filesystemLayoutTable(), fl) | ||
} | ||
|
||
// UpdateFilesystemLayout updates a filesystemlayout. | ||
func (rs *RethinkStore) UpdateFilesystemLayout(oldFilesystemLayout *metal.FilesystemLayout, newFilesystemLayout *metal.FilesystemLayout) error { | ||
return rs.updateEntity(rs.filesystemLayoutTable(), newFilesystemLayout, oldFilesystemLayout) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.