Skip to content
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
4 changes: 3 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ FLUENTD_IMAGE?=quay.io/openshift/origin-logging-fluentd:latest
# Do a `make pre-submit` *before* submitting a PR, it ensurse generated code and tools
# are up to date, source is formatted and lint-free and unit tests pass.
pre-submit: tools regenerate check
echo "Git status after pre-submt (check for unexpected changes)"
@echo "Git status after pre-submit (check for unexpected changes)"
git status

tools: $(BINGO) $(GOLANGCI_LINT) $(JUNITREPORT) $(OPERATOR_SDK) $(OPM)
Expand Down Expand Up @@ -158,6 +158,8 @@ redeploy:
$(MAKE) undeploy
$(MAKE) deploy

undeploy-all: undeploy undeploy-elasticsearch-operator

cluster-logging-catalog: cluster-logging-catalog-build cluster-logging-catalog-deploy

cluster-logging-cleanup: cluster-logging-operator-uninstall cluster-logging-catalog-uninstall
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -310,9 +310,7 @@ spec:
- cluster-logging-operator
env:
- name: WATCH_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.annotations['olm.targetNamespaces']
value: ""
- name: POD_NAME
valueFrom:
fieldRef:
Expand Down
5 changes: 4 additions & 1 deletion docs/HACKING.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,18 @@ Quick summary of main targets only, see below and the Makefile itself for more d
To build, deploy and test the CLO image in your own cluster:
* `make deploy`: Build CLO image and deploy to cluster with elasticsearch.
* `make undeploy`: Undo `make deploy`.
* `make undeploy-all`: Undeploys CLO and Elasticsearch operator.

To run CLO as a local process:
* `make run`: Run CLO as a local process. Does not require `make deploy`.
* `make debug`: Run CLO in the `dlv` debugger.

To do a complete deploy, test, cleanup cycle:
To run the e2e tests:
* `make test-olm-e2e`: Run e2e tests using locally built images.
* `make test-olm-e2e`: Run e2e tests using CI latest images.

NOTE: e2e tests require a clean cluster starting point, `make undeploy-all` will provide it.

## Testing Overview

There are two types of test:
Expand Down
3 changes: 2 additions & 1 deletion hack/testing-olm/utils
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ gather_logging_resources() {
oc -n ${LOGGING_NS} get ds -o wide > $outdir/daemonsets.txt 2>&1 || :
oc -n ${LOGGING_NS} get pods -o wide > $outdir/pods.txt 2>&1 || :
oc -n ${LOGGING_NS} get clusterlogging instance -o yaml > $outdir/clusterlogging.instance.yaml ||:
oc -n ${LOGGING_NS} get clusterlogforwarder instance -o yaml > $outdir/clusterlogforwarder.instance.yaml ||:
# Note: clusterlogforwarder is cluster scoped.
oc get clusterlogforwarder instance -o yaml > $outdir/clusterlogforwarder.instance.yaml ||:

oc -n ${LOGGING_NS} extract secret/elasticsearch --to=$outdir ||:
oc -n ${LOGGING_NS} extract configmap/fluentd --to=$outdir ||:
Expand Down
18 changes: 13 additions & 5 deletions manifests/4.6/cluster-logging.v4.6.0.clusterserviceversion.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -159,9 +159,9 @@ spec:
- type: SingleNamespace
supported: true
- type: MultiNamespace
supported: false
supported: true
- type: AllNamespaces
supported: false
supported: true
install:
strategy: deployment
spec:
Expand Down Expand Up @@ -243,6 +243,16 @@ spec:
clusterPermissions:
- serviceAccountName: cluster-logging-operator
rules:
- apiGroups:
- "logging.openshift.io"
resources:
- clusterlogforwarders
- clusterlogforwarders/status
verbs:
- get
- list
- watch
- update
- apiGroups:
- console.openshift.io
resources:
Expand Down Expand Up @@ -316,9 +326,7 @@ spec:
- cluster-logging-operator
env:
- name: WATCH_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.annotations['olm.targetNamespaces']
value: ""
- name: POD_NAME
valueFrom:
fieldRef:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ spec:
shortNames:
- clf
singular: clusterlogforwarder
scope: Namespaced
scope: Cluster
versions:
- name: v1
schema:
Expand Down
4 changes: 2 additions & 2 deletions olm_deploy/subscription/operator-group.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ metadata:
name: cluster-logging-operator
namespace: ${CLUSTER_LOGGING_OPERATOR_NAMESPACE}
spec:
targetNamespaces:
- ${CLUSTER_LOGGING_OPERATOR_NAMESPACE}
targetNamespaces: []


2 changes: 1 addition & 1 deletion pkg/apis/logging/v1/cluster_log_forwarder_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const ClusterLogForwarderKind = "ClusterLogForwarder"

// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// +kubebuilder:subresource:status
// +kubebuilder:resource:shortName=clf
// +kubebuilder:resource:shortName=clf,scope=Cluster

// ClusterLogForwarder is an API to configure forwarding logs.
//
Expand Down
6 changes: 3 additions & 3 deletions pkg/k8shandler/reconciler.go
Original file line number Diff line number Diff line change
Expand Up @@ -183,12 +183,12 @@ func (clusterRequest *ClusterLoggingRequest) getProxyConfig() *configv1.Proxy {
}

func (clusterRequest *ClusterLoggingRequest) getLogForwarder() *logging.ClusterLogForwarder {
nsname := types.NamespacedName{Name: constants.SingletonName, Namespace: constants.OpenshiftNS}
name := types.NamespacedName{Name: constants.SingletonName} // Cluster scope, no namespace
forwarder := &logging.ClusterLogForwarder{}
logger.Debug("clusterlogforwarder-controller fetching LF instance")
if err := clusterRequest.Client.Get(context.TODO(), nsname, forwarder); err != nil {
if err := clusterRequest.Client.Get(context.TODO(), name, forwarder); err != nil {
if !apierrors.IsNotFound(err) {
fmt.Printf("Encountered unexpected error getting %v", nsname)
fmt.Printf("Encountered unexpected error getting %v", name)
}
}

Expand Down
2 changes: 1 addition & 1 deletion test/helpers/framework.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import (

const (
clusterLoggingURI = "apis/logging.openshift.io/v1/namespaces/openshift-logging/clusterloggings"
clusterlogforwarderURI = "apis/logging.openshift.io/v1/namespaces/openshift-logging/clusterlogforwarders"
clusterlogforwarderURI = "apis/logging.openshift.io/v1/clusterlogforwarders"
DefaultCleanUpTimeout = 60.0 * 2
)

Expand Down