Skip to content

Commit

Permalink
chore: assert that PluginSpec is implemented (#133)
Browse files Browse the repository at this point in the history
## Issue
Related to validator-labs/validatorctl#178

## Description
Asserts that the PluginSpec interface is implemented
  • Loading branch information
ahmad-ibra authored Aug 23, 2024
1 parent 166aece commit e280094
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
3 changes: 3 additions & 0 deletions api/v1alpha1/maasvalidator_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import (

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

"github.com/validator-labs/validator/pkg/plugins"
"github.com/validator-labs/validator/pkg/validationrule"

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

var _ plugins.PluginSpec = (*MaasValidatorSpec)(nil)

// PluginCode returns the MAAS validator's plugin code.
func (s MaasValidatorSpec) PluginCode() string {
return constants.PluginCode
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ require (
github.com/onsi/ginkgo/v2 v2.20.1
github.com/onsi/gomega v1.34.1
github.com/stretchr/testify v1.9.0
github.com/validator-labs/validator v0.1.7
github.com/validator-labs/validator v0.1.8
k8s.io/api v0.31.0
k8s.io/apimachinery v0.31.0
k8s.io/client-go v0.31.0
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -260,8 +260,8 @@ github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO
github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
github.com/validator-labs/validator v0.1.7 h1:x1iBKoecChM52G7bbacMsdIQYvB84C65DRIex8TG6vQ=
github.com/validator-labs/validator v0.1.7/go.mod h1:ssEvc9ws3kwWJ2VpIsOtgm7WmA6bdux2kkuIHbgT6oU=
github.com/validator-labs/validator v0.1.8 h1:4PRcnQ92Knao7V0hm704DYQMi0+nNjbS/PgMRCDH2iU=
github.com/validator-labs/validator v0.1.8/go.mod h1:+8vtI1GlihPKm0Jp61D50KPgkJkFmLZNc5fqh415DuQ=
github.com/x448/float16 v0.8.4 h1:qLwI1I70+NjRFUR3zs1JPUCgaCXSh3SW62uAKT1mSBM=
github.com/x448/float16 v0.8.4/go.mod h1:14CWIYCyZA/cWjXOioeEpHeN/83MdbZDRQHoFcYsOfg=
github.com/xdg-go/stringprep v1.0.2/go.mod h1:8F9zXuvzgwmyT5DUm4GUfZGDdT3W+LCvS6+da4O5kxM=
Expand Down

0 comments on commit e280094

Please sign in to comment.