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

This file was deleted.

2 changes: 1 addition & 1 deletion config/default/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ bases:
- ../crd
- ../rbac
- ../manager
- ../scheduling
#- ../scheduling
# [WEBHOOK] To enable webhook, uncomment all the sections with [WEBHOOK] prefix including the one in
# crd/kustomization.yaml
#- ../webhook
Expand Down

This file was deleted.

2 changes: 0 additions & 2 deletions config/scheduling/kustomization.yaml

This file was deleted.

2 changes: 1 addition & 1 deletion internal/collector/collector.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (
)

const (
clusterLoggingPriorityClassName = "cluster-logging"
clusterLoggingPriorityClassName = "system-node-critical"
exporterPort = int32(2112)
exporterPortName = "logfile-metrics"
metricsPort = int32(24231)
Expand Down
16 changes: 16 additions & 0 deletions internal/runtime/priorityclass.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package runtime

import (
scheduling "k8s.io/api/scheduling/v1"
)

//NewPriorityClass is a constructor to create a PriorityClass
func NewPriorityClass(name string, priorityValue int32, globalDefault bool, description string) *scheduling.PriorityClass {
pc := &scheduling.PriorityClass{
Value: priorityValue,
GlobalDefault: globalDefault,
Description: description,
}
Initialize(pc, "", name)
return pc
}
13 changes: 13 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
package main

import (
"context"
"flag"
"fmt"
"k8s.io/apimachinery/pkg/api/errors"
"os"
"runtime"
"sigs.k8s.io/controller-runtime/pkg/client"

loggingv1 "github.com/openshift/cluster-logging-operator/apis/logging/v1"
ctrl "sigs.k8s.io/controller-runtime"
Expand All @@ -31,6 +34,7 @@ import (
securityv1 "github.com/openshift/api/security/v1"
"github.com/openshift/cluster-logging-operator/controllers/clusterlogging"
"github.com/openshift/cluster-logging-operator/controllers/forwarding"
loggingruntime "github.com/openshift/cluster-logging-operator/internal/runtime"
"github.com/openshift/cluster-logging-operator/internal/telemetry"
elasticsearch "github.com/openshift/elasticsearch-operator/apis/logging/v1"
)
Expand Down Expand Up @@ -103,6 +107,8 @@ func main() {
os.Exit(1)
}

migrateManifestResources(mgr.GetClient())

log.Info("Registering Components.")

if err = (&clusterlogging.ReconcileClusterLogging{
Expand Down Expand Up @@ -157,6 +163,13 @@ func main() {

}

func migrateManifestResources(k8sClient client.Client) {
log.Info("migrating resources provided by the manifest")
if err := k8sClient.Delete(context.TODO(), loggingruntime.NewPriorityClass("cluster-logging", 0, false, "")); err != nil && !errors.IsNotFound(err) {
log.V(1).Error(err, "There was an error trying to remove the old collector PriorityClass named 'cluster-logging'")
}
}

// getWatchNamespace get the namespace name of the scoped operator
// - https://sdk.operatorframework.io/docs/building-operators/golang/operator-scope/#configuring-namespace-scoped-operators
func getWatchNamespace() (string, error) {
Expand Down