Skip to content

Commit e280094

Browse files
authored
chore: assert that PluginSpec is implemented (#133)
## Issue Related to validator-labs/validatorctl#178 ## Description Asserts that the PluginSpec interface is implemented
1 parent 166aece commit e280094

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

api/v1alpha1/maasvalidator_types.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import (
2121

2222
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
2323

24+
"github.com/validator-labs/validator/pkg/plugins"
2425
"github.com/validator-labs/validator/pkg/validationrule"
2526

2627
"github.com/validator-labs/validator-plugin-maas/pkg/constants"
@@ -38,6 +39,8 @@ type MaasValidatorSpec struct {
3839
ResourceAvailabilityRules []ResourceAvailabilityRule `json:"resourceAvailabilityRules,omitempty" yaml:"resourceAvailabilityRules,omitempty"`
3940
}
4041

42+
var _ plugins.PluginSpec = (*MaasValidatorSpec)(nil)
43+
4144
// PluginCode returns the MAAS validator's plugin code.
4245
func (s MaasValidatorSpec) PluginCode() string {
4346
return constants.PluginCode

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ require (
99
github.com/onsi/ginkgo/v2 v2.20.1
1010
github.com/onsi/gomega v1.34.1
1111
github.com/stretchr/testify v1.9.0
12-
github.com/validator-labs/validator v0.1.7
12+
github.com/validator-labs/validator v0.1.8
1313
k8s.io/api v0.31.0
1414
k8s.io/apimachinery v0.31.0
1515
k8s.io/client-go v0.31.0

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -260,8 +260,8 @@ github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO
260260
github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
261261
github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
262262
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
263-
github.com/validator-labs/validator v0.1.7 h1:x1iBKoecChM52G7bbacMsdIQYvB84C65DRIex8TG6vQ=
264-
github.com/validator-labs/validator v0.1.7/go.mod h1:ssEvc9ws3kwWJ2VpIsOtgm7WmA6bdux2kkuIHbgT6oU=
263+
github.com/validator-labs/validator v0.1.8 h1:4PRcnQ92Knao7V0hm704DYQMi0+nNjbS/PgMRCDH2iU=
264+
github.com/validator-labs/validator v0.1.8/go.mod h1:+8vtI1GlihPKm0Jp61D50KPgkJkFmLZNc5fqh415DuQ=
265265
github.com/x448/float16 v0.8.4 h1:qLwI1I70+NjRFUR3zs1JPUCgaCXSh3SW62uAKT1mSBM=
266266
github.com/x448/float16 v0.8.4/go.mod h1:14CWIYCyZA/cWjXOioeEpHeN/83MdbZDRQHoFcYsOfg=
267267
github.com/xdg-go/stringprep v1.0.2/go.mod h1:8F9zXuvzgwmyT5DUm4GUfZGDdT3W+LCvS6+da4O5kxM=

0 commit comments

Comments
 (0)