-
Notifications
You must be signed in to change notification settings - Fork 18
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
PWX-30230 : Create all px configmaps in same namespace as portworx #314
base: master
Are you sure you want to change the base?
Conversation
Signed-off-by: Nikita Bhatia <[email protected]>
73ac0bd
to
43ed92d
Compare
Signed-off-by: Nikita Bhatia <[email protected]>
Signed-off-by: Nikita Bhatia <[email protected]>
Signed-off-by: Divyam Goel <[email protected]> Signed-off-by: Nikita Bhatia <[email protected]>
Signed-off-by: Divyam Goel <[email protected]> Signed-off-by: Nikita Bhatia <[email protected]>
Signed-off-by: Divyam Goel <[email protected]> Signed-off-by: Nikita Bhatia <[email protected]>
a6a27b4
to
8a2b586
Compare
Signed-off-by: Nikita Bhatia <[email protected]>
Signed-off-by: Nikita Bhatia <[email protected]>
}, | ||
Data: data, | ||
if c.pxNs == c.config.nameSpace { | ||
//fresh install ot upgrade completed |
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.
nit: .. or.. ?
name, err) | ||
} | ||
existingConfig := c.config | ||
c.copylock.Lock(uuid.New().String()) |
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.
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.
} | ||
status := lockMap[upgradeCompletedStatus] |
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: falseString doesn't seem to be used anywhere. Remove?
@@ -17,7 +17,8 @@ func TestGetConfigMap(t *testing.T) { | |||
configData := map[string]string{ | |||
"key1": "val1", | |||
} | |||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
was this for dev debugging? Remove?
} | ||
status := lockMap[upgradeCompletedStatus] | ||
if status == trueString { |
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.
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.