INNER CODE UNIT · Go
TestConfigIsDisabled
fluxcd/flagger · pkg/canary/config_tracker_test.go:32
func TestConfigIsDisabled(t *testing.T) {
for _, c := range []struct {
annotations map[string]string
exp bool
}{
{annotations: map[string]string{configTrackingDisabledAnnotationKey: "disable"}, exp: true},
{annotations: map[string]string{"app": "disable"}, exp: false},
{annotations: map[string]string{}, exp: false},
} {
assert.Equal(t, configIsDisabled(c.annotations), c.exp)
}
}
func TestConfigTracker_ConfigMaps(t *testing.T) {
t.Run("deployment", func(t *testing.T) {
dc := deploymentConfigs{name: "podinfo", label: "name", labelValue: "podinfo"}
mocks := newDeploymentFixture(dc)
configMap := newDeploymentControllerTestConfigMap()