Skip to content

Commit ac913f5

Browse files
authored
Merge pull request #169 from kube-logging/feat/status-enhancements
feat: add problem reporting via resource status
2 parents 143fa18 + 30062f6 commit ac913f5

32 files changed

+854
-158
lines changed

.github/workflows/artifacts.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -133,12 +133,12 @@ jobs:
133133
DIGEST: ${{ steps.build.outputs.digest }}
134134
TAGS: ${{ steps.meta.outputs.tags }}
135135
run: |
136-
for tag in ${TAGS[@]}; do
137-
cosign verify "${tag}@${DIGEST}" \
138-
--rekor-url "https://rekor.sigstore.dev/" \
139-
--certificate-identity "https://github.com/${{ github.repository }}/.github/workflows/artifacts.yaml@${{ github.ref }}" \
140-
--certificate-oidc-issuer "https://token.actions.githubusercontent.com" | jq
141-
done
136+
for tag in ${TAGS[@]}; do
137+
cosign verify "${tag}@${DIGEST}" \
138+
--rekor-url "https://rekor.sigstore.dev/" \
139+
--certificate-identity "https://github.com/${{ github.repository }}/.github/workflows/artifacts.yaml@${{ github.ref }}" \
140+
--certificate-oidc-issuer "https://token.actions.githubusercontent.com" | jq
141+
done
142142
143143
- name: Set image ref
144144
id: image-ref

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ golangci-lint:
113113

114114
.PHONY: test-e2e
115115
test-e2e: docker-build kind-cluster ## Run e2e tests
116-
e2e/e2e_test.sh || (echo "E2E test failed"; exit 1)
116+
e2e/e2e_test.sh && kind delete cluster --name $(KIND_CLUSTER) || (echo "E2E test failed"; exit 1)
117117

118118
.PHONY: lint
119119
lint: golangci-lint ## Run golangci-lint

api/telemetry/v1alpha1/bridge_types.go

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ package v1alpha1
1616

1717
import (
1818
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
19+
20+
"github.com/kube-logging/telemetry-controller/pkg/resources/problem"
21+
"github.com/kube-logging/telemetry-controller/pkg/sdk/model/state"
1922
)
2023

2124
// BridgeSpec defines the desired state of Bridge
@@ -38,7 +41,28 @@ type BridgeSpec struct {
3841
}
3942

4043
// BridgeStatus defines the observed state of Bridge
41-
type BridgeStatus struct{}
44+
type BridgeStatus struct {
45+
State state.State `json:"state,omitempty"`
46+
Problems []string `json:"problems,omitempty"`
47+
ProblemsCount int `json:"problemsCount,omitempty"`
48+
}
49+
50+
func (b *Bridge) GetProblems() []string {
51+
return b.Status.Problems
52+
}
53+
54+
func (b *Bridge) SetProblems(problems []string) {
55+
b.Status.Problems = problems
56+
b.Status.ProblemsCount = len(problems)
57+
}
58+
59+
func (b *Bridge) AddProblem(probs ...string) {
60+
problem.Add(b, probs...)
61+
}
62+
63+
func (b *Bridge) ClearProblems() {
64+
b.SetProblems([]string{})
65+
}
4266

4367
//+kubebuilder:object:root=true
4468
//+kubebuilder:resource:scope=Cluster,categories=telemetry-all

api/telemetry/v1alpha1/collector_types.go

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import (
2121
"k8s.io/apimachinery/pkg/api/resource"
2222
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
2323

24+
"github.com/kube-logging/telemetry-controller/pkg/resources/problem"
2425
"github.com/kube-logging/telemetry-controller/pkg/sdk/model/state"
2526
)
2627

