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: 2 additions & 2 deletions cmd/openshift-tests/openshift-tests.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ import (

"github.com/onsi/gomega"

"github.com/golang/glog"
"github.com/onsi/ginkgo"
"github.com/spf13/cobra"
"github.com/spf13/pflag"
"k8s.io/klog"

"k8s.io/apiserver/pkg/util/logs"
"k8s.io/kubernetes/pkg/kubectl/util/templates"
Expand Down Expand Up @@ -283,6 +283,6 @@ func decodeProviderTo(provider string, testContext *e2e.TestContextType) error {
return fmt.Errorf("provider must decode into the cloud config object: %v", err)
}
}
glog.V(2).Infof("Provider %s: %#v", testContext.Provider, testContext.CloudConfig)
klog.V(2).Infof("Provider %s: %#v", testContext.Provider, testContext.CloudConfig)
return nil
}
4 changes: 2 additions & 2 deletions cmd/template-service-broker/tsb.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import (
"runtime"
"time"

"github.com/golang/glog"
"github.com/openshift/origin/pkg/version"
"k8s.io/klog"

genericapiserver "k8s.io/apiserver/pkg/server"
"k8s.io/apiserver/pkg/util/logs"
Expand Down Expand Up @@ -41,6 +41,6 @@ func main() {
cmd := tsbcmd.NewCommandStartTemplateServiceBrokerServer(os.Stdout, os.Stderr, stopCh)
cmd.Flags().AddGoFlagSet(flag.CommandLine)
if err := cmd.Execute(); err != nil {
glog.Fatal(err)
klog.Fatal(err)
}
}
8 changes: 4 additions & 4 deletions hack/import-restrictions.json
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@
"allowedImportPackages": [
"vendor/k8s.io/kubernetes/pkg/apis/core",
"vendor/k8s.io/kubernetes/pkg/apis/core/v1",
"vendor/github.com/golang/glog",
"vendor/k8s.io/klog",
"vendor/github.com/blang/semver"
]
},
Expand Down Expand Up @@ -416,7 +416,7 @@
"github.com/openshift/origin/pkg/template/servicebroker"
],
"allowedImportPackages": [
"vendor/github.com/golang/glog",
"vendor/k8s.io/klog",
"vendor/k8s.io/api/core/v1",
"vendor/k8s.io/api/authorization/v1",
"vendor/k8s.io/kubernetes/pkg/apis/core",
Expand Down Expand Up @@ -455,7 +455,7 @@
"github.com/openshift/origin/pkg/oauthserver"
],
"allowedImportPackages": [
"vendor/github.com/golang/glog",
"vendor/k8s.io/klog",
"vendor/github.com/davecgh/go-spew/spew",
"github.com/openshift/origin/pkg/authorization/authorizer/scope",
"github.com/openshift/origin/pkg/oauth/apis/oauth/validation",
Expand Down Expand Up @@ -487,7 +487,7 @@
"vendor/github.com/docker/libtrust",
"vendor/github.com/fsnotify/fsnotify",
"vendor/github.com/fsouza/go-dockerclient",
"vendor/github.com/golang/glog",
"vendor/k8s.io/klog",
"vendor/github.com/gonum/graph",
"vendor/github.com/joho/godotenv",
"vendor/github.com/MakeNowJust/heredoc",
Expand Down
20 changes: 10 additions & 10 deletions pkg/apiserver/authentication/oauth/timeoutvalidator.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"errors"
"time"

"github.com/golang/glog"
"k8s.io/apimachinery/pkg/util/clock"
"k8s.io/klog"

apierrors "k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/apis/meta/v1"
Expand Down Expand Up @@ -70,7 +70,7 @@ func NewTimeoutValidator(tokens oauthclient.OAuthAccessTokenInterface, oauthClie
}
a.flushHandler = a.flush
a.putTokenHandler = a.putToken
glog.V(5).Infof("Token Timeout Validator primed with defaultTimeout=%s tickerInterval=%s", a.defaultTimeout, a.tickerInterval)
klog.V(5).Infof("Token Timeout Validator primed with defaultTimeout=%s tickerInterval=%s", a.defaultTimeout, a.tickerInterval)
return a
}

