Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LOG-4445: Forwarder must use hosted cluster_id on HCP cluster #2990

Merged
merged 1 commit into from
Mar 28, 2025
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
7 changes: 7 additions & 0 deletions bundle/manifests/cluster-logging.clusterserviceversion.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2161,6 +2161,13 @@ spec:
- list
- use
- watch
- apiGroups:
- hypershift.openshift.io
resources:
- hostedcontrolplanes
verbs:
- list
- get
serviceAccountName: cluster-logging-operator
deployments:
- name: cluster-logging-operator
Expand Down
7 changes: 4 additions & 3 deletions cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,17 +36,17 @@ import (
clientgoscheme "k8s.io/client-go/kubernetes/scheme"
_ "k8s.io/client-go/plugin/pkg/client/auth"

"sigs.k8s.io/controller-runtime/pkg/manager/signals"
"sigs.k8s.io/controller-runtime/pkg/metrics"

configv1 "github.com/openshift/api/config/v1"
consolev1 "github.com/openshift/api/console/v1"
consolev1alpha1 "github.com/openshift/api/console/v1alpha1"
oauth "github.com/openshift/api/oauth/v1"
routev1 "github.com/openshift/api/route/v1"
securityv1 "github.com/openshift/api/security/v1"
elasticsearch "github.com/openshift/elasticsearch-operator/apis/logging/v1"
hypershiftv1beta1 "github.com/openshift/hypershift/api/hypershift/v1beta1"
monitoringv1 "github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1"
"sigs.k8s.io/controller-runtime/pkg/manager/signals"
"sigs.k8s.io/controller-runtime/pkg/metrics"

"github.com/openshift/cluster-logging-operator/internal/controller/logfilemetricsexporter"
loggingruntime "github.com/openshift/cluster-logging-operator/internal/runtime"
Expand All @@ -68,6 +68,7 @@ func init() {
utilruntime.Must(monitoringv1.AddToScheme(scheme))
utilruntime.Must(configv1.AddToScheme(scheme))
utilruntime.Must(securityv1.AddToScheme(scheme))
utilruntime.Must(hypershiftv1beta1.AddToScheme(scheme))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Clee2691 @anpingli have we tested this in a non HCP cluster to ensure the operator does not fail to start because maybe it is missing the CRD for the hypershift apis?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't that what the e2e tests basically confirm? CLO is able to be installed and send logs even with the hypershift scheme added. On each reconcile, it will try to fetch the clusterID and version so if it failed, none of those tests would have passed.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested on regular cluster, the clusterID present correctly. No regression issue.


utilruntime.Must(v1alpha1.AddToScheme(scheme))
utilruntime.Must(observabilityv1.AddToScheme(scheme))
Expand Down
7 changes: 7 additions & 0 deletions config/rbac/role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -167,3 +167,10 @@ rules:
- list
- use
- watch
- apiGroups:
- hypershift.openshift.io
resources:
- hostedcontrolplanes
verbs:
- list
- get
43 changes: 22 additions & 21 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,35 +1,37 @@
module github.com/openshift/cluster-logging-operator

go 1.22
go 1.22.0

toolchain go1.22.5

require (
github.com/ViaQ/logerr/v2 v2.1.0
github.com/aws/aws-sdk-go-v2 v1.9.0
github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs v1.7.0
github.com/go-logr/logr v1.4.1
github.com/go-logr/logr v1.4.2
github.com/golang-collections/collections v0.0.0-20130729185459-604e922904d3
github.com/google/go-cmp v0.6.0
github.com/onsi/ginkgo v1.16.5
github.com/onsi/gomega v1.30.0
github.com/openshift/api v0.0.0-20240212125214-04ea3891d9cb
github.com/onsi/gomega v1.31.0
github.com/openshift/api v0.0.0-20240214165302-89248c87b7fc
github.com/openshift/cluster-logging-operator/api/observability v0.0.0-00010101000000-000000000000
github.com/openshift/elasticsearch-operator v0.0.0-20220613183908-e1648e67c298
github.com/openshift/hypershift/api v0.0.0-20250311001724-9ccf6274be95
github.com/pavel-v-chernykh/keystore-go/v4 v4.1.0
github.com/pkg/errors v0.9.1
github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring v0.55.1
github.com/prometheus/client_golang v1.18.0
github.com/spf13/pflag v1.0.5
github.com/stretchr/testify v1.8.4
golang.org/x/net v0.24.0
golang.org/x/sync v0.6.0
golang.org/x/sys v0.19.0
k8s.io/api v0.29.1
k8s.io/apimachinery v0.29.1
github.com/spf13/pflag v1.0.6-0.20210604193023-d5e0c0615ace
github.com/stretchr/testify v1.9.0
golang.org/x/exp v0.0.0-20240205201215-2c58cdc269a3
golang.org/x/net v0.33.0
golang.org/x/sync v0.10.0
golang.org/x/sys v0.28.0
k8s.io/api v0.30.3
k8s.io/apimachinery v0.30.3
k8s.io/apiserver v0.29.1
k8s.io/client-go v0.29.1
k8s.io/utils v0.0.0-20240102154912-e7106e64919e
k8s.io/utils v0.0.0-20240502163921-fe8a2dddb1d0
sigs.k8s.io/controller-runtime v0.17.1
sigs.k8s.io/yaml v1.4.0
)
Expand All @@ -38,7 +40,7 @@ require (
github.com/aws/smithy-go v1.8.0 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
github.com/emicklei/go-restful/v3 v3.11.2 // indirect
github.com/evanphx/json-patch v4.12.0+incompatible // indirect
github.com/evanphx/json-patch/v5 v5.9.0 // indirect
Expand All @@ -49,7 +51,7 @@ require (
github.com/go-openapi/swag v0.22.9 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/golang/protobuf v1.5.4 // indirect
github.com/google/gnostic-models v0.6.8 // indirect
github.com/google/gofuzz v1.2.0 // indirect
github.com/google/uuid v1.6.0 // indirect
Expand All @@ -63,28 +65,27 @@ require (
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f // indirect
github.com/nxadm/tail v1.4.8 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
github.com/prometheus/client_model v0.5.0 // indirect
github.com/prometheus/common v0.46.0 // indirect
github.com/prometheus/procfs v0.12.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
go.uber.org/zap v1.26.0 // indirect
golang.org/x/exp v0.0.0-20240205201215-2c58cdc269a3 // indirect
golang.org/x/oauth2 v0.17.0 // indirect
golang.org/x/term v0.19.0 // indirect
golang.org/x/text v0.14.0 // indirect
golang.org/x/term v0.27.0 // indirect
golang.org/x/text v0.21.0 // indirect
golang.org/x/time v0.5.0 // indirect
gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect
google.golang.org/appengine v1.6.8 // indirect
google.golang.org/protobuf v1.32.0 // indirect
google.golang.org/protobuf v1.33.0 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
k8s.io/apiextensions-apiserver v0.29.1 // indirect
k8s.io/component-base v0.29.1 // indirect
k8s.io/klog/v2 v2.120.1 // indirect
k8s.io/kube-openapi v0.0.0-20240209001042-7a0d5b415232 // indirect
k8s.io/klog/v2 v2.130.1 // indirect
k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 // indirect
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect
)
Expand Down
Loading