-
Notifications
You must be signed in to change notification settings - Fork 80
implement ContainerConfigFile of ContainerizedWorkload #276
Conversation
ccb3d7c
to
c447fca
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
generally LGTM, please add some yaml examples for demo
ObjectMeta: metav1.ObjectMeta{ | ||
Name: cmName, | ||
Namespace: cw.GetNamespace(), | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please add ownerReference
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
got it. And I will add yaml examples.
} | ||
for _, cm := range configMaps { | ||
// always set the controller reference so that we can watch this configmap and it will be deleted automatically | ||
if err := ctrl.SetControllerReference(workload, cm, r.Scheme); err != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what will happen for this line?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It will append the workload as an ownerRef to the configMap, maybe I should use the deployment instead of workload.
c447fca
to
8702f4d
Compare
maybe we need to add configmap and secret previlige here https://github.com/crossplane/oam-kubernetes-runtime/blob/master/charts/oam-kubernetes-runtime/templates/oam-controller.yaml#L24-L57 |
add e2e-test add unit test Signed-off-by: roy wang <seiwy2010@gmail.com>
8702f4d
to
b52c3d9
Compare
Yes, that's right. And I add configmaps privileges. |
}, | ||
} | ||
// pass through label and annotation from the workload to the configmap | ||
util.PassLabelAndAnnotation(w, cm) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems no need to pass?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If so, I will remove it. The original concern is to stay in line with how the controller handles labels&annotations of other child resources.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ownerReference is a MUST have, the labels and annotations I don't have strong opinion
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A Controller ownerReference is set here
fix #235
Currently, "ContainerConfigFile " of ContainerizedWorkload will be translated to ConfigMap. Afterward, the newly created ConfigMap will be mounted to target Pod through Volume.
If
Config.FromSecret
is specified, it will just mount the target secret through volume instead of using ConfigMap.Signed-off-by: roy wang seiwy2010@gmail.com