Skip to content

Commit

Permalink
Merge pull request kubernetes#7205 from omerap12/logging-vpa-common_e2e
Browse files Browse the repository at this point in the history
Refactor logging statements in common,e2e test files
  • Loading branch information
k8s-ci-robot authored Oct 25, 2024
2 parents 878c982 + 343770b commit 00e19fd
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 8 deletions.
2 changes: 1 addition & 1 deletion vertical-pod-autoscaler/common/kubeconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ func CreateKubeConfigOrDie(kubeconfig string, kubeApiQps float32, kubeApiBurst i
var config *rest.Config
var err error
if len(kubeconfig) > 0 {
klog.V(1).Infof("Using kubeconfig file: %s", kubeconfig)
klog.V(1).InfoS("Using kubeconfig", "file", kubeconfig)
// use the current context in kubeconfig
config, err = clientcmd.BuildConfigFromFlags("", kubeconfig)
if err != nil {
Expand Down
5 changes: 2 additions & 3 deletions vertical-pod-autoscaler/e2e/v1/admission_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
vpa_types "k8s.io/autoscaler/vertical-pod-autoscaler/pkg/apis/autoscaling.k8s.io/v1"
"k8s.io/autoscaler/vertical-pod-autoscaler/pkg/utils/test"
klog "k8s.io/klog/v2"
"k8s.io/kubernetes/test/e2e/framework"
framework_deployment "k8s.io/kubernetes/test/e2e/framework/deployment"
podsecurity "k8s.io/pod-security-admission/api"
Expand Down Expand Up @@ -157,7 +156,7 @@ var _ = AdmissionControllerE2eDescribe("Admission-controller", func() {
apiv1.ResourceCPU: ParseQuantityOrDie("100m"),
apiv1.ResourceMemory: ParseQuantityOrDie("100Mi"),
}
klog.Infof("d: %+v", d)
framework.Logf("Created hamster deployment %v", d)
ginkgo.By("Setting up a VPA CRD")
containerName := GetHamsterContainerNameByIndex(0)
vpaCRD := test.VerticalPodAutoscaler().
Expand Down Expand Up @@ -286,7 +285,7 @@ var _ = AdmissionControllerE2eDescribe("Admission-controller", func() {
apiv1.ResourceCPU: ParseQuantityOrDie("400m"),
apiv1.ResourceMemory: ParseQuantityOrDie("600Mi"),
}
klog.Infof("d: %+v", d)
framework.Logf("Created hamster deployment %v", d)
ginkgo.By("Setting up a VPA CRD")
containerName := GetHamsterContainerNameByIndex(0)
vpaCRD := test.VerticalPodAutoscaler().
Expand Down
2 changes: 1 addition & 1 deletion vertical-pod-autoscaler/e2e/v1/e2e.go
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ func setupSuite() {
if err != nil {
framework.Failf("Error deleting orphaned namespaces: %v", err)
}
klog.Infof("Waiting for deletion of the following namespaces: %v", deleted)
framework.Logf("Waiting for deletion of the following namespaces: %v", deleted)
if err := framework.WaitForNamespacesDeleted(context.TODO(), c, deleted, namespaceCleanupTimeout); err != nil {
framework.Failf("Failed to delete orphaned namespaces %v: %v", deleted, err)
}
Expand Down
2 changes: 1 addition & 1 deletion vertical-pod-autoscaler/e2e/v1/recommender.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ func getVpaObserver(vpaClientSet vpa_clientset.Interface) *observer {
if !cache.WaitForCacheSync(make(chan struct{}), controller.HasSynced) {
klog.Fatalf("Failed to sync VPA cache during initialization")
} else {
klog.Info("Initial VPA synced successfully")
klog.InfoS("Initial VPA synced successfully")
}
return &vpaObserver
}
Expand Down
2 changes: 1 addition & 1 deletion vertical-pod-autoscaler/e2e/v1beta2/e2e.go
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ func setupSuite() {
if err != nil {
framework.Failf("Error deleting orphaned namespaces: %v", err)
}
klog.Infof("Waiting for deletion of the following namespaces: %v", deleted)
framework.Logf("Waiting for deletion of the following namespaces: %v", deleted)
if err := framework.WaitForNamespacesDeleted(context.TODO(), c, deleted, namespaceCleanupTimeout); err != nil {
framework.Failf("Failed to delete orphaned namespaces %v: %v", deleted, err)
}
Expand Down
2 changes: 1 addition & 1 deletion vertical-pod-autoscaler/e2e/v1beta2/recommender.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ func getVpaObserver(vpaClientSet vpa_clientset.Interface) *observer {
if !cache.WaitForCacheSync(make(chan struct{}), controller.HasSynced) {
klog.Fatalf("Failed to sync VPA cache during initialization")
} else {
klog.Info("Initial VPA synced successfully")
klog.InfoS("Initial VPA synced successfully")
}
return &vpaObserver
}
Expand Down

0 comments on commit 00e19fd

Please sign in to comment.