Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
related to #697 `k8s.io/*` bundle to `v0.22.2` (controller-gen tool makes changes in CRD description after bump) - `github.com/golang/mock` to `v1.6.0` (is not compiled into final binary but checked by dependabot) - `github.com/miekg/dns` to `v1.1.43` - `github.com/infobloxopen/infoblox-go-client` to `v1.1.1` (changes argument CreateTXTRecord from integer to uint) - `sigs.k8s.io/controller-runtime` to `v0.10.2`, had to fix the test, see comment below. - `sigs.k8s.io/external-dns` is problematic in terms it uses latest `github.com/go-logr/logr` which is incompatible with previous versions. Will be part of followup PR Controller-runtime works on copies of annotations rather than their pointers, so I had to modify the test. ```go func TestGslbProperlyPropagatesAnnotationDownToIngress(t *testing.T) { // arrange settings := provideSettings(t, predefinedConfig) expectedAnnotations := map[string]string{"annotation": "test"} settings.gslb.Annotations = expectedAnnotations err := settings.client.Update(context.TODO(), settings.gslb) require.NoError(t, err, "Can't update gslb") // act reconcileAndUpdateGslb(t, settings) err2 := settings.client.Get(context.TODO(), settings.request.NamespacedName, settings.ingress) // assert assert.NoError(t, err2, "Failed to get expected ingress") assert.Equal(t, expectedAnnotations, settings.ingress.Annotations) } ``` If I extend fial assertion the passing test is doing this: ```go assert.Equal(t, map[string]string{"annotation": "test", "k8gb.io/strategy": "roundRobin"}, settings.ingress.Annotations) assert.Equal(t, map[string]string{"annotation": "test", "k8gb.io/strategy": "roundRobin"}, settings.gslb.Annotations) assert.Equal(t, map[string]string{"annotation": "test", "k8gb.io/strategy": "roundRobin"}, expectedAnnotations) ``` The `"k8gb.io/strategy": "roundRobin"` is added to `expectedAnnotations` during `reconcileAndUpdateGslb` and controlle-runtime is the guy which extends `expectedAnnotations`. I bumped controller runtime to `v0.10.2`, and only this concrete test has to be updated, because expectedAnnotations are not altered within controller-runtime: ```go assert.Equal(t, map[string]string{"annotation": "test", "k8gb.io/strategy": "roundRobin"}, settings.ingress.Annotations) assert.Equal(t, map[string]string{"annotation": "test", "k8gb.io/strategy": "roundRobin"}, settings.gslb.Annotations) assert.Equal(t, map[string]string{"annotation": "test"}, expectedAnnotations) ``` Signed-off-by: kuritka <kuritka@gmail.com>
- Loading branch information