Skip to content

Commit

Permalink
Do not reuse the same variable to get trial/license secrets
Browse files Browse the repository at this point in the history
  • Loading branch information
thbkrkr committed Nov 15, 2021
1 parent 8695d44 commit 2fc885d
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions pkg/controller/license/trial/trial_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,13 +122,14 @@ func TestReconcileTrials_Reconcile(t *testing.T) {
}

requireValidTrial := func(c k8s.Client) {
var sec corev1.Secret
var trialLicenseSecret corev1.Secret
require.NoError(t, c.Get(context.Background(), trialLicenseNsn, &trialLicenseSecret))
var trialStatusSecret corev1.Secret
require.NoError(t, c.Get(context.Background(), types.NamespacedName{
Namespace: testNs,
Name: licensing.TrialStatusSecretKey,
}, &sec))
require.NoError(t, c.Get(context.Background(), trialLicenseNsn, &sec))
pubKeyBytes := sec.Data[licensing.TrialPubkeyKey]
}, &trialStatusSecret))
pubKeyBytes := trialStatusSecret.Data[licensing.TrialPubkeyKey]
key, err := licensing.ParsePubKey(pubKeyBytes)
require.NoError(t, err)
_, lic, err := licensing.TrialLicense(c, trialLicenseNsn)
Expand Down

0 comments on commit 2fc885d

Please sign in to comment.