Skip to content

Commit e0a8ed6

Browse files
authored
Merge pull request kubernetes#88235 from tanjunchen/remove-TODO001
test/e2e/framework:remove TODO and make func private
2 parents 3ed0f1b + 9c8d4be commit e0a8ed6

File tree

2 files changed

+10
-11
lines changed

2 files changed

+10
-11
lines changed

test/e2e/framework/ingress/ingress_utils.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -400,7 +400,6 @@ func createTLSSecret(kubeClient clientset.Interface, namespace, secretName strin
400400
}
401401
var s *v1.Secret
402402
if s, err = kubeClient.CoreV1().Secrets(namespace).Get(context.TODO(), secretName, metav1.GetOptions{}); err == nil {
403-
// TODO: Retry the update. We don't really expect anything to conflict though.
404403
framework.Logf("Updating secret %v in ns %v with hosts %v", secret.Name, namespace, host)
405404
s.Data = secret.Data
406405
_, err = kubeClient.CoreV1().Secrets(namespace).Update(context.TODO(), s, metav1.UpdateOptions{})

test/e2e/framework/podlogs/podlogs.go

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -41,15 +41,6 @@ import (
4141
clientset "k8s.io/client-go/kubernetes"
4242
)
4343

44-
// LogsForPod starts reading the logs for a certain pod. If the pod has more than one
45-
// container, opts.Container must be set. Reading stops when the context is done.
46-
// The stream includes formatted error messages and ends with
47-
// rpc error: code = Unknown desc = Error: No such container: 41a...
48-
// when the pod gets deleted while streaming.
49-
func LogsForPod(ctx context.Context, cs clientset.Interface, ns, pod string, opts *v1.PodLogOptions) (io.ReadCloser, error) {
50-
return cs.CoreV1().Pods(ns).GetLogs(pod, opts).Stream(ctx)
51-
}
52-
5344
// LogOutput determines where output from CopyAllLogs goes.
5445
type LogOutput struct {
5546
// If not nil, errors will be logged here.
@@ -110,7 +101,7 @@ func CopyAllLogs(ctx context.Context, cs clientset.Interface, ns string, to LogO
110101
pod.Status.ContainerStatuses[i].State.Terminated == nil) {
111102
continue
112103
}
113-
readCloser, err := LogsForPod(ctx, cs, ns, pod.ObjectMeta.Name,
104+
readCloser, err := logsForPod(ctx, cs, ns, pod.ObjectMeta.Name,
114105
&v1.PodLogOptions{
115106
Container: c.Name,
116107
Follow: true,
@@ -210,6 +201,15 @@ func CopyAllLogs(ctx context.Context, cs clientset.Interface, ns string, to LogO
210201
return nil
211202
}
212203

204+
// logsForPod starts reading the logs for a certain pod. If the pod has more than one
205+
// container, opts.Container must be set. Reading stops when the context is done.
206+
// The stream includes formatted error messages and ends with
207+
// rpc error: code = Unknown desc = Error: No such container: 41a...
208+
// when the pod gets deleted while streaming.
209+
func logsForPod(ctx context.Context, cs clientset.Interface, ns, pod string, opts *v1.PodLogOptions) (io.ReadCloser, error) {
210+
return cs.CoreV1().Pods(ns).GetLogs(pod, opts).Stream(ctx)
211+
}
212+
213213
// WatchPods prints pod status events for a certain namespace or all namespaces
214214
// when namespace name is empty.
215215
func WatchPods(ctx context.Context, cs clientset.Interface, ns string, to io.Writer) error {

0 commit comments

Comments
 (0)