Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updating usage of the --metrics flag to create a job #12174

Merged
merged 1 commit into from
Dec 17, 2016
Merged

Updating usage of the --metrics flag to create a job #12174

merged 1 commit into from
Dec 17, 2016

Conversation

coreydaley
Copy link
Member

Updated the --metrics flag of the oc cluster up command to create a job
so that it will automatically retry if it fails due to the service account
token not being created yet.

Fixes issue #11946

@coreydaley
Copy link
Member Author

@csrwng @liggitt Please review


"github.com/openshift/origin/pkg/bootstrap/docker/errors"
kbatch "k8s.io/kubernetes/pkg/apis/batch"
"time"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like left over from previous change

// Create the job client
jobClient := kubeClient.Batch().Jobs(infraNamespace)

// Create the job
deployerPod := metricsDeployerPod(hostName, imagePrefix, imageVersion)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you should rename the function to metricsDeployerJob and return a Job instead of a Pod

@coreydaley
Copy link
Member Author

@csrwng Code updated, thanks!

Copy link
Contributor

@csrwng csrwng left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just some additional nits


meta := kapi.ObjectMeta{
Name: pod.Name,
Namespace: infraNamespace,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you don't need to set a namespace. The client will create it in the right namespace

@@ -186,7 +187,27 @@ func metricsDeployerPod(hostName, imagePrefix, imageVersion string) *kapi.Pod {
Env: env,
},
}
return pod

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You really don't need a pod object anymore (https://github.com/openshift/origin/pull/12174/files#diff-8f476646dd3c6f6850aa06d1673053d7L147)

you should just create a pod spec and directly use it below

@coreydaley
Copy link
Member Author

@csrwng updated

Copy link
Contributor

@csrwng csrwng left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I promise these are the last comments

deadline := int64(60 * 5)

meta := kapi.ObjectMeta{
Name: metricsDeployerPodName,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rename constant to metricsDeployerJobName

"github.com/openshift/origin/pkg/cmd/util/clientcmd"
kapi "k8s.io/kubernetes/pkg/api"
apierrors "k8s.io/kubernetes/pkg/api/errors"

"github.com/openshift/origin/pkg/bootstrap/docker/errors"
kbatch "k8s.io/kubernetes/pkg/apis/batch"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see if you can turn off the editor automatically rearranging the imports.

We really should have something like:

	"fmt"

	kapi "k8s.io/kubernetes/pkg/api"
	apierrors "k8s.io/kubernetes/pkg/api/errors"
	kbatch "k8s.io/kubernetes/pkg/apis/batch"

	"github.com/openshift/origin/pkg/bootstrap/docker/errors"
	"github.com/openshift/origin/pkg/cmd/util/clientcmd"

@coreydaley
Copy link
Member Author

@csrwng sounds good to me, code has been updated.

@csrwng
Copy link
Contributor

csrwng commented Dec 7, 2016

LGTM [merge]

@openshift-bot
Copy link
Contributor

[Test]ing while waiting on the merge queue

@coreydaley
Copy link
Member Author

coreydaley commented Dec 8, 2016

flake: #8571

@stevekuznetsov
Copy link
Contributor

re[test]

@coreydaley
Copy link
Member Author

flake #8502

@coreydaley
Copy link
Member Author

flake #9203

@csrwng
Copy link
Contributor

csrwng commented Dec 12, 2016

[merge]

@coreydaley
Copy link
Member Author

flake #12236

Updated the --metrics flag of the oc cluster up command to create a job
so that it will automatically retry if it fails due to the service account
token not being created yet.

Fixes issue #11946
@bparees
Copy link
Contributor

bparees commented Dec 16, 2016

[merge]

@bparees
Copy link
Contributor

bparees commented Dec 16, 2016

flake #12184

@bparees
Copy link
Contributor

bparees commented Dec 16, 2016

[test]

@openshift-bot
Copy link
Contributor

Evaluated for origin merge up to a340df7

@openshift-bot
Copy link
Contributor

Evaluated for origin test up to a340df7

@openshift-bot
Copy link
Contributor

continuous-integration/openshift-jenkins/test SUCCESS (https://ci.openshift.redhat.com/jenkins/job/test_pr_origin/12467/) (Base Commit: 7061e0b)

@openshift-bot
Copy link
Contributor

openshift-bot commented Dec 17, 2016

continuous-integration/openshift-jenkins/merge SUCCESS (https://ci.openshift.redhat.com/jenkins/job/test_pr_origin/12473/) (Base Commit: 26f76ea) (Image: devenv-rhel7_5562)

@openshift-bot openshift-bot merged commit 48b0a74 into openshift:master Dec 17, 2016
@coreydaley coreydaley deleted the github_11946_cluster_up_metrics_fails branch December 17, 2016 03:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants