Skip to content

Commit 038fc8a

Browse files
feat(blueprint): Set cilium network policy on blueprint build (#7006)
1 parent fcc267a commit 038fc8a

5 files changed

Lines changed: 49 additions & 9 deletions

File tree

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 103
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-8ebd9dbfacb180ec9c980f5e46a814b0c8a3cb6063136db18780271d33a8dfa6.yml
3-
openapi_spec_hash: 12d4edec72b722945bade9419636d63e
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-eac4defbf39825fa88e0be11955be80cd004bcea46398be52f79800570539be0.yml
3+
openapi_spec_hash: d18585a489895642807922dfa558226d
44
config_hash: ec63e62d4660c9c924b39a8671c2fdb1

src/resources/blueprints.ts

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,12 @@ export interface BlueprintBuildFromInspectionParameters {
251251
*/
252252
metadata?: { [key: string]: string } | null;
253253

254+
/**
255+
* (Optional) ID of the network policy to apply during blueprint build. This
256+
* restricts network access during the build process.
257+
*/
258+
network_policy_id?: string | null;
259+
254260
/**
255261
* (Optional) Map of mount IDs/environment variable names to secret names. Secrets
256262
* can be used as environment variables in system_setup_commands. Example:
@@ -348,6 +354,15 @@ export interface BlueprintBuildParameters {
348354
*/
349355
metadata?: { [key: string]: string } | null;
350356

357+
/**
358+
* (Optional) ID of the network policy to apply during blueprint build. This
359+
* restricts network access during the build process. This does not affect devboxes
360+
* created from this blueprint; if you want devboxes created from this blueprint to
361+
* inherit the network policy, set the network_policy_id on the blueprint launch
362+
* parameters.
363+
*/
364+
network_policy_id?: string | null;
365+
351366
/**
352367
* (Optional) Map of mount IDs/environment variable names to secret names. Secrets
353368
* will be available to commands during the build. Secrets are NOT stored in the
@@ -657,6 +672,15 @@ export interface BlueprintCreateParams {
657672
*/
658673
metadata?: { [key: string]: string } | null;
659674

675+
/**
676+
* (Optional) ID of the network policy to apply during blueprint build. This
677+
* restricts network access during the build process. This does not affect devboxes
678+
* created from this blueprint; if you want devboxes created from this blueprint to
679+
* inherit the network policy, set the network_policy_id on the blueprint launch
680+
* parameters.
681+
*/
682+
network_policy_id?: string | null;
683+
660684
/**
661685
* (Optional) Map of mount IDs/environment variable names to secret names. Secrets
662686
* will be available to commands during the build. Secrets are NOT stored in the
@@ -782,6 +806,12 @@ export interface BlueprintCreateFromInspectionParams {
782806
*/
783807
metadata?: { [key: string]: string } | null;
784808

809+
/**
810+
* (Optional) ID of the network policy to apply during blueprint build. This
811+
* restricts network access during the build process.
812+
*/
813+
network_policy_id?: string | null;
814+
785815
/**
786816
* (Optional) Map of mount IDs/environment variable names to secret names. Secrets
787817
* can be used as environment variables in system_setup_commands. Example:
@@ -862,6 +892,15 @@ export interface BlueprintPreviewParams {
862892
*/
863893
metadata?: { [key: string]: string } | null;
864894

895+
/**
896+
* (Optional) ID of the network policy to apply during blueprint build. This
897+
* restricts network access during the build process. This does not affect devboxes
898+
* created from this blueprint; if you want devboxes created from this blueprint to
899+
* inherit the network policy, set the network_policy_id on the blueprint launch
900+
* parameters.
901+
*/
902+
network_policy_id?: string | null;
903+
865904
/**
866905
* (Optional) Map of mount IDs/environment variable names to secret names. Secrets
867906
* will be available to commands during the build. Secrets are NOT stored in the

src/resources/devboxes/devboxes.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -821,6 +821,11 @@ export interface DevboxView {
821821
*/
822822
name?: string | null;
823823

824+
/**
825+
* The network policy ID used to create the Devbox.
826+
*/
827+
network_policy_id?: string | null;
828+
824829
/**
825830
* The shutdown reason if the Devbox shutdown, if the Devbox has a 'shutdown'
826831
* status.
@@ -960,12 +965,6 @@ export interface DevboxCreateParams {
960965
*/
961966
name?: string | null;
962967

963-
/**
964-
* (Optional) ID of the network policy to apply to this Devbox. If not specified,
965-
* the default network policy will be used.
966-
*/
967-
network_policy_id?: string | null;
968-
969968
/**
970969
* Repository connection id the devbox should source its base image from.
971970
*/

tests/api-resources/blueprints.test.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ describe('resource blueprints', () => {
5252
user_parameters: { uid: 0, username: 'username' },
5353
},
5454
metadata: { foo: 'string' },
55+
network_policy_id: 'network_policy_id',
5556
secrets: { foo: 'string' },
5657
services: [
5758
{
@@ -195,6 +196,7 @@ describe('resource blueprints', () => {
195196
user_parameters: { uid: 0, username: 'username' },
196197
},
197198
metadata: { foo: 'string' },
199+
network_policy_id: 'network_policy_id',
198200
secrets: { foo: 'string' },
199201
system_setup_commands: ['string'],
200202
});
@@ -293,6 +295,7 @@ describe('resource blueprints', () => {
293295
user_parameters: { uid: 0, username: 'username' },
294296
},
295297
metadata: { foo: 'string' },
298+
network_policy_id: 'network_policy_id',
296299
secrets: { foo: 'string' },
297300
services: [
298301
{

tests/api-resources/devboxes/devboxes.test.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,6 @@ describe('resource devboxes', () => {
6969
},
7070
],
7171
name: 'name',
72-
network_policy_id: 'network_policy_id',
7372
repo_connection_id: 'repo_connection_id',
7473
secrets: { foo: 'string' },
7574
snapshot_id: 'snapshot_id',

0 commit comments

Comments
 (0)