File tree Expand file tree Collapse file tree 3 files changed +18
-1
lines changed Expand file tree Collapse file tree 3 files changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -33,7 +33,7 @@ import (
3333)
3434
3535const (
36- createGenericVMClassHookName = "Create generic VirtualMachineClass "
36+ createGenericVMClassHookName = "Create module steate secret "
3737 moduleStateSecretSnapshot = "module-state-secret"
3838 vmClassSnapshot = "vmclass-generic"
3939
@@ -71,6 +71,12 @@ var config = &pkg.HookConfig{
7171 NameSelector : & pkg.NameSelector {
7272 MatchNames : []string {genericVMClassName },
7373 },
74+ LabelSelector : & metav1.LabelSelector {
75+ MatchLabels : map [string ]string {
76+ "app" : "virtualization-controller" ,
77+ "module" : settings .ModuleName ,
78+ },
79+ },
7480 ExecuteHookOnSynchronization : ptr .To (false ),
7581 },
7682 },
@@ -112,6 +118,7 @@ func Reconcile(_ context.Context, input *pkg.HookInput) error {
112118 ObjectMeta : metav1.ObjectMeta {
113119 Name : genericVMClassName ,
114120 Labels : map [string ]string {
121+ "app" : "virtualization-controller" ,
115122 "module" : settings .ModuleName ,
116123 },
117124 },
Original file line number Diff line number Diff line change @@ -82,6 +82,10 @@ var _ = Describe("Create Generic VMClass hook", func() {
8282 vmClass , ok := obj .(* v1alpha2.VirtualMachineClass )
8383 Expect (ok ).To (BeTrue ())
8484 Expect (vmClass .Name ).To (Equal ("generic" ))
85+ Expect (vmClass .Labels ).To (Equal (map [string ]string {
86+ "app" : "virtualization-controller" ,
87+ "module" : "virtualization" ,
88+ }))
8589 })
8690
8791 Expect (Reconcile (context .Background (), newInput ())).To (Succeed ())
Original file line number Diff line number Diff line change @@ -60,6 +60,12 @@ var config = &pkg.HookConfig{
6060 NameSelector : & pkg.NameSelector {
6161 MatchNames : []string {genericVMClassName },
6262 },
63+ LabelSelector : & metav1.LabelSelector {
64+ MatchLabels : map [string ]string {
65+ "app" : "virtualization-controller" ,
66+ "module" : settings .ModuleName ,
67+ },
68+ },
6369 ExecuteHookOnSynchronization : ptr .To (false ),
6470 },
6571 {
You can’t perform that action at this time.
0 commit comments