Skip to content
Open
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
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ OPM_VERSION ?= v1.72.0
YQ_VERSION ?= v4.53.3
COSIGN_VERSION ?= v3.1.1

CRD_REF_DOCS_VERSION ?= 4deb8b1eb0169ac22ac5d777feaeb26a00e38a33
CRD_REF_DOCS_VERSION ?= 8ca59a877136c43d351ced8c5bfa8672bbb8679f

.PHONY: kustomize
kustomize: $(KUSTOMIZE) ## Download kustomize locally if necessary.
Expand Down
1 change: 1 addition & 0 deletions api/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ go 1.26.4
require (
github.com/VictoriaMetrics/VictoriaMetrics v1.145.0
github.com/VictoriaMetrics/metricsql v0.87.1
github.com/go-json-experiment/json v0.0.0-20260520185125-572e7c383686
github.com/prometheus/alertmanager v0.33.0
github.com/stretchr/testify v1.11.1
gopkg.in/yaml.v2 v2.4.0
Expand Down
2 changes: 2 additions & 0 deletions api/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ github.com/fsnotify/fsnotify v1.10.0 h1:Xx/5Ydg9CeBDX/wi4VJqStNtohYjitZhhlHt4h3S
github.com/fsnotify/fsnotify v1.10.0/go.mod h1:TLheqan6HD6GBK6PrDWyDPBaEV8LspOxvPSjC+bVfgo=
github.com/fxamacker/cbor/v2 v2.9.2 h1:X4Ksno9+x3cz0TZv69ec1hxP/+tymuR8PXQJyDwfh78=
github.com/fxamacker/cbor/v2 v2.9.2/go.mod h1:vM4b+DJCtHn+zz7h3FFp/hDAI9WNWCsZj23V5ytsSxQ=
github.com/go-json-experiment/json v0.0.0-20260520185125-572e7c383686 h1:NZBJxCpbHS1gzS6xAmyxbJznosZIIPk9IB42v62UvKA=
github.com/go-json-experiment/json v0.0.0-20260520185125-572e7c383686/go.mod h1:tphK2c80bpPhMOI4v6bIc2xWywPfbqi1Z06+RcrMkDg=
github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as=
github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as=
github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY=
Expand Down
9 changes: 5 additions & 4 deletions api/operator/v1/vlagent_types.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
package v1

import (
"encoding/json"
"fmt"
"strings"

"github.com/go-json-experiment/json"
"github.com/go-json-experiment/json/jsontext"
appsv1 "k8s.io/api/apps/v1"
corev1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/equality"
Expand Down Expand Up @@ -93,7 +94,7 @@ type VLAgentSpec struct {
// ServiceAccountName is the name of the ServiceAccount to use to run the pods
// +optional
ServiceAccountName string `json:"serviceAccountName,omitempty"`
vmv1beta1.CommonAppsParams `json:",inline,omitempty"`
vmv1beta1.CommonAppsParams `json:",inline"`
}

type VLAgentK8sCollector struct {
Expand Down Expand Up @@ -352,14 +353,14 @@ func (cr *VLAgent) UnmarshalJSON(src []byte) error {
type pcr VLAgent
type shadow struct {
*pcr
Spec json.RawMessage `json:"spec"`
Spec jsontext.Value `json:"spec"`
}
s := shadow{pcr: (*pcr)(cr)}
if err := json.Unmarshal(src, &s); err != nil {
return err
}
if len(s.Spec) > 0 {
if err := vmv1beta1.UnmarshalSpecStrict(s.Spec, &cr.Spec); err != nil {
if err := json.Unmarshal(s.Spec, &cr.Spec, json.MatchCaseInsensitiveNames(true), json.RejectUnknownMembers(true)); err != nil {
cr.Status.ParsingSpecError = fmt.Sprintf("cannot parse VLAgentSpec: %s, err: %s", string(s.Spec), err)
}
}
Expand Down
7 changes: 4 additions & 3 deletions api/operator/v1/vlcluster_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,11 @@ limitations under the License.
package v1

import (
"encoding/json"
"fmt"
"strings"

"github.com/go-json-experiment/json"
"github.com/go-json-experiment/json/jsontext"
appsv1 "k8s.io/api/apps/v1"
corev1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/equality"
Expand Down Expand Up @@ -671,14 +672,14 @@ func (cr *VLCluster) UnmarshalJSON(src []byte) error {
type pcr VLCluster
type shadow struct {
*pcr
Spec json.RawMessage `json:"spec"`
Spec jsontext.Value `json:"spec"`
}
s := shadow{pcr: (*pcr)(cr)}
if err := json.Unmarshal(src, &s); err != nil {
return err
}
if len(s.Spec) > 0 {
if err := vmv1beta1.UnmarshalSpecStrict(s.Spec, &cr.Spec); err != nil {
if err := json.Unmarshal(s.Spec, &cr.Spec, json.MatchCaseInsensitiveNames(true), json.RejectUnknownMembers(true)); err != nil {
cr.Status.ParsingSpecError = fmt.Sprintf("cannot parse VLClusterSpec: %s, err: %s", string(s.Spec), err)
}
}
Expand Down
9 changes: 5 additions & 4 deletions api/operator/v1/vlsingle_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,11 @@ limitations under the License.
package v1

import (
"encoding/json"
"fmt"
"strings"

"github.com/go-json-experiment/json"
"github.com/go-json-experiment/json/jsontext"
corev1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/equality"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
Expand All @@ -41,7 +42,7 @@ type VLSingleSpec struct {
// created by operator for the given CustomResource
ManagedMetadata *vmv1beta1.ManagedObjectsMetadata `json:"managedMetadata,omitempty"`

vmv1beta1.CommonAppsParams `json:",inline,omitempty"`
vmv1beta1.CommonAppsParams `json:",inline"`

// LogLevel for VictoriaLogs to be configured with.
// +optional
Expand Down Expand Up @@ -163,14 +164,14 @@ func (cr *VLSingle) UnmarshalJSON(src []byte) error {
type pcr VLSingle
type shadow struct {
*pcr
Spec json.RawMessage `json:"spec"`
Spec jsontext.Value `json:"spec"`
}
s := shadow{pcr: (*pcr)(cr)}
if err := json.Unmarshal(src, &s); err != nil {
return err
}
if len(s.Spec) > 0 {
if err := vmv1beta1.UnmarshalSpecStrict(s.Spec, &cr.Spec); err != nil {
if err := json.Unmarshal(s.Spec, &cr.Spec, json.MatchCaseInsensitiveNames(true), json.RejectUnknownMembers(true)); err != nil {
cr.Status.ParsingSpecError = fmt.Sprintf("cannot parse VLSingleSpec: %s, err: %s", string(s.Spec), err)
}
}
Expand Down
11 changes: 6 additions & 5 deletions api/operator/v1/vmanomaly_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,12 @@ limitations under the License.
package v1

import (
"encoding/json"
"fmt"
"path"
"strings"

"github.com/go-json-experiment/json"
"github.com/go-json-experiment/json/jsontext"
appsv1 "k8s.io/api/apps/v1"
corev1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/equality"
Expand Down Expand Up @@ -119,7 +120,7 @@ type VMAnomalySpec struct {
// ServiceAccountName is the name of the ServiceAccount to use to run the pods
// +optional
ServiceAccountName string `json:"serviceAccountName,omitempty"`
vmv1beta1.CommonAppsParams `json:",inline,omitempty"`
vmv1beta1.CommonAppsParams `json:",inline"`
}

// VMAnomalyWritersSpec defines writer configuration for VMAnomaly
Expand All @@ -136,7 +137,7 @@ type VMAnomalyWritersSpec struct {
// +kubebuilder:validation:Minimum=1
ConnectionRetryAttempts int `json:"connectionRetryAttempts,omitempty" yaml:"connection_retry_attempts,omitempty"`
// +optional
VMAnomalyHTTPClientSpec `json:",inline,omitempty" yaml:",inline,omitempty"`
VMAnomalyHTTPClientSpec `json:",inline" yaml:",inline,omitempty"`
}

// VMAnomalyVMWriterMetricFormatSpec defines the desired state of VMAnomalyVMWriterMetricFormat
Expand Down Expand Up @@ -333,14 +334,14 @@ func (cr *VMAnomaly) UnmarshalJSON(src []byte) error {
type pcr VMAnomaly
type shadow struct {
*pcr
Spec json.RawMessage `json:"spec"`
Spec jsontext.Value `json:"spec"`
}
s := shadow{pcr: (*pcr)(cr)}
if err := json.Unmarshal(src, &s); err != nil {
return err
}
if len(s.Spec) > 0 {
if err := vmv1beta1.UnmarshalSpecStrict(s.Spec, &cr.Spec); err != nil {
if err := json.Unmarshal(s.Spec, &cr.Spec, json.MatchCaseInsensitiveNames(true), json.RejectUnknownMembers(true)); err != nil {
cr.Status.ParsingSpecError = fmt.Sprintf("cannot parse VMAnomalySpec: %s, err: %s", string(s.Spec), err)
}
}
Expand Down
7 changes: 4 additions & 3 deletions api/operator/v1/vtcluster_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,11 @@ limitations under the License.
package v1

import (
"encoding/json"
"fmt"
"strings"

"github.com/go-json-experiment/json"
"github.com/go-json-experiment/json/jsontext"
appsv1 "k8s.io/api/apps/v1"
corev1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/equality"
Expand Down Expand Up @@ -581,14 +582,14 @@ func (cr *VTCluster) UnmarshalJSON(src []byte) error {
type pcr VTCluster
type shadow struct {
*pcr
Spec json.RawMessage `json:"spec"`
Spec jsontext.Value `json:"spec"`
}
s := shadow{pcr: (*pcr)(cr)}
if err := json.Unmarshal(src, &s); err != nil {
return err
}
if len(s.Spec) > 0 {
if err := vmv1beta1.UnmarshalSpecStrict(s.Spec, &cr.Spec); err != nil {
if err := json.Unmarshal(s.Spec, &cr.Spec, json.MatchCaseInsensitiveNames(true), json.RejectUnknownMembers(true)); err != nil {
cr.Status.ParsingSpecError = fmt.Sprintf("cannot parse VTClusterSpec: %s, err: %s", string(s.Spec), err)
}
}
Expand Down
9 changes: 5 additions & 4 deletions api/operator/v1/vtsingle_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,11 @@ limitations under the License.
package v1

import (
"encoding/json"
"fmt"
"strings"

"github.com/go-json-experiment/json"
"github.com/go-json-experiment/json/jsontext"
corev1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/equality"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
Expand All @@ -41,7 +42,7 @@ type VTSingleSpec struct {
// created by operator for the given CustomResource
ManagedMetadata *vmv1beta1.ManagedObjectsMetadata `json:"managedMetadata,omitempty"`

vmv1beta1.CommonAppsParams `json:",inline,omitempty"`
vmv1beta1.CommonAppsParams `json:",inline"`

// LogLevel for VictoriaTraces to be configured with.
// +optional
Expand Down Expand Up @@ -153,14 +154,14 @@ func (cr *VTSingle) UnmarshalJSON(src []byte) error {
type pcr VTSingle
type shadow struct {
*pcr
Spec json.RawMessage `json:"spec"`
Spec jsontext.Value `json:"spec"`
}
s := shadow{pcr: (*pcr)(cr)}
if err := json.Unmarshal(src, &s); err != nil {
return err
}
if len(s.Spec) > 0 {
if err := vmv1beta1.UnmarshalSpecStrict(s.Spec, &cr.Spec); err != nil {
if err := json.Unmarshal(s.Spec, &cr.Spec, json.MatchCaseInsensitiveNames(true), json.RejectUnknownMembers(true)); err != nil {
cr.Status.ParsingSpecError = fmt.Sprintf("cannot parse VTSingleSpec: %s, err: %s", string(s.Spec), err)
}
}
Expand Down
9 changes: 5 additions & 4 deletions api/operator/v1alpha1/vmdistributed_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,11 @@ limitations under the License.
package v1alpha1

import (
"encoding/json"
"fmt"
"strings"

"github.com/go-json-experiment/json"
"github.com/go-json-experiment/json/jsontext"
appsv1 "k8s.io/api/apps/v1"
corev1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/equality"
Expand Down Expand Up @@ -231,7 +232,7 @@ type VMDistributedZoneAgentSpec struct {
// +optional
HPA *vmv1beta1.EmbeddedHPA `json:"hpa,omitempty"`

vmv1beta1.CommonAppsParams `json:",inline,omitempty"`
vmv1beta1.CommonAppsParams `json:",inline"`
}

func (s *VMDistributedZoneAgentSpec) ToVMAgentSpec() (*vmv1beta1.VMAgentSpec, error) {
Expand Down Expand Up @@ -438,14 +439,14 @@ func (cr *VMDistributed) UnmarshalJSON(src []byte) error {
type pcr VMDistributed
type shadow struct {
*pcr
Spec json.RawMessage `json:"spec"`
Spec jsontext.Value `json:"spec"`
}
s := shadow{pcr: (*pcr)(cr)}
if err := json.Unmarshal(src, &s); err != nil {
return err
}
if len(s.Spec) > 0 {
if err := vmv1beta1.UnmarshalSpecStrict(s.Spec, &cr.Spec); err != nil {
if err := json.Unmarshal(s.Spec, &cr.Spec, json.MatchCaseInsensitiveNames(true), json.RejectUnknownMembers(true)); err != nil {
cr.Status.ParsingSpecError = fmt.Sprintf("cannot parse VMDistributedSpec: %s, err: %s", string(s.Spec), err)
}
}
Expand Down
Loading
Loading