-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add functionality to parse multiple prefixes (#35)
This change introduces a new function `multiprefixloop` as a convenience function for splitting multiple cidr prefixes govorned by the number of bits and required offset inside each prefix. This function might be used in instances such as dividing additional VPC cidrs into subnets without requiring multiple instances of the funtion to be declared in a given composition. Additionally this contributes towards issue #2 by introducing happy path unit tests for each function.
- Loading branch information
Showing
14 changed files
with
887 additions
and
126 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,8 +1,12 @@ | ||
render: | ||
@for file in examples/xr-*.yaml; do \ | ||
echo ""; \ | ||
echo "Rendering $$file..."; \ | ||
crossplane beta render \ | ||
"$$file" \ | ||
apis/composition.yaml \ | ||
examples/functions.yaml; \ | ||
done | ||
|
||
debug: | ||
go run . --insecure --debug |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,4 +7,3 @@ spec: | |
cidrFunc: cidrhost | ||
cidrBlock: 10.0.0.0/20 | ||
hostNum: 111 | ||
output: status.atFunction.cidr.hostAddress |
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 |
---|---|---|
|
@@ -6,4 +6,3 @@ spec: | |
parameters: | ||
cidrFunc: cidrnetmask | ||
cidrBlock: 172.16.0.0/12 | ||
output: status.atFunction.cidr.netmask |
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 |
---|---|---|
|
@@ -9,4 +9,3 @@ spec: | |
newBits: | ||
- 8 | ||
netNum: 3 | ||
output: status.atFunction.cidr.subnet-a |
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,20 @@ | ||
apiVersion: platform.upbound.io/v1alpha1 | ||
kind: XCIDR | ||
metadata: | ||
name: cidr-multiprefixloop | ||
spec: | ||
parameters: | ||
cidrFunc: multiprefixloop | ||
subnets: | ||
- prefix: 10.0.0.0/20 | ||
newBits: | ||
- 8 | ||
- 4 | ||
- 2 | ||
- prefix: 127.0.0.0/20 | ||
newBits: [ | ||
4, 4, 4, | ||
4, 4, 4, | ||
5, 5, 5, | ||
5, 5, 5, | ||
] |
Oops, something went wrong.