Commit 8665453
authored
Reset the object status after patching resource metadata & spec. (#48)
Description of changes:
* Introduces a new `DeepCopy` method in AWSResource interface
* After the fixes made in release v0.12.0, the status of latest object was getting modified during PatchMetadataAndSpec call.
* The problem was surfaced in one of the test in SageMaker that rely on waiting on Status.Condition.
* Since the condition was being reset by the PatchMetadataAndSpec call, the test was never passing.
* I tried multiple things like
(a) Passing empty status in the base parameter during `kc.Patch()` call, but the `kc.Patch` call resets the status by reading it from etcd.
* At this point, to understand this problem more, I will have to deep dive into kc.Patch source code.
* To unblock sagemaker team from developing their controller, I propose the change in following PR which is safe and unblocks the team.
* It is some redundant work in copying the status again but hopefully when we understand the `kc.Patch` operation better, we can improve on it.
* I have tested with sagemaker e2e that following solution works.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.1 parent a506412 commit 8665453
File tree
4 files changed
+29
-0
lines changed- mocks/pkg/types
- pkg
- runtime
- types
4 files changed
+29
-0
lines changedSome generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
403 | 403 | | |
404 | 404 | | |
405 | 405 | | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
406 | 409 | | |
407 | 410 | | |
408 | 411 | | |
409 | 412 | | |
410 | 413 | | |
| 414 | + | |
| 415 | + | |
411 | 416 | | |
| 417 | + | |
412 | 418 | | |
413 | 419 | | |
414 | 420 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
74 | 74 | | |
75 | 75 | | |
76 | 76 | | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
77 | 80 | | |
78 | 81 | | |
79 | 82 | | |
| |||
244 | 247 | | |
245 | 248 | | |
246 | 249 | | |
| 250 | + | |
| 251 | + | |
247 | 252 | | |
248 | 253 | | |
249 | 254 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
| 60 | + | |
| 61 | + | |
60 | 62 | | |
0 commit comments