PWX-30230 : Create all px configmaps in same namespace as portworx#314
PWX-30230 : Create all px configmaps in same namespace as portworx#314nikita-bhatia wants to merge 9 commits intomasterfrom
Conversation
Signed-off-by: Nikita Bhatia <nbhatia@purestorage.com>
73ac0bd to
43ed92d
Compare
Signed-off-by: Nikita Bhatia <nbhatia@purestorage.com>
Signed-off-by: Nikita Bhatia <nbhatia@purestorage.com>
Signed-off-by: Divyam Goel <dgoel@purestorage.com> Signed-off-by: Nikita Bhatia <nbhatia@purestorage.com>
Signed-off-by: Divyam Goel <dgoel@purestorage.com> Signed-off-by: Nikita Bhatia <nbhatia@purestorage.com>
Signed-off-by: Divyam Goel <dgoel@purestorage.com> Signed-off-by: Nikita Bhatia <nbhatia@purestorage.com>
a6a27b4 to
8a2b586
Compare
Signed-off-by: Nikita Bhatia <nbhatia@purestorage.com>
Signed-off-by: Nikita Bhatia <nbhatia@purestorage.com>
| }, | ||
| Data: data, | ||
| if c.pxNs == c.config.nameSpace { | ||
| //fresh install ot upgrade completed |
| name, err) | ||
| } | ||
| existingConfig := c.config | ||
| c.copylock.Lock(uuid.New().String()) |
There was a problem hiding this comment.
The parameter to Lock is the owner. It should be the node ID. If you generate a new UUID everytime, we wouldn't know from the logs who is holding it.
| log.Errorf("Error during fetching data from copy lock %s", err) | ||
| return existingConfig | ||
| } | ||
| status := lockMap[upgradeCompletedStatus] |
There was a problem hiding this comment.
Can we explicitly have a check for non existence ?
status, ok :=
| maxConflictRetries = 3 | ||
| upgradeCompletedStatus = "UPGRADE_DONE" | ||
| trueString = "true" | ||
| falseString = "false" |
There was a problem hiding this comment.
nit: falseString doesn't seem to be used anywhere. Remove?
| } | ||
| cm, err := New("px-configmaps-test", configData, lockTimeout, 5, 0, 0) | ||
| cm, err := New("px-configmaps-test", configData, lockTimeout, 5, 0, 0, "test-ns") | ||
| fmt.Println("cm : ", cm) |
There was a problem hiding this comment.
was this for dev debugging? Remove?
| return existingConfig | ||
| } | ||
| status := lockMap[upgradeCompletedStatus] | ||
| if status == trueString { |
There was a problem hiding this comment.
How are we handling IN_PROGRESS state.
Let's say N1 is doing the copy. At the same time N2 is trying to update some value usingUpdate() function. According to this implementation, on N2 existingConfig will be returned and could be updating while N1 could be deleting the whole configmap at line 52. Don't we need to wait if a copy is IN_PROGRESS?
|
Can you add testing information. Also share a testplan. This one will need to tested well. Would prefer to have it all documented in testrail. |
https://portworx.atlassian.net/browse/PWX-30230
This PR is for migration of namespace from 'kube-system' to 'portworx'. To support this,
Logic to update copylock config map entry once upgrade is finished will be handled in porx code.