Skip to content

Commit 7f09fae

Browse files
author
mgianluc
committed
Change struct definition
1 parent 86a4fec commit 7f09fae

File tree

3 files changed

+12
-12
lines changed

3 files changed

+12
-12
lines changed

pkg/utils/collect.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import (
2424

2525
"github.com/go-logr/logr"
2626
"github.com/pkg/errors"
27-
"gopkg.in/yaml.v2"
27+
"gopkg.in/yaml.v3"
2828
corev1 "k8s.io/api/core/v1"
2929
"k8s.io/apimachinery/pkg/types"
3030
)

pkg/utils/collect_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import (
77

88
. "github.com/onsi/ginkgo/v2"
99
. "github.com/onsi/gomega"
10-
"gopkg.in/yaml.v2"
10+
"gopkg.in/yaml.v3"
1111

1212
corev1 "k8s.io/api/core/v1"
1313
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"

pkg/utils/configuration.go

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,45 +25,45 @@ type Resource struct {
2525
// Namespace of the resource deployed in the Cluster.
2626
// Empty for resources scoped at cluster level.
2727
// +optional
28-
Namespace string `json:"namespace,omitempty"`
28+
Namespace string `json:"namespace,omitempty" yaml:"namespace,omitempty"`
2929

3030
// Group of the resource deployed in the Cluster.
31-
Group string `json:"group"`
31+
Group string `json:"group" yaml:"group"`
3232

3333
// Version of the resource deployed in the Cluster.
34-
Version string `json:"version"`
34+
Version string `json:"version" yaml:"version"`
3535

3636
// Kind of the resource deployed in the Cluster.
3737
// +kubebuilder:validation:MinLength=1
38-
Kind string `json:"kind"`
38+
Kind string `json:"kind" yaml:"kind"`
3939

4040
// LabelFilters allows to filter resources based on current labels.
41-
LabelFilters []libsveltosv1alpha1.LabelFilter `json:"labelFilters,omitempty"`
41+
LabelFilters []libsveltosv1alpha1.LabelFilter `json:"labelFilters,omitempty" yaml:"labelFilters,omitempty"`
4242
}
4343

4444
// LogFilter allows to select which logs to collect
4545
type Log struct {
4646
// Namespace of the pods deployed in the Cluster.
4747
// +optional
48-
Namespace string `json:"namespace,omitempty"`
48+
Namespace string `json:"namespace,omitempty" yaml:"namespace,omitempty"`
4949

5050
// LabelFilters allows to filter pods based on current labels.
51-
LabelFilters []libsveltosv1alpha1.LabelFilter `json:"labelFilters,omitempty"`
51+
LabelFilters []libsveltosv1alpha1.LabelFilter `json:"labelFilters,omitempty" yaml:"labelFilters,omitempty"`
5252

5353
// A relative time in seconds before the current time from which to collect logs.
5454
// If this value precedes the time a pod was started, only logs since the pod start will be returned.
5555
// If this value is in the future, no logs will be returned. Only one of sinceSeconds or sinceTime may be specified.
5656
// +optional
57-
SinceSeconds *int64 `json:"sinceSeconds,omitempty"`
57+
SinceSeconds *int64 `json:"sinceSeconds,omitempty" yaml:"sinceSeconds,omitempty"`
5858
}
5959

6060
// Configuration defines the instruction for collector
6161
type Configuration struct {
6262
// Resources indicates what resorces to collect
6363
// +optional
64-
Resources []Resource `json:"resources,omitempty"`
64+
Resources []Resource `json:"resources,omitempty" yaml:"resources,omitempty"`
6565

6666
// Logs indicates what pods' log to collect
6767
// +optional
68-
Logs []Log `json:"logs,omitempty"`
68+
Logs []Log `json:"logs,omitempty" yaml:"logs,omitempty"`
6969
}

0 commit comments

Comments
 (0)