-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support "strongly typed" cloud init documents #8
Comments
Thanks for creating this issue, @negz. I had a similar thought when I was sketching this project out: The thing that gave me hesitation was not knowing if the content could be serialized faithfully, strictly validated, or if there was any benefit over embedding cloud-config as text. If we can't find an official go cloud-config definition, preferably with struct tags, this project might have to become a self-authority on that definition and that could lead to required maintainance to follow up stream changes. An open text field avoids that, and is still permitted through https://github.com/juju/juju/blob/develop/cloudconfig/cloudinit/cloudinit.go |
Taking this one step deeper, one piece of # cloud-config
write_files:
- content: |
{
"exec-opts": ["native.cgroupdriver=systemd"],
"log-driver": "json-file",
"log-opts": {
"max-size": "100m"
},
"storage-driver": "overlay2"
}
path: /etc/docker/daemon.json
- content: foo
path: /root/foo Should a ---
apiVersion: cloudinit.crossplane.io/v1alpha1
kind: Config
metadata:
name: cloudinit
namespace: default
spec:
writeCloudInitToRef:
name: cloudinit
namespace: default
key: cloud-init
forProvider:
boundary: MIMEBOUNDARY
parts:
- configMapKeyRef:
name: foo
namespace: default
key: foo
optional: true
writeFilesPath: /root/foo # or perhaps writeFile or path
# this would construct the following part:
#
# #cloud-config
# write-files:
# - path: /root/foo
# content: foo |
Currently I believe this provider requires the author of a
Config
to pass a cloud-config as opaque data, e.g:Would it be feasible to model (a subset of?) the config document as part of the actual schema? e.g.
The text was updated successfully, but these errors were encountered: