-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The original example was automatically converted from YAML. Make it a bit more Nickely by making it a more idiomatic partial configuration.
- Loading branch information
Showing
2 changed files
with
36 additions
and
29 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 |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# Example of a non conform Kubernetes resource | ||
let ReplicationController = import "../kubernetes-contracts/v1.29.3/replicationcontroller-v1.ncl" in | ||
|
||
{ | ||
config = { | ||
name = "redis-master", | ||
labels = { app = "redis", role = "master" }, | ||
}, | ||
kubernetes | ReplicationController | ||
= { | ||
apiVersion = "v1", | ||
kind = "ReplicationController", | ||
metadata = { labels = config.labels, name = config.name }, | ||
spec = { | ||
replicas = 1, | ||
selector = config.labels, | ||
template = { | ||
metadata = { labels = config.labels }, | ||
spec.containers = [ | ||
{ | ||
image = "registry.k8s.io/redis:e2e", | ||
name = config.name, | ||
ports = [ | ||
{ | ||
# the error is here: containerPort is a string, but it should be | ||
# an integer | ||
containerPort = "200", | ||
name = config.name, | ||
} | ||
], | ||
} | ||
], | ||
}, | ||
}, | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.