Skip to content

pod/build delete sync - #2465

Merged
openshift-bot merged 1 commit into
openshift:masterfrom
bparees:reconcile_buildpods
May 27, 2015
Merged

openshift-bot merged 1 commit into
openshift:masterfrom
bparees:reconcile_buildpods

Conversation

@bparees

@bparees bparees commented May 22, 2015

Copy link
Copy Markdown
Contributor

No description provided.

@bparees bparees changed the title pod/build delete sync [DO_NOT_MERGE] pod/build delete sync May 22, 2015
Comment thread pkg/build/api/types.go Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

....

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Just use an annotation.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

can't query on annotations, right? i do this later:

selector := labels.LabelSelector{}.Add(buildapi.IsBuildPodLabel, labels.EqualsOperator, []string{"true"})
podList, err := lw.client.KubeClient.Pods(kapi.NamespaceAll).List(selector, fields.Everything())

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

You can query on anything you write code for. Label query is no more efficient than any other type of query. That query at the end is pretty bad. Also... build name == pod name so why in the world would we need to list anything?

----- Original Message -----

@@ -12,6 +12,8 @@ const (
BuildAnnotation = "openshift.io/build.name"
// BuildLabel is the key of a Pod label whose value is the Name of a
Build which is run.
BuildLabel = "build"

  • // BuildIndicatorLabel is the key of a Pod label which can be used to
    query for all build pods
  • IsBuildPodLabel = "isBuildPod"

can't query on annotations, right? i do this later:

selector := labels.LabelSelector{}.Add(buildapi.IsBuildPodLabel,
labels.EqualsOperator, []string{"true"})
podList, err := lw.client.KubeClient.Pods(kapi.NamespaceAll).List(selector,
fields.Everything())


Reply to this email directly or view it on GitHub:
https://github.com/openshift/origin/pull/2465/files#r30928406

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

changing this to just list all pods and then filter in the code based on the existing BuildLabel presence, as discussed.

@bparees

bparees commented May 22, 2015

Copy link
Copy Markdown
Contributor Author

@smarterclayton fyi I am working on tests for this.

@bparees
bparees force-pushed the reconcile_buildpods branch 2 times, most recently from 804d2f7 to ceacb17 Compare May 22, 2015 23:20
@bparees

bparees commented May 22, 2015

Copy link
Copy Markdown
Contributor Author

[test]

@bparees
bparees force-pushed the reconcile_buildpods branch from ceacb17 to 99ff583 Compare May 23, 2015 01:45
@bparees

bparees commented May 23, 2015

Copy link
Copy Markdown
Contributor Author

@smarterclayton tests added, things we discussed cleaned up except for this which i didn't understand:

Any reason you can't list pods AND builds and then only send the builds that were deleted into the controller?

since i think that's basically what this is doing already.

@bparees bparees changed the title [DO_NOT_MERGE] pod/build delete sync pod/build delete sync May 23, 2015
@bparees

bparees commented May 23, 2015

Copy link
Copy Markdown
Contributor Author

fixes #1646

@bparees
bparees force-pushed the reconcile_buildpods branch from 99ff583 to dca3bb1 Compare May 23, 2015 15:19
Comment thread pkg/build/controller/factory/factory.go Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Comment is now outdated.

@bparees
bparees force-pushed the reconcile_buildpods branch from dca3bb1 to 26f3bd5 Compare May 25, 2015 03:09
@bparees

bparees commented May 25, 2015

Copy link
Copy Markdown
Contributor Author

@abhgupta @Kargakis thanks, comments fixed.

@bparees
bparees force-pushed the reconcile_buildpods branch 2 times, most recently from 23da809 to bcc2eba Compare May 26, 2015 04:19
@openshift-bot

Copy link
Copy Markdown
Contributor

Comment thread pkg/build/controller/controller.go Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Don't use dummy, I already fixed this to use now in all other places in build controller. Otherwise you'll have to tackle @smarterclayton's angry eyes 😉

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

done.

Comment thread pkg/build/controller/factory/factory.go Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The same suggestion as above, to get rid of client var name.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

yup, thanks

@abhgupta

Copy link
Copy Markdown
Member

@ironcladlou PTAL - we'll need to do the same thing for deployment <-> deployer-pod sync.

@bparees
bparees force-pushed the reconcile_buildpods branch from bcc2eba to fcf0f44 Compare May 27, 2015 00:29
@bparees
bparees force-pushed the reconcile_buildpods branch from fcf0f44 to 0519368 Compare May 27, 2015 03:05
@bparees

bparees commented May 27, 2015

Copy link
Copy Markdown
Contributor Author

@soltysh I had to revert one of your suggested changed (controller.go line 241) but i added a comment explaining the reasoning.

@smarterclayton smarterclayton modified the milestone: 0.6.0 May 27, 2015
@soltysh

soltysh commented May 27, 2015

Copy link
Copy Markdown
Contributor

LGTM [merge]

@openshift-bot

Copy link
Copy Markdown
Contributor

continuous-integration/openshift-jenkins/merge SUCCESS (https://ci.openshift.redhat.com/jenkins/job/merge_pull_requests_origin/2100/) (Image: devenv-fedora_1631)

@openshift-bot

Copy link
Copy Markdown
Contributor

Evaluated for origin up to 0519368

openshift-bot pushed a commit that referenced this pull request May 27, 2015
@openshift-bot
openshift-bot merged commit 4814320 into openshift:master May 27, 2015
@bparees
bparees deleted the reconcile_buildpods branch June 1, 2015 17:33
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.

6 participants