File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -20,22 +20,26 @@ import (
2020 "fmt"
2121)
2222
23+ // AddPlugin records a plugin for the validation request.
2324func (v * ValidateContainerAdjustmentRequest ) AddPlugin (name , index string ) {
2425 v .Plugins = append (v .Plugins , & PluginInstance {
2526 Name : name ,
2627 Index : index ,
2728 })
2829}
2930
31+ // AddResponse records the container adjustments and updates to validate from a CreateContainerResponse.
3032func (v * ValidateContainerAdjustmentRequest ) AddResponse (rpl * CreateContainerResponse ) {
3133 v .Adjust = rpl .Adjust
3234 v .Update = rpl .Update
3335}
3436
37+ // AddOwners sets the owning plugins for the container adjustment request.
3538func (v * ValidateContainerAdjustmentRequest ) AddOwners (owners * OwningPlugins ) {
3639 v .Owners = owners
3740}
3841
42+ // ValidationResult returns the validation result as an error (non-nil if rejected).
3943func (v * ValidateContainerAdjustmentResponse ) ValidationResult (plugin string ) error {
4044 if ! v .Reject {
4145 return nil
@@ -49,6 +53,7 @@ func (v *ValidateContainerAdjustmentResponse) ValidationResult(plugin string) er
4953 return fmt .Errorf ("validator %q rejected container adjustment, reason: %s" , plugin , reason )
5054}
5155
56+ // GetPluginMap returns a map of plugin name to PluginInstance.
5257func (v * ValidateContainerAdjustmentRequest ) GetPluginMap () map [string ]* PluginInstance {
5358 if v == nil {
5459 return nil
You can’t perform that action at this time.
0 commit comments