@@ -95,8 +96,27 @@ func (c CollectorSpec) GetMemoryLimit() *resource.Quantity {
9596

9697
// CollectorStatus defines the observed state of Collector
9798
type CollectorStatus struct {
98-
Tenants []string `json:"tenants,omitempty"`
99-
State state.State `json:"state,omitempty"`
99+
Tenants []string `json:"tenants,omitempty"`
100+
State state.State `json:"state,omitempty"`
101+
Problems []string `json:"problems,omitempty"`
102+
ProblemsCount int `json:"problemsCount,omitempty"`
103+
}
104+
105+
func (c *Collector) GetProblems() []string {
106+
return c.Status.Problems
107+
}
108+
109+
func (c *Collector) SetProblems(problems []string) {
110+
c.Status.Problems = problems
111+
c.Status.ProblemsCount = len(problems)
112+
}
113+
114+
func (c *Collector) AddProblem(probs ...string) {
115+
problem.Add(c, probs...)
116+
}
117+
118+
func (c *Collector) ClearProblems() {
119+
c.SetProblems([]string{})
100120
}
101121

102122
//+kubebuilder:object:root=true

api/telemetry/v1alpha1/output_types.go

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import (
1818
corev1 "k8s.io/api/core/v1"
1919
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
2020

21+
"github.com/kube-logging/telemetry-controller/pkg/resources/problem"
2122
"github.com/kube-logging/telemetry-controller/pkg/sdk/model"
2223
"github.com/kube-logging/telemetry-controller/pkg/sdk/model/state"
2324
)
@@ -165,8 +166,10 @@ type Fluentforward struct {
165166

166167
// OutputStatus defines the observed state of Output
167168
type OutputStatus struct {
168-
Tenant string `json:"tenant,omitempty"`
169-
State state.State `json:"state,omitempty"`
169+
Tenant string `json:"tenant,omitempty"`
170+
State state.State `json:"state,omitempty"`
171+
Problems []string `json:"problems,omitempty"`
172+
ProblemsCount int `json:"problemsCount,omitempty"`
170173
}
171174

172175
func (o *Output) GetTenant() string {
@@ -185,6 +188,23 @@ func (o *Output) SetState(state state.State) {
185188
o.Status.State = state
186189
}
187190

191+
func (o *Output) GetProblems() []string {
192+
return o.Status.Problems
193+
}
194+
195+
func (o *Output) SetProblems(problems []string) {
196+
o.Status.Problems = problems
197+
o.Status.ProblemsCount = len(problems)
198+
}
199+
200+
func (o *Output) AddProblem(probs ...string) {
201+
problem.Add(o, probs...)
202+
}
203+
204+
func (o *Output) ClearProblems() {
205+
o.SetProblems([]string{})
206+
}
207+
188208
// +kubebuilder:object:root=true
189209
// +kubebuilder:subresource:status
190210
// +kubebuilder:printcolumn:name="Tenant",type=string,JSONPath=`.status.tenant`

api/telemetry/v1alpha1/subscription_types.go

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ package v1alpha1
1717
import (
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
3940
type 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

4548
func (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`

api/telemetry/v1alpha1/tenant_types.go

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ package v1alpha1
1717
import (
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/state"
2122
)
2223

@@ -122,6 +123,25 @@ type TenantStatus struct {
122123
LogSourceNamespaces []string `json:"logSourceNamespaces,omitempty"`
123124
ConnectedBridges []string `json:"connectedBridges,omitempty"`
124125
State state.State `json:"state,omitempty"`
126+
Problems []string `json:"problems,omitempty"`
127+
ProblemsCount int `json:"problemsCount,omitempty"`
128+
}
129+
130+
func (t *Tenant) GetProblems() []string {
131+
return t.Status.Problems
132+
}
133+
134+
func (t *Tenant) SetProblems(problems []string) {
135+
t.Status.Problems = problems
136+
t.Status.ProblemsCount = len(problems)
137+
}
138+
139+
func (t *Tenant) AddProblem(probs ...string) {
140+
problem.Add(t, probs...)
141+
}
142+
143+
func (t *Tenant) ClearProblems() {
144+
t.SetProblems([]string{})
125145
}
126146

127147
//+kubebuilder:object:root=true

api/telemetry/v1alpha1/zz_generated.deepcopy.go

Lines changed: 27 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
dependencies:
22
- name: opentelemetry-operator
33
repository: https://open-telemetry.github.io/opentelemetry-helm-charts
4-
version: 0.93.0
5-
digest: sha256:9b0c09a70eabe6f91c21fd0abb215aa2a4f75b9b1f1f3c1c4fc4f2df1f940e31
6-
generated: "2025-08-24T17:37:58.969975368Z"
4+
version: 0.95.3
5+
digest: sha256:4dc8397ec9fa96bb10ec36ee3c61ce32b46c1fc124e66c9c01343b43db57aa06
6+
generated: "2025-09-30T13:00:24.05559+02:00"

charts/telemetry-controller/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,5 @@ sources:
1313
- https://github.com/kube-logging/telemetry-controller
1414
dependencies:
1515
- name: opentelemetry-operator
16-
version: 0.93.0
16+
version: 0.95.3
1717
repository: https://open-telemetry.github.io/opentelemetry-helm-charts

0 commit comments

Comments
 (0)