Skip to content

Commit fb2b7f6

Browse files
author
Leonid Podolinskiy
committed
add test
1 parent 8ad162b commit fb2b7f6

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

internal/controller/lightrunjavaagent_controller_test.go

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package controller
22

33
import (
44
"context"
5+
"fmt"
56
"time"
67

78
agentsv1beta "github.com/lightrun-platform/lightrun-k8s-operator/api/v1beta"
@@ -34,7 +35,13 @@ var _ = Describe("LightrunJavaAgent controller", func() {
3435
agentCliFlags = "--lightrun_extra_class_path=<PATH_TO_JAR>"
3536
)
3637
var containerSelector = []string{"app", "app2"}
37-
var agentConfig map[string]string = map[string]string{"max_log_cpu_cost": "2"}
38+
var agentConfig map[string]string = map[string]string{
39+
"max_log_cpu_cost": "2",
40+
"some_config": "1",
41+
"some_other_config": "2",
42+
"some_yet_another_config": "1",
43+
44+
}
3845
var agentTags []string = []string{"new_tag", "prod"}
3946
var secretData map[string]string = map[string]string{
4047
"LIGHTRUN_KEY": "some_key",
@@ -336,6 +343,11 @@ var _ = Describe("LightrunJavaAgent controller", func() {
336343
return flag == 2
337344
}).Should(BeTrue())
338345
})
346+
It("Should not change hash of the configmap in the deployment metadata", func() {
347+
Eventually(func() bool {
348+
return patchedDepl.Spec.Template.Annotations["lightrun.com/configmap-hash"] == fmt.Sprint(hash(cm.Data["config"]+cm.Data["metadata"]))
349+
}).Should(BeTrue())
350+
})
339351

340352
It("Should add finalizer to first CRD", func() {
341353
Eventually(func() bool {

0 commit comments

Comments
 (0)