@@ -17,6 +17,7 @@ package v1alpha1
1717import (
1818 metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
1919
20+ "github.com/kube-logging/telemetry-controller/pkg/resources/problem"
2021 "github.com/kube-logging/telemetry-controller/pkg/sdk/model"
2122 "github.com/kube-logging/telemetry-controller/pkg/sdk/model/state"
2223)
@@ -37,9 +38,11 @@ type SubscriptionSpec struct {
3738
3839// SubscriptionStatus defines the observed state of Subscription
3940type SubscriptionStatus struct {
40- Tenant string `json:"tenant,omitempty"`
41- Outputs []NamespacedName `json:"outputs,omitempty"`
42- State state.State `json:"state,omitempty"`
41+ Tenant string `json:"tenant,omitempty"`
42+ Outputs []NamespacedName `json:"outputs,omitempty"`
43+ State state.State `json:"state,omitempty"`
44+ Problems []string `json:"problems,omitempty"`
45+ ProblemsCount int `json:"problemsCount,omitempty"`
4346}
4447
4548func (s * Subscription ) GetTenant () string {
@@ -58,6 +61,23 @@ func (s *Subscription) SetState(state state.State) {
5861 s .Status .State = state
5962}
6063
64+ func (s * Subscription ) GetProblems () []string {
65+ return s .Status .Problems
66+ }
67+
68+ func (s * Subscription ) SetProblems (problems []string ) {
69+ s .Status .Problems = problems
70+ s .Status .ProblemsCount = len (problems )
71+ }
72+
73+ func (s * Subscription ) AddProblem (probs ... string ) {
74+ problem .Add (s , probs ... )
75+ }
76+
77+ func (s * Subscription ) ClearProblems () {
78+ s .SetProblems ([]string {})
79+ }
80+
6181// +kubebuilder:object:root=true
6282// +kubebuilder:subresource:status
6383// +kubebuilder:printcolumn:name="Tenant",type=string,JSONPath=`.status.tenant`
0 commit comments