-
Notifications
You must be signed in to change notification settings - Fork 351
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
Compute digest of configmap and secret from its data #5115
Conversation
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.
Have you tested against the issued sample reported? I am not entirely sure the reason of the behavior is how we calculate digest.
I think it tries to compute digest of configmap from memory address: (digest.go)
I observed (in build_kit.go) before cm.yaml configmap is loaded, After adding debugging notes:
I tried it against both 5115 and config_reload_test.go. |
I observe if configmap is created without the ownerReference part (ie. order of creation is 1. configmap, 2. integration) there isn't the memory reference and the case 5115 doesn't appear:
|
A part the validate check failure, the rest seems good. However, I think it would be convenient to have some unit test to cover the scenarios we're trying to fix. |
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.
Thanks for the test. However I was meaning more a controller test in order to verify that, when an Integration is provided with the owner reference, then, it is moving correctly among the different phases. Let me make an example. You have the Integration with the configmap in the mount trait spec, this configmap has the owner reference and you verify the controller as it happens for instance in this test:
func TestCamelImportDeployment(t *testing.T) { |
pkg/util/digest/digest.go
Outdated
@@ -183,7 +183,7 @@ func ComputeForIntegration(integration *v1.Integration, configmaps []*corev1.Con | |||
//StringData with sorted keys | |||
if s.StringData != 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.
Stringdata should be avoided as Kubernetes will translate all those value in the correspondent base64 in data
. You can remove this part entirely.
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.
Thank you for info; also I am not sure if there shouldn't be also binaryData
included in digest computation in case of Configmap
...
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.
BinaryData for CM would be required as well.
✔️ Unit test coverage report - coverage increased from 35.6% to 35.7% (+0.1%) |
|
@lfabriko any reason why you removed the |
Sure, I thought I should replace it by e2e test. |
✔️ Unit test coverage report - coverage increased from 35.6% to 35.7% (+0.1%) |
✔️ Unit test coverage report - coverage increased from 35.6% to 35.7% (+0.1%) |
I observe failed |
I've restarted the check, maybe it's a flaky one. Please, have a look at the validate error. Locally you can |
adb7426
to
6f0d775
Compare
Validation via |
✔️ Unit test coverage report - coverage increased from 35.6% to 35.8% (+0.2%) |
I observe failed tests |
Proposal of fix to #5114 - use Name, Namespace and Data/StringData to compute digest of Configmap and Secret.