Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Alejandro Moreno <amorenoc@vmware.com>
Signed-off-by: josvaz <josvaz@vmware.com>
Signed-off-by: Jose Luis Vazquez Gonzalez <josvaz@vmware.com>
  • Loading branch information
josvaz and alemorcuq committed Mar 6, 2023
1 parent 3cebdeb commit 1e03569
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion helm/sealed-secrets/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ secretName: "sealed-secrets-key"
## @param updateStatus Specifies whether the Sealed Secrets controller should update the status subresource
##
updateStatus: true
## @param skip-recreate Specifies whether the Sealed Secrets controller should skip recreating removed secrets
## @param skipRecreate Specifies whether the Sealed Secrets controller should skip recreating removed secrets
## Setting it to false allows to optionally restore backward compatibility in low priviledge
## environments when old versions of the controller did not require watch permissions on secrets
## for secret re-creation.
Expand Down
30 changes: 15 additions & 15 deletions pkg/controller/controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,34 +60,34 @@ func TestDefaultConfigDoesNotSkipRecreate(t *testing.T) {
ssc := ssfake.NewSimpleClientset()
keyRegistry := testKeyRegister(t, context.Background(), clientset, ns)

ctrl, got := prepareController(clientset, ns, tweakopts, &Flags{SkipRecreate: false}, ssc, keyRegistry)
if got != nil {
t.Fatalf("got %v want %v", got, nil)
got, err := prepareController(clientset, ns, tweakopts, &Flags{SkipRecreate: false}, ssc, keyRegistry)
if err != nil {
t.Fatalf("err %v want %v", got, nil)
}
if ctrl == nil {
t.Fatalf("ctrl %v want non nil", ctrl)
if got == nil {
t.Fatalf("ctrl %v want non nil", got)
}
if ctrl.sInformer == nil {
t.Fatalf("sInformer %v want non nil", ctrl.sInformer)
if got.sInformer == nil {
t.Fatalf("sInformer %v want non nil", got.sInformer)
}
}

func TestSkipReleaseConfigDoesSkipIt(t *testing.T) {
func TestSkipRecreateConfigDoesSkipIt(t *testing.T) {
ns := "some-namespace"
var tweakopts func(*metav1.ListOptions)
clientset := fake.NewSimpleClientset()
ssc := ssfake.NewSimpleClientset()
keyRegistry := testKeyRegister(t, context.Background(), clientset, ns)

ctrl, got := prepareController(clientset, ns, tweakopts, &Flags{SkipRecreate: true}, ssc, keyRegistry)
if got != nil {
t.Fatalf("got %v want %v", got, nil)
got, err := prepareController(clientset, ns, tweakopts, &Flags{SkipRecreate: true}, ssc, keyRegistry)
if err != nil {
t.Fatalf("err %v want %v", got, nil)
}
if ctrl == nil {
t.Fatalf("ctrl %v want non nil", ctrl)
if got == nil {
t.Fatalf("ctrl %v want non nil", got)
}
if ctrl.sInformer != nil {
t.Fatalf("sInformer %v want nil", ctrl.sInformer)
if got.sInformer != nil {
t.Fatalf("sInformer %v want nil", got.sInformer)
}
}

Expand Down

0 comments on commit 1e03569

Please sign in to comment.