kedacore / keda

KEDA is a Kubernetes-based Event Driven Autoscaling component. It provides event driven scale for any container running in Kubernetes
https://keda.sh
Apache License 2.0
8.48k stars 1.07k forks source link

Intermittent failures in TestHashicorpVaultHandler_ResolveSecrets_SameCertAndKey #5702

Open SaschaSchwarze0 opened 6 months ago

SaschaSchwarze0 commented 6 months ago

Report

We are compiling our own version of Keda and see errors when running make test that started to happen with Go 1.22.

The test case that fails is TestHashicorpVaultHandler_ResolveSecrets_SameCertAndKey.

Our analysis so far is the following:

=== RUN   TestHashicorpVaultHandler_ResolveSecrets_SameCertAndKey
len: 2, grouped: map[{pki/issue/default pki 0xc0004f4280}:[{certificate pki/issue/default certificate pki {test      } }] {pki/issue/default pki 0xc0004f4400}:[{certificate pki/issue/default certificate pki {test      } }]]
    hashicorpvault_handler_test.go:436:
                Error Trace:    .../keda/pkg/scaling/resolver/hashicorpvault_handler_test.go:436
                Error:          Not equal:
                                expected: "-----BEGIN CERTIFICATE-----\nmzx6wnt8rgZwre5gMXubAI3JJXLjaWqlPNu7-ZGymwZ0JTTSf4_YxFc0MpQ-i5k-CQ\n-----END CERTIFICATE-----"
                                actual  : "-----BEGIN CERTIFICATE-----\nBkZA-zHp12bzMIFl-rvnh3lVO5wS7MN_PQrpM_dMpPGBptY9iOYh5qcjS1_2Npm_zQ\n-----END CERTIFICATE-----"

                                Diff:
                                --- Expected
                                +++ Actual
                                @@ -1,3 +1,3 @@
                                 -----BEGIN CERTIFICATE-----
                                -mzx6wnt8rgZwre5gMXubAI3JJXLjaWqlPNu7-ZGymwZ0JTTSf4_YxFc0MpQ-i5k-CQ
                                +BkZA-zHp12bzMIFl-rvnh3lVO5wS7MN_PQrpM_dMpPGBptY9iOYh5qcjS1_2Npm_zQ
                                 -----END CERTIFICATE-----
                Test:           TestHashicorpVaultHandler_ResolveSecrets_SameCertAndKey
                Messages:       Refetching same path should yield same value

We are wondering whether a struct with a "fresh" pointer to structs that contain the same values but are different structs, are really equal, or if maybe the new Go 1.22 behavior on for-range loops is hitting here.

Expected Behavior

make test to pass

Actual Behavior

It fails for us on Go 1.22

Steps to Reproduce the Problem

  1. Use Go 1.22
  2. run make test

Logs from KEDA operator

N/A

KEDA Version

2.13.1

Kubernetes Version

None

Platform

None

Scaler Details

No response

Anything else?

No response

stale[bot] commented 4 months ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions.

HeavyWombat commented 4 months ago

Would like to hear some feedback on the report. Did someone have a chance to look into it? Maybe @loispostula, could you have a glance? Thanks in advance.

stale[bot] commented 2 months ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions.

HeavyWombat commented 2 months ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions.

I would still be interested in some feedback regarding the original finding/question.

zroubalik commented 1 month ago

Interesting finding, I think that we should treat equal values as equal. Are you willing to contribute a fix? Thanks!