Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion api/config/v2alpha2/opaconfig_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,10 @@ func (c *OPAConfigSpec) UnmarshalJSON(data []byte) error {
return err
}

var decoded OPAConfigSpec
// Use a local alias to avoid infinite recursion: json.Unmarshal on the
// alias type uses the default struct decoder, bypassing this method.
type alias OPAConfigSpec
var decoded alias
if err := json.Unmarshal(data, &decoded); err != nil {
return err
}
Expand Down
5 changes: 4 additions & 1 deletion api/styra/v1beta1/opaconfig_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,10 @@ type OPAStorageConfig struct {
// non-standard keys can still be read by the controller. Validation is
// performed on write via the admission webhook.
func (c *OPAConfigSpec) UnmarshalJSON(data []byte) error {
var decoded OPAConfigSpec
// Use a local alias to avoid infinite recursion: json.Unmarshal on the
// alias type uses the default struct decoder, bypassing this method.
type alias OPAConfigSpec
var decoded alias
if err := json.Unmarshal(data, &decoded); err != nil {
return err
}
Expand Down
Loading