-
Notifications
You must be signed in to change notification settings - Fork 306
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Upgrade cuelang parser to 0.4.0 (#572)
Signed-off-by: John Reese <[email protected]>
- Loading branch information
Showing
10 changed files
with
59 additions
and
83 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
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 was deleted.
Oops, something went wrong.
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,25 +1,23 @@ | ||
package main | ||
|
||
name = input.deployment[_] | ||
|
||
deny[msg] { | ||
not name.apiVersion = "apps/v1" | ||
msg = sprintf("Api Version must be apps/v1 in : %s", [name]) | ||
not input.apiVersion = "apps/v1" | ||
msg = sprintf("apiVersion must be apps/v1 in : %s", [input.metadata.name]) | ||
} | ||
|
||
deny[msg] { | ||
repl := name.spec.replicas | ||
repl < 3 | ||
msg = sprintf("Replica count must be higher than 3, you have : %d", [repl]) | ||
repl := input.spec.replicas | ||
repl < 2 | ||
msg = sprintf("Replica count must be greater than 2, you have : %d", [repl]) | ||
} | ||
|
||
deny[msg] { | ||
ports := name.spec.template.spec.containers[_].ports[_].containerPort | ||
ports := input.spec.template.spec.containers[_].ports[_].containerPort | ||
not ports = 8080 | ||
msg = sprintf("The image port should be 8080 in deployment.cue. you got : %d", [ports]) | ||
msg = sprintf("The image port should be 8080 in deployment.cue. you have : %d", [ports]) | ||
} | ||
|
||
deny[msg] { | ||
endswith(name.spec.template.spec.containers[_].image, ":latest") | ||
endswith(input.spec.template.spec.containers[_].image, ":latest") | ||
msg = "No images tagged latest" | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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