Skip to content

Commit

Permalink
use library-go functionality for logs and template processing
Browse files Browse the repository at this point in the history
  • Loading branch information
deads2k committed May 29, 2019
1 parent dafe8b2 commit 638d69f
Show file tree
Hide file tree
Showing 16 changed files with 11 additions and 359 deletions.
1 change: 0 additions & 1 deletion hack/import-restrictions.json
Original file line number Diff line number Diff line change
Expand Up @@ -550,7 +550,6 @@
"github.com/openshift/origin/pkg/security/securitycontextconstraints/util",
"github.com/openshift/origin/pkg/template/apis/template",
"github.com/openshift/origin/pkg/template/apis/template/validation",
"github.com/openshift/origin/pkg/template/generator",
"github.com/openshift/origin/pkg/template/templateprocessing",
"github.com/openshift/origin/pkg/unidling/api",
"github.com/openshift/origin/pkg/unidling/util",
Expand Down
5 changes: 2 additions & 3 deletions pkg/cmd/openshift-apiserver/server.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package openshift_apiserver

import (
"github.com/openshift/library-go/pkg/serviceability"
"k8s.io/klog"

genericapiserver "k8s.io/apiserver/pkg/server"
Expand All @@ -10,8 +11,6 @@ import (

openshiftcontrolplanev1 "github.com/openshift/api/openshiftcontrolplane/v1"
"github.com/openshift/origin/pkg/cmd/openshift-apiserver/openshiftapiserver"
"github.com/openshift/origin/pkg/cmd/util"

_ "k8s.io/kubernetes/pkg/client/metrics/prometheus" // for client metric registration
_ "k8s.io/kubernetes/pkg/util/reflector/prometheus" // for reflector metric registration
_ "k8s.io/kubernetes/pkg/util/workqueue/prometheus" // for workqueue metric registration
Expand All @@ -21,7 +20,7 @@ import (
var featureKeepRemovedNetworkingAPI = true

func RunOpenShiftAPIServer(serverConfig *openshiftcontrolplanev1.OpenShiftAPIServerConfig, stopCh <-chan struct{}) error {
util.InitLogrus()
serviceability.InitLogrusFromKlog()
// Allow privileged containers
capabilities.Initialize(capabilities.Capabilities{
AllowPrivileged: true,
Expand Down
5 changes: 3 additions & 2 deletions pkg/cmd/openshift-controller-manager/controller_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import (
"os"
"time"

"github.com/openshift/library-go/pkg/serviceability"

"k8s.io/klog"

"k8s.io/api/core/v1"
Expand All @@ -21,7 +23,6 @@ import (

openshiftcontrolplanev1 "github.com/openshift/api/openshiftcontrolplane/v1"
origincontrollers "github.com/openshift/origin/pkg/cmd/openshift-controller-manager/controller"
"github.com/openshift/origin/pkg/cmd/util"
"github.com/openshift/origin/pkg/cmd/util/variable"
"github.com/openshift/origin/pkg/version"

Expand All @@ -30,7 +31,7 @@ import (
)

func RunOpenShiftControllerManager(config *openshiftcontrolplanev1.OpenShiftControllerManagerConfig, clientConfig *rest.Config) error {
util.InitLogrus()
serviceability.InitLogrusFromKlog()
kubeClient, err := kubernetes.NewForConfig(clientConfig)
if err != nil {
return err
Expand Down
4 changes: 2 additions & 2 deletions pkg/cmd/openshift-network-controller/network_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,16 @@ import (
"k8s.io/kubernetes/pkg/api/legacyscheme"

openshiftcontrolplanev1 "github.com/openshift/api/openshiftcontrolplane/v1"
"github.com/openshift/library-go/pkg/serviceability"
"github.com/openshift/origin/pkg/cmd/openshift-controller-manager"
origincontrollers "github.com/openshift/origin/pkg/cmd/openshift-controller-manager/controller"
"github.com/openshift/origin/pkg/cmd/util"

// for metrics
_ "k8s.io/kubernetes/pkg/client/metrics/prometheus"
)

func RunOpenShiftNetworkController(config *openshiftcontrolplanev1.OpenShiftControllerManagerConfig, clientConfig *rest.Config) error {
util.InitLogrus()
serviceability.InitLogrusFromKlog()
kubeClient, err := kubernetes.NewForConfig(clientConfig)
if err != nil {
return err
Expand Down
19 changes: 0 additions & 19 deletions pkg/cmd/util/log.go

This file was deleted.

2 changes: 1 addition & 1 deletion pkg/oc/cli/process/process.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,14 @@ import (
octemplateapi "github.com/openshift/api/template"
templatev1 "github.com/openshift/api/template/v1"
templatev1client "github.com/openshift/client-go/template/clientset/versioned/typed/template/v1"
"github.com/openshift/library-go/pkg/template/generator"
cmdutil "github.com/openshift/oc/pkg/helpers/cmd"
"github.com/openshift/origin/pkg/oc/lib/describe"
"github.com/openshift/origin/pkg/oc/lib/newapp/app"
templateapi "github.com/openshift/origin/pkg/template/apis/template"
templateapiv1 "github.com/openshift/origin/pkg/template/apis/template/v1"
templatevalidation "github.com/openshift/origin/pkg/template/apis/template/validation"
templateclientv1 "github.com/openshift/origin/pkg/template/client/v1"
"github.com/openshift/origin/pkg/template/generator"
"github.com/openshift/origin/pkg/template/templateprocessing"
)

Expand Down
2 changes: 1 addition & 1 deletion pkg/template/apiserver/registry/template/rest.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ import (
"k8s.io/apiserver/pkg/registry/rest"

"github.com/openshift/api/template"
"github.com/openshift/library-go/pkg/template/generator"
templateapi "github.com/openshift/origin/pkg/template/apis/template"
templatevalidation "github.com/openshift/origin/pkg/template/apis/template/validation"
"github.com/openshift/origin/pkg/template/generator"
"github.com/openshift/origin/pkg/template/templateprocessing"
)

Expand Down
3 changes: 0 additions & 3 deletions pkg/template/generator/doc.go

This file was deleted.

3 changes: 0 additions & 3 deletions pkg/template/generator/examples/doc.go

This file was deleted.

46 changes: 0 additions & 46 deletions pkg/template/generator/examples/remotevalue.go

This file was deleted.

36 changes: 0 additions & 36 deletions pkg/template/generator/examples/remotevalue_test.go

This file was deleted.

160 changes: 0 additions & 160 deletions pkg/template/generator/expressionvalue.go

This file was deleted.

Loading

0 comments on commit 638d69f

Please sign in to comment.