@@ -93,15 +93,15 @@ const (
93
93
)
94
94
95
95
// Initialize our plugin and set up initial values
96
- func NewK8sPlugin (helper helper.HostHelpersInterface ) ( plugins.VendorPlugin , error ) {
96
+ func NewK8sPlugin (helper helper.HostHelpersInterface ) plugins.VendorPlugin {
97
97
k8sPluging := & K8sPlugin {
98
98
PluginName : PluginName ,
99
99
SpecVersion : "1.0" ,
100
100
hostHelper : helper ,
101
101
updateTarget : & k8sUpdateTarget {},
102
102
}
103
103
104
- return k8sPluging , k8sPluging . readManifestFiles ()
104
+ return k8sPluging
105
105
}
106
106
107
107
// Name returns the name of the plugin
@@ -117,6 +117,12 @@ func (p *K8sPlugin) Spec() string {
117
117
// OnNodeStateChange Invoked when SriovNetworkNodeState CR is created or updated, return if need dain and/or reboot node
118
118
func (p * K8sPlugin ) OnNodeStateChange (new * sriovnetworkv1.SriovNetworkNodeState ) (needDrain bool , needReboot bool , err error ) {
119
119
log .Log .Info ("k8s plugin OnNodeStateChange()" )
120
+ err = p .readManifestFiles (new .Spec .System .OvsConfig )
121
+ if err != nil {
122
+ log .Log .Error (err , "k8s plugin OnNodeStateChange(): failed to read manifests" )
123
+ return
124
+ }
125
+
120
126
needDrain = false
121
127
needReboot = false
122
128
@@ -171,8 +177,8 @@ func (p *K8sPlugin) Apply() error {
171
177
return p .updateOVSService ()
172
178
}
173
179
174
- func (p * K8sPlugin ) readOpenVSwitchdManifest () error {
175
- openVSwitchService , err := p .hostHelper .ReadServiceInjectionManifestFile (ovsUnitFile )
180
+ func (p * K8sPlugin ) readOpenVSwitchdManifest (ovsConfig string ) error {
181
+ openVSwitchService , err := p .hostHelper .ReadServiceInjectionManifestFile (ovsUnitFile , ovsConfig )
176
182
if err != nil {
177
183
return err
178
184
}
@@ -198,8 +204,8 @@ func (p *K8sPlugin) readSriovPostNetworkServiceManifest() error {
198
204
return nil
199
205
}
200
206
201
- func (p * K8sPlugin ) readManifestFiles () error {
202
- if err := p .readOpenVSwitchdManifest (); err != nil {
207
+ func (p * K8sPlugin ) readManifestFiles (ovsConfig string ) error {
208
+ if err := p .readOpenVSwitchdManifest (ovsConfig ); err != nil {
203
209
return err
204
210
}
205
211
if err := p .readSriovServiceManifest (); err != nil {
0 commit comments