Skip to content
Merged
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
33 changes: 27 additions & 6 deletions doc/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,10 @@ <h2>Table of Contents</h2>
<a href="#metalstack%2fapi%2fv2%2fpredefined_rules.proto-extensions"><span class="badge">X</span>File-level Extensions</a>
</li>

<li>
<a href="#metalstack%2fapi%2fv2%2fpredefined_rules.proto-extensions"><span class="badge">X</span>File-level Extensions</a>
</li>


</ul>
</li>
Expand Down Expand Up @@ -2948,6 +2952,14 @@ <h3 id="metalstack/api/v2/predefined_rules.proto-extensions">File-level Extensio
<td><p>Prefixes validates if a slice of prefixes in string form are valid.</p></td>
</tr>

<tr>
<td>is_base64</td>
<td><a href="#bool">bool</a></td>
<td><a href="#buf.validate.StringRules">.buf.validate.StringRules</a></td>
<td>80048966</td>
<td><p>IsBase64 ensures the given string is base64 encoded</p></td>
</tr>

<tr>
<td>is_description</td>
<td><a href="#bool">bool</a></td>
Expand Down Expand Up @@ -10456,6 +10468,14 @@ <h3 id="metalstack.api.v2.MachineAllocation">MachineAllocation</h3>
<td><p>VPN connection configuration. </p></td>
</tr>

<tr>
<td>placement_labels</td>
<td><a href="#metalstack.api.v2.Labels">Labels</a></td>
<td></td>
<td><p>PlacementLabels by default machines are spread across the racks inside a partition for every project.
if placement labels are provided, the machine candidate has an additional anti-affinity to other machines having the same labels. </p></td>
</tr>

</tbody>
</table>

Expand Down Expand Up @@ -11989,7 +12009,8 @@ <h3 id="metalstack.api.v2.MachineServiceCreateRequest">MachineServiceCreateReque
<td><a href="#string">string</a></td>
<td>optional</td>
<td><p>Userdata contains instructions required to bootstrap the machine.
AWS limits the max userdata size to 16k, lets allow twice as much. </p></td>
AWS limits the max userdata size to 16k, lets allow twice as much.
Must be base64 encoded. </p></td>
</tr>

<tr>
Expand All @@ -12007,11 +12028,11 @@ <h3 id="metalstack.api.v2.MachineServiceCreateRequest">MachineServiceCreateReque
</tr>

<tr>
<td>placement_tags</td>
<td><a href="#string">string</a></td>
<td>repeated</td>
<td><p>PlacementTags by default machines are spread across the racks inside a partition for every project.
if placement tags are provided, the machine candidate has an additional anti-affinity to other machines having the same tags. </p></td>
<td>placement_labels</td>
<td><a href="#metalstack.api.v2.Labels">Labels</a></td>
<td></td>
<td><p>PlacementLabels by default machines are spread across the racks inside a partition for every project.
if placement labels are provided, the machine candidate has an additional anti-affinity to other machines having the same labels. </p></td>
</tr>

<tr>
Expand Down
239 changes: 126 additions & 113 deletions go/metalstack/api/v2/machine.pb.go

Large diffs are not rendered by default.

64 changes: 40 additions & 24 deletions go/metalstack/api/v2/predefined_rules.pb.go

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

21 changes: 18 additions & 3 deletions go/tests/validation/machine_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,19 +64,34 @@ func TestValidateMachine(t *testing.T) {
wantErrorMessage: "validation error: address: must be a valid host (hostname or IP address) and port pair",
},
{
name: "Machine create, userdata with whitespaces",
name: "Machine create, userdata not base64 encoded",
msg: &apiv2.MachineServiceCreateRequest{
Project: "9fdc7bd9-d412-4578-a20f-bf7c03f20135",
Partition: new("partition-1"),
Image: "debian-13",
Name: "testserver",
Userdata: new("asdf"),
Networks: []*apiv2.MachineAllocationNetwork{
{Network: "internet"},
},
},
wantErr: true,
wantErrorMessage: "validation error: userdata: string must be valid base64",
},
{
name: "Machine create, userdata is base64 encoded",
msg: &apiv2.MachineServiceCreateRequest{
Project: "9fdc7bd9-d412-4578-a20f-bf7c03f20135",
Partition: new("partition-1"),
Image: "debian-13",
Userdata: new(" userdata with whitespaces"),
Name: "testserver",
Userdata: new("YXNkZg=="),
Networks: []*apiv2.MachineAllocationNetwork{
{Network: "internet"},
},
},
wantErr: true,
wantErrorMessage: "validation error: userdata: value must not start or end with whitespace",
wantErrorMessage: "validation error: userdata: string must be valid base64",
},
{
name: "Machine create, one ssh public key with whitespaces",
Expand Down
16 changes: 12 additions & 4 deletions js/metalstack/api/v2/machine_pb.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ export type MachineServiceCreateRequest = Message<"metalstack.api.v2.MachineServ
/**
* Userdata contains instructions required to bootstrap the machine.
* AWS limits the max userdata size to 16k, lets allow twice as much.
* Must be base64 encoded.
*
* @generated from field: optional string userdata = 11;
*/
Expand All @@ -149,12 +150,12 @@ export type MachineServiceCreateRequest = Message<"metalstack.api.v2.MachineServ
*/
networks: MachineAllocationNetwork[];
/**
* PlacementTags by default machines are spread across the racks inside a partition for every project.
* if placement tags are provided, the machine candidate has an additional anti-affinity to other machines having the same tags.
* PlacementLabels by default machines are spread across the racks inside a partition for every project.
* if placement labels are provided, the machine candidate has an additional anti-affinity to other machines having the same labels.
*
* @generated from field: repeated string placement_tags = 14;
* @generated from field: metalstack.api.v2.Labels placement_labels = 14;
*/
placementTags: string[];
placementLabels?: Labels | undefined;
/**
* DNSServer the dns servers used for the machine.
*
Expand Down Expand Up @@ -708,6 +709,13 @@ export type MachineAllocation = Message<"metalstack.api.v2.MachineAllocation"> &
* @generated from field: metalstack.api.v2.MachineVPN vpn = 17;
*/
vpn?: MachineVPN | undefined;
/**
* PlacementLabels by default machines are spread across the racks inside a partition for every project.
* if placement labels are provided, the machine candidate has an additional anti-affinity to other machines having the same labels.
*
* @generated from field: metalstack.api.v2.Labels placement_labels = 18;
*/
placementLabels?: Labels | undefined;
};
/**
* Describes the message metalstack.api.v2.MachineAllocation.
Expand Down
2 changes: 1 addition & 1 deletion js/metalstack/api/v2/machine_pb.js

Large diffs are not rendered by default.

19 changes: 14 additions & 5 deletions js/metalstack/api/v2/machine_pb.ts

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions js/metalstack/api/v2/predefined_rules_pb.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,12 @@ export declare const is_project_subject_permission: GenExtension<StringRules, bo
* @generated from extension: optional bool is_machine_subject_permission = 80048965;
*/
export declare const is_machine_subject_permission: GenExtension<StringRules, boolean>;
/**
* IsBase64 ensures the given string is base64 encoded
*
* @generated from extension: optional bool is_base64 = 80048966;
*/
export declare const is_base64: GenExtension<StringRules, boolean>;
/**
* Prefixes validates if a slice of prefixes in string form are valid.
*
Expand Down
Loading
Loading