Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
.vscode
.codegraph

bin
venv
Expand Down
22 changes: 22 additions & 0 deletions go/tag/cluster.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package tag

const (
// ClusterID tag to store the id of the cluster
ClusterID = "cluster.metal-stack.io/id"
// ClusterName tag to store the name of the cluster
ClusterName = "cluster.metal-stack.io/name"
// ClusterDescription tag to store the description of the cluster
ClusterDescription = "cluster.metal-stack.io/description"
// ClusterProject tag to store the project the cluster belongs to
ClusterProject = "cluster.metal-stack.io/project"
// ClusterPartition tag to store the partition of the cluster
ClusterPartition = "cluster.metal-stack.io/partition"
// ClusterTenant tag to store the tenant of the cluster
ClusterTenant = "cluster.metal-stack.io/tenant"
// ClusterServiceFQN tag to identify a service running in the cluster
ClusterServiceFQN = "cluster.metal-stack.io/id/namespace/service"
// ClusterEgress tag to identify egress ips used for a cluster
ClusterEgress = "cluster.metal-stack.io/id/egress"
// ClusterOwner tag to store the name of the cluster owner
ClusterOwner = "cluster.metal-stack.io/owner"
)
2 changes: 0 additions & 2 deletions go/tag/machine.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ const (
MachineID = "machine.metal-stack.io/id"
// MachineName tag to store machine name
MachineName = "machine.metal-stack.io/name"
// MachineDescription tag to store machine description
MachineDescription = "machine.metal-stack.io/description"
// MachineProject tag to store the project where the machine belongs to
MachineProject = "machine.metal-stack.io/project"
// MachineTenant tag to store the tenant the machine belongs to
Expand Down
11 changes: 11 additions & 0 deletions go/tag/network.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package tag

const (
// NetworkDefault indicates a network that can serve as a default network for cluster creation
// there should only be one default network in a metal control plane, otherwise behavior will be non-deterministic
NetworkDefault = "network.metal-stack.io/default"
// NetworkDefaultExternal indicates a network that can serve as a default for IP allocations
NetworkDefaultExternal = "network.metal-stack.io/default-external"
// NetworkPartitionStorage indicates a network that can serve as a storage network in a partition
NetworkPartitionStorage = "network.metal-stack.io/partition-storage"
)
2 changes: 1 addition & 1 deletion proto/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
MAKEFLAGS += --no-print-directory
BUF_VERSION := 1.70.0
BUF_VERSION := 1.71.0

_buf:
docker run --rm \
Expand Down
4 changes: 2 additions & 2 deletions proto/buf.gen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ plugins:
out: ../go
opt: paths=source_relative,simple
# python
- remote: buf.build/protocolbuffers/python:v35.0
- remote: buf.build/protocolbuffers/python:v35.1
out: ../python
- remote: buf.build/protocolbuffers/pyi:v35.0
- remote: buf.build/protocolbuffers/pyi:v35.1
out: ../python
- remote: buf.build/connectrpc/python:v0.10.1
out: ../python
Expand Down
4 changes: 1 addition & 3 deletions proto/metalstack/admin/v2/image.proto
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,7 @@ message ImageServiceUpdateRequest {
// Features of this image
repeated metalstack.api.v2.ImageFeature features = 6 [(buf.validate.field).repeated = {
unique: true
items: {
enum: {defined_only: true}
}
items: {enum: {defined_only: true}}
}];
// Classification of this image
metalstack.api.v2.ImageClassification classification = 7 [(buf.validate.field).enum.defined_only = true];
Expand Down
6 changes: 1 addition & 5 deletions proto/metalstack/admin/v2/machine.proto
Original file line number Diff line number Diff line change
Expand Up @@ -131,11 +131,7 @@ message MachineServiceListBMCRequest {
// MachineServiceListBMCResponse is the response payload for a machine listbmc request
message MachineServiceListBMCResponse {
// BMCReports maps the bmc report per machine uuid
map<string, metalstack.api.v2.MachineBMCReport> bmc_reports = 1 [(buf.validate.field).map = {
keys: {
string: {uuid: true}
}
}];
map<string, metalstack.api.v2.MachineBMCReport> bmc_reports = 1 [(buf.validate.field).map = {keys: {string: {uuid: true}}}];
}

// MachineServiceConsolePasswordRequest is the request payload for getting the console password.
Expand Down
24 changes: 6 additions & 18 deletions proto/metalstack/api/v2/filesystem.proto
Original file line number Diff line number Diff line change
Expand Up @@ -108,17 +108,13 @@ message Filesystem {
repeated string mount_options = 7 [(buf.validate.field).repeated = {
unique: true
max_items: 32
items: {
string: {[metalstack.api.v2.is_option]: true}
}
items: {string: {[metalstack.api.v2.is_option]: true}}
}];
// CreateOptions the options to use to create (mkfs) this filesystem
repeated string create_options = 8 [(buf.validate.field).repeated = {
unique: true
max_items: 32
items: {
string: {[metalstack.api.v2.is_option]: true}
}
items: {string: {[metalstack.api.v2.is_option]: true}}
}];
}

Expand All @@ -144,9 +140,7 @@ message Raid {
repeated string devices = 2 [
(buf.validate.field).repeated = {
max_items: 128
items: {
string: {[metalstack.api.v2.is_name]: true}
}
items: {string: {[metalstack.api.v2.is_name]: true}}
},
(buf.validate.field).repeated.(metalstack.api.v2.all_trimmed) = true
];
Expand All @@ -159,9 +153,7 @@ message Raid {
repeated string create_options = 4 [(buf.validate.field).repeated = {
unique: true
max_items: 32
items: {
string: {[metalstack.api.v2.is_option]: true}
}
items: {string: {[metalstack.api.v2.is_option]: true}}
}];
// Spares number of spares for the raid array
int32 spares = 5;
Expand Down Expand Up @@ -193,19 +185,15 @@ message VolumeGroup {
repeated string devices = 2 [
(buf.validate.field).repeated = {
max_items: 128
items: {
string: {[metalstack.api.v2.is_name]: true}
}
items: {string: {[metalstack.api.v2.is_name]: true}}
},
(buf.validate.field).repeated.(metalstack.api.v2.all_trimmed) = true
];
// Tags list of tags to add to the volume group
repeated string tags = 3 [
(buf.validate.field).repeated = {
max_items: 128
items: {
string: {[metalstack.api.v2.is_name]: true}
}
items: {string: {[metalstack.api.v2.is_name]: true}}
},
(buf.validate.field).repeated.(metalstack.api.v2.all_trimmed) = true
];
Expand Down
4 changes: 1 addition & 3 deletions proto/metalstack/api/v2/image.proto
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,7 @@ message Image {
// Features of this image
repeated ImageFeature features = 6 [(buf.validate.field).repeated = {
unique: true
items: {
enum: {defined_only: true}
}
items: {enum: {defined_only: true}}
}];
// Classification of this image
ImageClassification classification = 7 [(buf.validate.field).enum.defined_only = true];
Expand Down
44 changes: 10 additions & 34 deletions proto/metalstack/api/v2/machine.proto
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,7 @@ message MachineServiceCreateRequest {
// A lower bound can be set similarly with `min_items`.
max_items: 50
// `items` validate each value in this `repeated` field.
items: {
string: {[metalstack.api.v2.is_key]: true}
}
items: {string: {[metalstack.api.v2.is_key]: true}}
},
(buf.validate.field).repeated.(metalstack.api.v2.all_trimmed) = true
];
Expand Down Expand Up @@ -173,9 +171,7 @@ message MachineServiceUpdateRequest {
// A lower bound can be set similarly with `min_items`.
max_items: 50
// `items` validate each value in this `repeated` field.
items: {
string: {[metalstack.api.v2.is_key]: true}
}
items: {string: {[metalstack.api.v2.is_key]: true}}
},
(buf.validate.field).repeated.(metalstack.api.v2.all_trimmed) = true
];
Expand Down Expand Up @@ -319,9 +315,7 @@ message MachineAllocation {
// A lower bound can be set similarly with `min_items`.
max_items: 50
// `items` validate each value in this `repeated` field.
items: {
string: {[metalstack.api.v2.is_key]: true}
}
items: {string: {[metalstack.api.v2.is_key]: true}}
},
(buf.validate.field).repeated.(metalstack.api.v2.all_trimmed) = true
];
Expand Down Expand Up @@ -365,11 +359,7 @@ message FirewallEgressRule {
// Protocol the protocol for the rule, defaults to tcp
IPProtocol protocol = 1 [(buf.validate.field).enum.defined_only = true];
// Ports the ports affected by this rule
repeated uint32 ports = 2 [(buf.validate.field).repeated = {
items: {
uint32: {lte: 65532}
}
}];
repeated uint32 ports = 2 [(buf.validate.field).repeated = {items: {uint32: {lte: 65532}}}];
// To the destination cidrs affected by this rule
repeated string to = 3 [(buf.validate.field).repeated.(metalstack.api.v2.prefixes) = true];
// Comment for this rule
Expand All @@ -387,11 +377,7 @@ message FirewallIngressRule {
// Protocol the protocol for the rule, defaults to tcp
IPProtocol protocol = 1 [(buf.validate.field).enum.defined_only = true];
// Ports the ports affected by this rule
repeated uint32 ports = 2 [(buf.validate.field).repeated = {
items: {
uint32: {lte: 65532}
}
}];
repeated uint32 ports = 2 [(buf.validate.field).repeated = {items: {uint32: {lte: 65532}}}];
// To the destination cidrs affected by this rule
repeated string to = 3 [(buf.validate.field).repeated.(metalstack.api.v2.prefixes) = true];
// From the source cidrs affected by this rule
Expand Down Expand Up @@ -825,33 +811,25 @@ message MachineNicQuery {
repeated string macs = 1 [(buf.validate.field).repeated = {
max_items: 100
unique: true
items: {
string: {[metalstack.api.v2.macaddress]: true}
}
items: {string: {[metalstack.api.v2.macaddress]: true}}
}];
// Names this machine nic has
repeated string names = 2 [(buf.validate.field).repeated = {
max_items: 100
unique: true
items: {
string: {max_len: 128}
}
items: {string: {max_len: 128}}
}];
// NeighborMacs this machine nic has
repeated string neighbor_macs = 3 [(buf.validate.field).repeated = {
max_items: 100
unique: true
items: {
string: {[metalstack.api.v2.macaddress]: true}
}
items: {string: {[metalstack.api.v2.macaddress]: true}}
}];
// NeighborNames this machine nic has
repeated string neighbor_names = 4 [(buf.validate.field).repeated = {
max_items: 100
unique: true
items: {
string: {max_len: 128}
}
items: {string: {max_len: 128}}
}];
}

Expand All @@ -860,9 +838,7 @@ message MachineDiskQuery {
// Names of disks in this machine
repeated string names = 1 [(buf.validate.field).repeated = {
max_items: 100
items: {
string: {max_len: 128}
}
items: {string: {max_len: 128}}
}];
// Sizes of disks in this machine
repeated uint64 sizes = 2 [(buf.validate.field).repeated = {max_items: 100}];
Expand Down
32 changes: 8 additions & 24 deletions proto/metalstack/api/v2/token.proto
Original file line number Diff line number Diff line change
Expand Up @@ -114,12 +114,8 @@ message TokenServiceCreateRequest {
// ProjectRoles associates a project id with the corresponding role of the token owner
map<string, ProjectRole> project_roles = 4 [
(buf.validate.field).map = {
keys: {
string: {uuid: true}
}
values: {
enum: {defined_only: true}
}
keys: {string: {uuid: true}}
values: {enum: {defined_only: true}}
},
(buf.validate.field).map.(metalstack.api.v2.keys_trimmed) = true
];
Expand All @@ -132,9 +128,7 @@ message TokenServiceCreateRequest {
max_len: 128
}
}
values: {
enum: {defined_only: true}
}
values: {enum: {defined_only: true}}
},
(buf.validate.field).map.(metalstack.api.v2.keys_trimmed) = true
];
Expand All @@ -150,9 +144,7 @@ message TokenServiceCreateRequest {
// UUID regex pattern: 8-4-4-4-12 hex digits
expression: "this.all(k, k == '' || k == '*' || k.matches('^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$'))"
},
(buf.validate.field).map.values = {
enum: {defined_only: true}
}
(buf.validate.field).map.values = {enum: {defined_only: true}}
];
// Labels on this token
Labels labels = 9;
Expand Down Expand Up @@ -214,12 +206,8 @@ message TokenServiceUpdateRequest {
// ProjectRoles associates a project id with the corresponding role of the token owner
map<string, ProjectRole> project_roles = 5 [
(buf.validate.field).map = {
keys: {
string: {uuid: true}
}
values: {
enum: {defined_only: true}
}
keys: {string: {uuid: true}}
values: {enum: {defined_only: true}}
},
(buf.validate.field).map.(metalstack.api.v2.keys_trimmed) = true
];
Expand All @@ -232,9 +220,7 @@ message TokenServiceUpdateRequest {
max_len: 128
}
}
values: {
enum: {defined_only: true}
}
values: {enum: {defined_only: true}}
},
(buf.validate.field).map.(metalstack.api.v2.keys_trimmed) = true
];
Expand All @@ -250,9 +236,7 @@ message TokenServiceUpdateRequest {
// UUID regex pattern: 8-4-4-4-12 hex digits
expression: "this.all(k, k == '' || k == '*' || k.matches('^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$'))"
},
(buf.validate.field).map.values = {
enum: {defined_only: true}
}
(buf.validate.field).map.values = {enum: {defined_only: true}}
];
// Labels on this token
UpdateLabels labels = 10;
Expand Down
6 changes: 1 addition & 5 deletions proto/metalstack/infra/v2/bmc.proto
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,7 @@ message UpdateBMCInfoRequest {
// Partition is the partition ID where metal-bmc wants to receive events
string partition = 1 [(buf.validate.field).string.(metalstack.api.v2.is_partition) = true];
// BmcReports contains maps the BMC report per machine UUID
map<string, metalstack.api.v2.MachineBMCReport> bmc_reports = 2 [(buf.validate.field).map = {
keys: {
string: {uuid: true}
}
}];
map<string, metalstack.api.v2.MachineBMCReport> bmc_reports = 2 [(buf.validate.field).map = {keys: {string: {uuid: true}}}];
}

// UpdateBMCInfoResponse is the response payload for updating BMC information.
Expand Down
4 changes: 2 additions & 2 deletions python/metalstack/admin/v2/audit_pb2.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions python/metalstack/admin/v2/component_pb2.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading