Provider image substitution#29
Conversation
| var ( | ||
| // commonControllerNamingSubstringPattern contains a substring which all CCM controller container names should have | ||
| // to be substituted with image from config | ||
| commonControllerNamingSubstringPattern = "controller" |
There was a problem hiding this comment.
I think the pattern here is good, might be better to use something explicit though, eg, if we have a list of predefined allowed values cloud-controller-manager, node-controller-manager etc that the manifests must obide by? WDYT?
There was a problem hiding this comment.
We need some sort of CI task which will check that only those names are on containers and other subresources all the time.
| for i, objectTemplate := range templates { | ||
| templateCopy := objectTemplate | ||
|
|
||
| // Set namespaces for all object. Namespace on cluster-wide objects is stripped by API server and is not applied |
ef0f516 to
26457f0
Compare
|
/test e2e-openstack |
26457f0 to
8ad70be
Compare
JoelSpeed
left a comment
There was a problem hiding this comment.
I think we need to clean this up a bit before we merge. I'm concerned about the side effects of some of the functions and also premature optimisations we are making. Let's keep the code clean now and worry about future changes later when we get to that point
8c032ed to
96f8c01
Compare
JoelSpeed
left a comment
There was a problem hiding this comment.
In general, would be good to see some more unit testing for the methods we are adding here. There are lots of small parts (which is good!) but at the moment their functionality is only tested as a whole. If we introduce more scoped down unit testing this will help us to prove that individual functions are doing what we are intending them to do and in the long run will help identifying bugs (add test cases to specific functions and check the outputs)
4f18105 to
c7c1fcb
Compare
|
/retest |
2 similar comments
|
/retest |
|
/retest |
|
https://prow.ci.openshift.org/view/gs/origin-ci-test/pr-logs/pull/openshift_cluster-cloud-controller-manager-operator/29/pull-ci-openshift-cluster-cloud-controller-manager-operator-master-e2e-aws-ccm/1386857755955957760 passed CI, will record it here as planing to address missed comment. |
JoelSpeed
left a comment
There was a problem hiding this comment.
Couple of nits but otherwise LGTM
c3ed167 to
ee4773e
Compare
ee4773e to
6484d5c
Compare
JoelSpeed
left a comment
There was a problem hiding this comment.
/approve
Thanks Danil, looks great!
|
/retetst |
elmiko
left a comment
There was a problem hiding this comment.
this mostly makes sense to me, i have a couple questions though
| type imagesReference struct { | ||
| CloudControllerManagerAWS string `json:"cloudControllerManagerAWS"` | ||
| CloudControllerManagerOpenStack string `json:"cloudControllerManagerOpenStack"` | ||
| } |
There was a problem hiding this comment.
i'm just curious, will a cluster ever use multiple images from this reference?
There was a problem hiding this comment.
Yes, this is possible, there is definitely going to be a kube-rbac-proxy image here once we will start investigating metrics support.
| } | ||
|
|
||
| func getImagesFromJSONFile(filePath string) (imagesReference, error) { | ||
| data, err := ioutil.ReadFile(filepath.Clean(filePath)) |
There was a problem hiding this comment.
are these file paths loaded as volume mounts in the container?
There was a problem hiding this comment.
Yes, they are loaded from a mounted config map introduced in #31
6484d5c to
f2de5dc
Compare
elmiko
left a comment
There was a problem hiding this comment.
looking mostly good Danil, i have one small suggestion and a question about the tests
a153b4f to
e2a53a0
Compare
|
@Danil-Grigorev: The following test failed, say
Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: elmiko, JoelSpeed The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
/retest Please review the full test history for this PR and help us cut down flakes. |
1 similar comment
|
/retest Please review the full test history for this PR and help us cut down flakes. |
This PR allows operator to dynamically configure image in provisioned resources such as CCM Deployment.
This is done based on assumption that every CCM controller will be in a named container containing
controllersubstring in it's name. All those containers images will be managed by operator, others will remain unchanged from initial manifest.Operator is now populating Namespace for each resource it provisions. Cluster-scoped resources are also getting this namespace value, which is ok as it is not accounted and is not stored by API server on apply. This allows two operators to manage equivalent set of resources in different namespaces without clashes.