Expand Down Expand Up @@ -109,7 +109,7 @@ func (a *TimeoutValidator) putToken(td *tokenData) {
func (a *TimeoutValidator) clientTimeout(name string) time.Duration {
oauthClient, err := a.oauthClients.Get(name)
if err != nil {
glog.V(5).Infof("Failed to fetch OAuthClient %q for timeout value: %v", name, err)
klog.V(5).Infof("Failed to fetch OAuthClient %q for timeout value: %v", name, err)
return a.defaultTimeout
}
if oauthClient.AccessTokenInactivityTimeoutSeconds == nil {
Expand Down Expand Up @@ -150,7 +150,7 @@ func (a *TimeoutValidator) flush(flushHorizon time.Time) {
// flush all tokens that are about to expire before the flushHorizon.
// Typically the flushHorizon is set to a time slightly past the next
// ticker interval, so that not token ends up timing out between flushes
glog.V(5).Infof("Flushing tokens timing out before %s", flushHorizon)
klog.V(5).Infof("Flushing tokens timing out before %s", flushHorizon)

// grab all tokens that need to be update in this flush interval
// and remove them from the stored data, they either flush now or never
Expand All @@ -167,11 +167,11 @@ func (a *TimeoutValidator) flush(flushHorizon time.Time) {
case err == nil:
flushedTokens++
case apierrors.IsConflict(err) || apierrors.IsServerTimeout(err):
glog.V(5).Infof("Token update deferred for token belonging to %s",
klog.V(5).Infof("Token update deferred for token belonging to %s",
td.token.UserName)
retryList = append(retryList, td)
default:
glog.V(5).Infof("Token timeout for user=%q client=%q scopes=%v was not updated",
klog.V(5).Infof("Token timeout for user=%q client=%q scopes=%v was not updated",
td.token.UserName, td.token.ClientName, td.token.Scopes)
}
}
Expand All @@ -181,14 +181,14 @@ func (a *TimeoutValidator) flush(flushHorizon time.Time) {
for _, td := range retryList {
err := a.update(td)
if err != nil {
glog.V(5).Infof("Token timeout for user=%q client=%q scopes=%v was not updated",
klog.V(5).Infof("Token timeout for user=%q client=%q scopes=%v was not updated",
td.token.UserName, td.token.ClientName, td.token.Scopes)
} else {
flushedTokens++
}
}

glog.V(5).Infof("Successfully flushed %d tokens out of %d",
klog.V(5).Infof("Successfully flushed %d tokens out of %d",
flushedTokens, len(tokenList))
}

Expand All @@ -200,7 +200,7 @@ func (a *TimeoutValidator) nextTick() time.Time {

func (a *TimeoutValidator) Run(stopCh <-chan struct{}) {
defer runtime.HandleCrash()
glog.V(5).Infof("Started Token Timeout Flush Handling thread!")
klog.V(5).Infof("Started Token Timeout Flush Handling thread!")

ticker := a.clock.NewTicker(a.tickerInterval)
// make sure to kill the ticker when we exit
Expand All @@ -219,7 +219,7 @@ func (a *TimeoutValidator) Run(stopCh <-chan struct{}) {
// if this token is going to time out before the timer, flush now
tokenTimeout := td.timeout()
if tokenTimeout.Before(nextTick) {
glog.V(5).Infof("Timeout for user=%q client=%q scopes=%v falls before next ticker (%s < %s), forcing flush!",
klog.V(5).Infof("Timeout for user=%q client=%q scopes=%v falls before next ticker (%s < %s), forcing flush!",
td.token.UserName, td.token.ClientName, td.token.Scopes, tokenTimeout, nextTick)
a.flushHandler(nextTick)
}
Expand Down
6 changes: 3 additions & 3 deletions pkg/apps/apiserver/registry/deploylog/rest.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"sort"
"time"

"github.com/golang/glog"
"k8s.io/klog"

corev1 "k8s.io/api/core/v1"
apierrors "k8s.io/apimachinery/pkg/api/errors"
Expand Down Expand Up @@ -145,10 +145,10 @@ func (r *REST) Get(ctx context.Context, name string, opts runtime.Object) (runti
switch status {
case appsv1.DeploymentStatusNew, appsv1.DeploymentStatusPending:
if deployLogOpts.NoWait {
glog.V(4).Infof("Deployment %s is in %s state. No logs to retrieve yet.", labelForDeployment, status)
klog.V(4).Infof("Deployment %s is in %s state. No logs to retrieve yet.", labelForDeployment, status)
return &genericrest.LocationStreamer{}, nil
}
glog.V(4).Infof("Deployment %s is in %s state, waiting for it to start...", labelForDeployment, status)
klog.V(4).Infof("Deployment %s is in %s state, waiting for it to start...", labelForDeployment, status)

if err := WaitForRunningDeployerPod(r.podClient, target, r.timeout); err != nil {
return nil, apierrors.NewBadRequest(fmt.Sprintf("failed to run deployer pod %s: %v", podName, err))
Expand Down
4 changes: 2 additions & 2 deletions pkg/apps/apiserver/registry/deploylog/wait.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"fmt"
"time"

"github.com/golang/glog"
"k8s.io/klog"

corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
Expand Down Expand Up @@ -43,7 +43,7 @@ func WaitForRunningDeployment(rn corev1client.ReplicationControllersGetter, obse
switch t := e.Object.(type) {
case *metav1.Status:
if t.Reason == metav1.StatusReasonGone {
glog.V(5).Infof("encountered error while watching for replication controller: %v (retrying)", t)
klog.V(5).Infof("encountered error while watching for replication controller: %v (retrying)", t)
return false, ErrTooOldResourceVersion
}
}
Expand Down
8 changes: 4 additions & 4 deletions pkg/apps/apiserver/registry/instantiate/rest.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"context"
"fmt"

"github.com/golang/glog"
"k8s.io/klog"

"k8s.io/apimachinery/pkg/api/errors"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
Expand Down Expand Up @@ -91,7 +91,7 @@ func (s *REST) Create(ctx context.Context, obj runtime.Object, createValidation
}
return nil
}
glog.V(4).Infof("New deployment for %q caused by %#v", config.Name, causes)
klog.V(4).Infof("New deployment for %q caused by %#v", config.Name, causes)

config.Status.Details = new(appsapi.DeploymentDetails)
config.Status.Details.Causes = causes
Expand Down Expand Up @@ -350,7 +350,7 @@ func hasUpdatedTriggers(current, previous appsapi.DeploymentConfig) bool {
}
}
if !found {
glog.V(4).Infof("Deployment config %s/%s current version contains new trigger %#v", current.Namespace, current.Name, ct)
klog.V(4).Infof("Deployment config %s/%s current version contains new trigger %#v", current.Namespace, current.Name, ct)
return true
}
}
Expand All @@ -372,7 +372,7 @@ func triggeredByDifferentImage(ictParams appsapi.DeploymentTriggerImageChangePar
}

if t.ImageChangeParams.LastTriggeredImage != ictParams.LastTriggeredImage {
glog.V(4).Infof("Deployment config %s/%s triggered by different image: %s -> %s", previous.Namespace, previous.Name, t.ImageChangeParams.LastTriggeredImage, ictParams.LastTriggeredImage)
klog.V(4).Infof("Deployment config %s/%s triggered by different image: %s -> %s", previous.Namespace, previous.Name, t.ImageChangeParams.LastTriggeredImage, ictParams.LastTriggeredImage)
return true
}
return false
Expand Down
16 changes: 8 additions & 8 deletions pkg/apps/controller/deployer/deployer_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package deployment
import (
"fmt"

"github.com/golang/glog"
"k8s.io/klog"
"k8s.io/kubernetes/pkg/api/legacyscheme"

corev1 "k8s.io/api/core/v1"
Expand Down Expand Up @@ -140,7 +140,7 @@ func (c *DeploymentController) handle(deployment *corev1.ReplicationController,
nextStatus = appsv1.DeploymentStatusFailed
updatedAnnotations[appsv1.DeploymentStatusReasonAnnotation] = appsutil.DeploymentFailedUnableToCreateDeployerPod
c.emitDeploymentEvent(deployment, corev1.EventTypeWarning, "RolloutTimeout", fmt.Sprintf("Rollout for %q failed to create deployer pod (timeoutSeconds: %ds)", appsutil.LabelForDeployment(deployment), appsutil.GetTimeoutSecondsForStrategy(config)))
glog.V(4).Infof("Failing deployment %s/%s as we reached timeout while waiting for the deployer pod to be created", deployment.Namespace, deployment.Name)
klog.V(4).Infof("Failing deployment %s/%s as we reached timeout while waiting for the deployer pod to be created", deployment.Namespace, deployment.Name)
break
}

Expand Down Expand Up @@ -170,7 +170,7 @@ func (c *DeploymentController) handle(deployment *corev1.ReplicationController,
updatedAnnotations[appsv1.DeployerPodStartedAtAnnotation] = deploymentPod.Status.StartTime.String()
}
nextStatus = appsv1.DeploymentStatusPending
glog.V(4).Infof("Created deployer pod %q for %q", deploymentPod.Name, appsutil.LabelForDeployment(deployment))
klog.V(4).Infof("Created deployer pod %q for %q", deploymentPod.Name, appsutil.LabelForDeployment(deployment))

// Most likely dead code since we never get an error different from 404 back from the cache.
case deployerErr != nil:
Expand Down Expand Up @@ -284,7 +284,7 @@ func (c *DeploymentController) handle(deployment *corev1.ReplicationController,
if _, err := c.rn.ReplicationControllers(deploymentCopy.Namespace).Update(deploymentCopy); err != nil {
return fmt.Errorf("couldn't update rollout status for %q to %s: %v", appsutil.LabelForDeployment(deploymentCopy), nextStatus, err)
}
glog.V(4).Infof("Updated rollout status for %q from %s to %s (scale: %d)", appsutil.LabelForDeployment(deploymentCopy), currentStatus, nextStatus, *deploymentCopy.Spec.Replicas)
klog.V(4).Infof("Updated rollout status for %q from %s to %s (scale: %d)", appsutil.LabelForDeployment(deploymentCopy), currentStatus, nextStatus, *deploymentCopy.Spec.Replicas)

if appsutil.IsDeploymentCancelled(deploymentCopy) && appsutil.IsFailedDeployment(deploymentCopy) {
c.emitDeploymentEvent(deploymentCopy, corev1.EventTypeNormal, "RolloutCancelled", fmt.Sprintf("Rollout for %q cancelled", appsutil.LabelForDeployment(deploymentCopy)))
Expand Down Expand Up @@ -468,7 +468,7 @@ func (c *DeploymentController) makeDeployerContainer(strategy *appsv1.Deployment
// TODO: The size of environment value should be probably validated in k8s api validation
// as when the env var size is more than 128kb the execve calls will fail.
if len(env.Value) > maxInjectedEnvironmentAllowedSize {
glog.Errorf("failed to inject %s environment variable as the size exceed %d bytes", env.Name, maxInjectedEnvironmentAllowedSize)
klog.Errorf("failed to inject %s environment variable as the size exceed %d bytes", env.Name, maxInjectedEnvironmentAllowedSize)
continue
}
environment = append(environment, env)
Expand All @@ -492,14 +492,14 @@ func (c *DeploymentController) setDeployerPodsOwnerRef(deployment *corev1.Replic
}

encoder := legacyscheme.Codecs.LegacyCodec(legacyscheme.Scheme.PrioritizedVersionsAllGroups()...)
glog.V(4).Infof("deployment %s/%s owning %d pods", deployment.Namespace, deployment.Name, len(deployerPodsList))
klog.V(4).Infof("deployment %s/%s owning %d pods", deployment.Namespace, deployment.Name, len(deployerPodsList))

var errors []error
for _, pod := range deployerPodsList {
if len(pod.OwnerReferences) > 0 {
continue
}
glog.V(4).Infof("setting ownerRef for pod %s/%s to deployment %s/%s", pod.Namespace, pod.Name, deployment.Namespace, deployment.Name)
klog.V(4).Infof("setting ownerRef for pod %s/%s to deployment %s/%s", pod.Namespace, pod.Name, deployment.Namespace, deployment.Name)
newPod := pod.DeepCopy()
newPod.SetOwnerReferences([]metav1.OwnerReference{{
APIVersion: "v1",
Expand Down Expand Up @@ -580,6 +580,6 @@ func (c *DeploymentController) handleErr(err error, key interface{}, deployment
if _, isActionableErr := err.(actionableError); isActionableErr {
c.emitDeploymentEvent(deployment, corev1.EventTypeWarning, "FailedRetry", msg)
}
glog.V(2).Infof(msg)
klog.V(2).Infof(msg)
c.queue.Forget(key)
}
14 changes: 7 additions & 7 deletions pkg/apps/controller/deployer/factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"fmt"
"time"

"github.com/golang/glog"
"k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/errors"
utilruntime "k8s.io/apimachinery/pkg/util/runtime"
Expand All @@ -15,6 +14,7 @@ import (
"k8s.io/client-go/tools/cache"
"k8s.io/client-go/tools/record"
"k8s.io/client-go/util/workqueue"
"k8s.io/klog"
"k8s.io/kubernetes/pkg/api/legacyscheme"
kcontroller "k8s.io/kubernetes/pkg/controller"

Expand All @@ -31,7 +31,7 @@ func NewDeployerController(
env []v1.EnvVar,
) *DeploymentController {
eventBroadcaster := record.NewBroadcaster()
eventBroadcaster.StartLogging(glog.Infof)
eventBroadcaster.StartLogging(klog.Infof)
eventBroadcaster.StartRecordingToSink(&kv1core.EventSinkImpl{Interface: kubeClientset.CoreV1().Events("")})
recorder := eventBroadcaster.NewRecorder(legacyscheme.Scheme, v1.EventSource{Component: "deployer-controller"})

Expand Down Expand Up @@ -70,22 +70,22 @@ func (c *DeploymentController) Run(workers int, stopCh <-chan struct{}) {
defer utilruntime.HandleCrash()
defer c.queue.ShutDown()

glog.Infof("Starting deployer controller")
klog.Infof("Starting deployer controller")

// Wait for the dc store to sync before starting any work in this controller.
if !cache.WaitForCacheSync(stopCh, c.rcListerSynced, c.podListerSynced) {
return
}

glog.Infof("Deployer controller caches are synced. Starting workers.")
klog.Infof("Deployer controller caches are synced. Starting workers.")

for i := 0; i < workers; i++ {
go wait.Until(c.worker, time.Second, stopCh)
}

<-stopCh

glog.Infof("Shutting down deployer controller")
klog.Infof("Shutting down deployer controller")
}

func (c *DeploymentController) addReplicationController(obj interface{}) {
Expand Down Expand Up @@ -204,11 +204,11 @@ func (c *DeploymentController) getByKey(key string) (*v1.ReplicationController,
rc, err := c.rcLister.ReplicationControllers(namespace).Get(name)
if errors.IsNotFound(err) {
// TODO tnozicka: this is not normal and should be refactored
glog.V(4).Infof("Replication controller %q has been deleted", key)
klog.V(4).Infof("Replication controller %q has been deleted", key)
return nil, nil
}
if err != nil {
glog.Infof("Unable to retrieve replication controller %q from store: %v", key, err)
klog.Infof("Unable to retrieve replication controller %q from store: %v", key, err)
c.queue.AddRateLimited(key)
return nil, err
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package deploymentconfig
import (
"fmt"

"github.com/golang/glog"
"k8s.io/api/core/v1"
kerrors "k8s.io/apimachinery/pkg/api/errors"
kmetav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
Expand All @@ -13,6 +12,7 @@ import (
kutilerrors "k8s.io/apimachinery/pkg/util/errors"
kclientset "k8s.io/client-go/kubernetes"
"k8s.io/client-go/tools/record"
"k8s.io/klog"
kcontroller "k8s.io/kubernetes/pkg/controller"
)

Expand Down Expand Up @@ -152,7 +152,7 @@ func (m *RCControllerRefManager) AdoptReplicationController(rs *v1.ReplicationCo
// ReleaseReplicationController sends a patch to free the ReplicationController from the control of the Deployment controller.
// It returns the error if the patching fails. 404 and 422 errors are ignored.
func (m *RCControllerRefManager) ReleaseReplicationController(rc *v1.ReplicationController) error {
glog.V(4).Infof("patching ReplicationController %s/%s to remove its controllerRef to %s/%s:%s",
klog.V(4).Infof("patching ReplicationController %s/%s to remove its controllerRef to %s/%s:%s",
rc.Namespace, rc.Name, m.controllerKind.GroupVersion(), m.controllerKind.Kind, m.Controller.GetName())
deleteOwnerRefPatch := fmt.Sprintf(`{"metadata":{"ownerReferences":[{"$patch":"delete","uid":"%s"}],"uid":"%s"}}`, m.Controller.GetUID(), rc.UID)
err := m.rcControl.PatchReplicationController(rc.Namespace, rc.Name, []byte(deleteOwnerRefPatch))
Expand Down
Loading