Issue 1:
I would like to set an http request timeout in the kubernetes Go client, however:

The underlying http client is not exposed.

Even if I access the underlying http client through an (admittedly inelegant) cast and set the timeout, requests fail because the Transport does not support the CancelRequest method.

The example below fails with cannot make request: net/http: Client Transport of type *unversioned.userAgentRoundTripper doesn't support CancelRequest; Timeout not supported

package main

import (
"fmt"
k8sClient "k8s.io/kubernetes/pkg/client/unversioned"
"net/http"
"time"
)

func main() {
client, err := k8sClient.NewInCluster()
if err != nil {
fmt.Printf("cannot create client: %s\n", err)
return
}
httpClient, ok := client.RESTClient.Client.(*http.Client)
if !ok {
fmt.Println("cannot cast k8s client to http client")
}
httpClient.Timeout = time.Millisecond * 500
if _, err := client.Services("default").Get("foo"); err != nil {
fmt.Printf("cannot make request: %s\n", err)
}
}

Issue 2:
What keywords did you search in Kubernetes issues before filing this one? (If you have found any duplicates, you should instead reply there.): "scheduledjob", "scheduledjob replace", "scheduledjob not found", "scheduledjob FailedGet"

Is this a BUG REPORT or FEATURE REQUEST?: BUG REPORT

Kubernetes version

Client Version: version.Info{Major:"1", Minor:"4+", GitVersion:"v1.4.0-alpha.3-dirty", GitCommit:"b44b716965db2d54c8c7dfcdbcb1d54792ab8559", GitTreeState:"dirty", BuildDate:"2016-09-27T14:29:43Z", GoVersion:"go1.7.1", Compiler:"gc", Platform:"darwin/amd64"}
Server Version: version.Info{Major:"1", Minor:"4+", GitVersion:"v1.4.0-beta.10", GitCommit:"3aa6d31d3a213ba04b3252cc123ddef26d44cd0e", GitTreeState:"dirty", BuildDate:"1970-01-01T00:00:00Z", GoVersion:"go1.6.2", Compiler:"gc", Platform:"linux/amd64"}

Environment:

Cloud provider or hardware configuration: Run under minikube v0.10.0 w/ VirtualBox

OS (from /etc/os-release):

NAME=Boot2Docker
VERSION=1.11.1
ID=boot2docker
ID_LIKE=tcl
VERSION_ID=1.11.1

Kernel (uname -a):

Linux minikube 4.4.14-boot2docker #1 SMP Fri Jul 1 21:46:36 UTC 2016 x86_64 GNU/Linux

What happened:

The period of the scheduled jobs: 1 minute

If running a scheduled job with the Replace concurrencyPolicy option, and if the first job is replaced by a new one that was supposed to start, then no new jobs (after the second one) are created. The second job finishes successfully.

In addition, the first job and pod disappear and cannot be accessed using kubectl logs, kubectl get job etc. with the following error:

$ kubectl logs pyserv-1857390410-of6ut
Error from server: pods "pyserv-1857390410-of6ut" not found

The template used:

apiVersion: batch/v2alpha1
kind: ScheduledJob
metadata:
name: pyserv
spec:
schedule: 0/1 * * * ?
concurrencyPolicy: Replace
jobTemplate:
spec:
template:
spec:
containers:
- name: pyserv
image: adrian/ubuntu:v3
args:
- python2.7
- /app/server.py
restartPolicy: OnFailure

Upon inspection of the scheduled job I get the following warning:

FirstSeen LastSeen Count From SubobjectPath Type Reason Message
--------- -------- ----- ---- ------------- -------- ------ -------
3m 3m 1 {scheduled-job-controller } Normal SuccessfulCreate Created job pyserv-1857390410
2m 2m 1 {scheduled-job-controller } Normal SuccessfulDelete Deleted job pyserv-1857390410
2m 2m 1 {scheduled-job-controller } Normal SuccessfulCreate Created job pyserv-2009171792
1m 8s 7 {scheduled-job-controller } Warning FailedGet Get job: jobs.batch "pyserv-1857390410" not found

The count of the failed event keeps increasing and after a while, the jobs disappear and the only thing remaining is this:

FirstSeen LastSeen Count From SubobjectPath Type Reason Message
--------- -------- ----- ---- ------------- -------- ------ -------
1h 5s 457 {scheduled-job-controller } Warning FailedGet Get job: jobs.batch "pyserv-1857390410" not found

What you expected to happen:

For the scheduled jobs to still run

For the first job to still exist

How to reproduce it (as minimally and precisely as possible):

Start minikube minikube start --kubernetes-version="v1.4.0-beta.10" --vm-driver=virtualbox

Create a ScheduledJob with the concurrencyPolicy set to Replace that runs a script that lasts more than 1 minute, with the following schedule: schedule: 0/1 * * * ?