Skip to content

Commit

Permalink
review changes
Browse files Browse the repository at this point in the history
Signed-off-by: Kavindu Dodanduwa <kavindudodanduwa@gmail.com>
  • Loading branch information
Kavindu-Dodan committed Mar 2, 2023
1 parent 4f01565 commit 4f551fc
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 3 deletions.
4 changes: 2 additions & 2 deletions pkg/sync/kubernetes/kubernetes_sync.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"fmt"
"os"
"strings"
parallel "sync"
msync "sync"
"time"

"github.com/open-feature/flagd/pkg/logger"
Expand Down Expand Up @@ -104,7 +104,7 @@ func (k *Sync) Sync(ctx context.Context, dataSync chan<- sync.DataSync) error {

notifies := make(chan INotify)

var wg parallel.WaitGroup
var wg msync.WaitGroup

// Start K8s resource notifier
wg.Add(1)
Expand Down
20 changes: 19 additions & 1 deletion pkg/sync/kubernetes/kubernetes_sync_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ func Test_updateFuncHandler(t *testing.T) {
wantEvent: false,
},
{
name: "Simple error - API version mismatch",
name: "Simple error - API version mismatch new object",
args: args{
oldObj: toUnstructured(t, validFFCfgOld),
newObj: toUnstructured(t, v1alpha1.FeatureFlagConfiguration{
Expand All @@ -304,6 +304,24 @@ func Test_updateFuncHandler(t *testing.T) {
wantErr: true,
wantEvent: false,
},
{
name: "Simple error - API version mismatch old object",
args: args{
oldObj: toUnstructured(t, v1alpha1.FeatureFlagConfiguration{
TypeMeta: v1.TypeMeta{
Kind: "FeatureFlagConfiguration",
APIVersion: "someAPIVersion",
},
}),
newObj: toUnstructured(t, validFFCfgNew),
object: client.ObjectKey{
Namespace: cfgNs,
Name: cfgName,
},
},
wantErr: true,
wantEvent: false,
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
Expand Down

0 comments on commit 4f551fc

Please sign in to comment.