Skip to content

Port Route to genericetcd - #4425

Merged
openshift-bot merged 1 commit into
openshift:masterfrom
smarterclayton:refactor_route
Sep 1, 2015
Merged

openshift-bot merged 1 commit into
openshift:masterfrom
smarterclayton:refactor_route

Conversation

@smarterclayton

Copy link
Copy Markdown
Contributor

Preserves existing behavior, sets stage for using status subfields

@ramr @pweil- @liggitt for review

Extracted from #4421

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

@ramr - unrelated but I thought of it after noticing that the false version of this annotation is no longer applied....should we disallow an update to the route host name and require users to delete/recreate the route if they want to change the host?

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.

@pweil- well, it seems onerous to not allow an edit on the route object, no? And probably sorta inconsistent as well.

@smarterclayton - yeah, rather than have all that allocate shard + generate name cruft in here, it makes more sense to add a RouteAllocator.AllocateHostName(route) or something to that effect in here and move this code into that new method - can do that afterwards - the TODO in here is good.

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.

I'm actually looking to remove the need for this altogether by moving the
responsibility to the router. That'll be a follow on to the duplicate
thing.

On Mon, Aug 31, 2015 at 3:15 PM, Ram Ranganathan [email protected]
wrote:

In pkg/route/registry/route/rest.go
#4425 (comment):

  •   return nil, err
    
    +func (s routeStrategy) PrepareForCreate(obj runtime.Object) {
  • route := obj.(*api.Route)
  • if len(route.Host) == 0 && s.RouteAllocator != nil {
  •   // TODO: this does not belong here, and should be removed
    
  •   shard, err := s.RouteAllocator.AllocateRouterShard(route)
    
  •   if err != nil {
    
  •       // TODO: this will be changed when moved to a controller
    
  •       util.HandleError(errors.NewInternalError(fmt.Errorf("allocation error: %v for route: %#v", err, obj)))
    
  •       return
    
  •   }
    
  •   route.Host = s.RouteAllocator.GenerateHostname(route, shard)
    
  •   if route.Annotations == nil {
    
  •       route.Annotations = map[string]string{}
    
  •   }
    
  •   route.Annotations[HostGeneratedAnnotationKey] = "true"
    

@pweil- https://github.com/pweil- well, it seems onerous to not allow
an edit on the route object, no? And probably sorta inconsistent as well.

@smarterclayton https://github.com/smarterclayton - yeah, rather than
have all that allocate shard + generate name cruft in here, it makes more
sense to add a RouteAllocator.AllocateHostName(route) or something to
that effect in here and move this code into that new method - can do that
afterwards - the TODO in here is good.

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

Clayton Coleman | Lead Engineer, OpenShift

@pweil-

pweil- commented Aug 31, 2015

Copy link
Copy Markdown

👍

@pweil-

pweil- commented Aug 31, 2015

Copy link
Copy Markdown

Fixes: #1870

@smarterclayton

Copy link
Copy Markdown
Contributor Author

In v2 we allowed changes, but it makes the process more complex. I don't
think host name is going to keep the same behavior though because router
sharding requires the host to be different per node. For an end user, they
have to be able to hand off traffic without interruption in cases where the
route changes.

On Mon, Aug 31, 2015 at 11:50 AM, Paul Weil [email protected]
wrote:

Fixes: #1870 #1870

—
Reply to this email directly or view it on GitHub
#4425 (comment).

Clayton Coleman | Lead Engineer, OpenShift

@smarterclayton

Copy link
Copy Markdown
Contributor Author

If you have a new route with a new name, it can point to the same service,
so I think that's ok. I don't think changing the host on the fly is that
useful.

On Mon, Aug 31, 2015 at 11:54 AM, Clayton Coleman [email protected]
wrote:

In v2 we allowed changes, but it makes the process more complex. I don't
think host name is going to keep the same behavior though because router
sharding requires the host to be different per node. For an end user, they
have to be able to hand off traffic without interruption in cases where the
route changes.

On Mon, Aug 31, 2015 at 11:50 AM, Paul Weil [email protected]
wrote:

Fixes: #1870 #1870

—
Reply to this email directly or view it on GitHub
#4425 (comment).

Clayton Coleman | Lead Engineer, OpenShift

Clayton Coleman | Lead Engineer, OpenShift

@pweil-

pweil- commented Aug 31, 2015

Copy link
Copy Markdown

In v2 we allowed changes, but it makes the process more complex ...snip... I don't think changing the host on the fly is that useful.

I agree, there was a lingering TODO about management of that annotation in update cases but it just complicates the process. I'm on board with not allowing on-the-fly host name changes.

@smarterclayton

Copy link
Copy Markdown
Contributor Author

Let's slate that for a follow up

On Mon, Aug 31, 2015 at 12:01 PM, Paul Weil [email protected]
wrote:

In v2 we allowed changes, but it makes the process more complex ...snip...
I don't think changing the host on the fly is that useful.

I agree, there was a lingering TODO about management of that annotation in
update cases but it just complicates the process. I'm on board with not
allowing on-the-fly host name changes.

—
Reply to this email directly or view it on GitHub
#4425 (comment).

Clayton Coleman | Lead Engineer, OpenShift

@ramr

ramr commented Aug 31, 2015

Copy link
Copy Markdown
Contributor

@smarterclayton LGTM 👍

@smarterclayton

Copy link
Copy Markdown
Contributor Author

[merge]

On Mon, Aug 31, 2015 at 3:20 PM, Ram Ranganathan [email protected]
wrote:

@smarterclayton https://github.com/smarterclayton LGTM [image: 👍]

—
Reply to this email directly or view it on GitHub
#4425 (comment).

Clayton Coleman | Lead Engineer, OpenShift

@openshift-bot

Copy link
Copy Markdown
Contributor

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

@openshift-bot

Copy link
Copy Markdown
Contributor

[Test]ing while waiting on the merge queue

@openshift-bot

Copy link
Copy Markdown
Contributor

@smarterclayton
smarterclayton force-pushed the refactor_route branch 2 times, most recently from 35ac988 to ab78bbe Compare August 31, 2015 20:28
@openshift-bot

Copy link
Copy Markdown
Contributor

Evaluated for origin merge up to ab78bbe

@openshift-bot

Copy link
Copy Markdown
Contributor

Evaluated for origin test up to ab78bbe

openshift-bot pushed a commit that referenced this pull request Sep 1, 2015
@openshift-bot
openshift-bot merged commit 85d9e95 into openshift:master Sep 1, 2015
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.

4 participants