Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,9 @@ functions:
input:
key-a: "value-a"
key-b: "value-b"

# ID of the private network to attach the function to
privateNetworkId: "3fd741d4-f686-4afc-bcea-d720c695748f"
```

### Container-specific configuration
Expand Down Expand Up @@ -264,6 +267,9 @@ custom:
# Deprecated: number of simultaneous requests to handle
# Please use scalingOption of type concurrentRequests instead
# maxConcurrency: 20

# ID of the private network to attach the container to
privateNetworkId: "3fd741d4-f686-4afc-bcea-d720c695748f"
```

## Supported commands
Expand Down
8 changes: 8 additions & 0 deletions deploy/lib/createContainers.js
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ module.exports = {
sandbox: container.sandbox,
health_check: adaptHealthCheckToAPI(container.healthCheck),
scaling_option: adaptScalingOptionToAPI(container.scalingOption),
private_network_id: container.privateNetworkId,
};

// checking if there is custom_domains set on container creation.
Expand All @@ -177,6 +178,12 @@ module.exports = {
},

async updateSingleContainer(container, foundContainer) {
let privateNetworkId = container.privateNetworkId;
const hasToDeletePrivateNetwork = foundContainer.private_network_id && !container.privateNetworkId;
if (hasToDeletePrivateNetwork) {
privateNetworkId = "";
}

const params = {
redeploy: false,
environment_variables: container.env,
Expand All @@ -201,6 +208,7 @@ module.exports = {
sandbox: container.sandbox,
health_check: adaptHealthCheckToAPI(container.healthCheck),
scaling_option: adaptScalingOptionToAPI(container.scalingOption),
private_network_id: privateNetworkId,
};

// note about maxConcurrency deprecation
Expand Down
8 changes: 8 additions & 0 deletions deploy/lib/createFunctions.js
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@ Runtime lifecycle doc : https://www.scaleway.com/en/docs/compute/functions/refer
domain_name: func.domain_name,
http_option: func.httpOption,
sandbox: func.sandbox,
private_network_id: func.privateNetworkId,
};

const availableRuntimes = await this.listRuntimes();
Expand All @@ -208,6 +209,12 @@ Runtime lifecycle doc : https://www.scaleway.com/en/docs/compute/functions/refer
},

async updateSingleFunction(func, foundFunc) {
let privateNetworkId = func.privateNetworkId;
const hasToDeletePrivateNetwork = foundFunc.private_network_id && !func.privateNetworkId;
if (hasToDeletePrivateNetwork) {
privateNetworkId = "";
}

const params = {
redeploy: false,
environment_variables: func.env,
Expand All @@ -226,6 +233,7 @@ Runtime lifecycle doc : https://www.scaleway.com/en/docs/compute/functions/refer
domain_name: func.domain_name,
http_option: func.httpOption,
sandbox: func.sandbox,
private_network_id: privateNetworkId,
};

const availableRuntimes = await this.listRuntimes();
Expand Down
Loading