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

Bake backend config into ServicePort #285

Merged
merged 1 commit into from
May 24, 2018

Conversation

MrHohn
Copy link
Member

@MrHohn MrHohn commented May 24, 2018

Thinking it might be great to separate this out of the actual backend service feature implementation. @rramkumar1 Feel free to close this if you have code changes ready, I remembered you were doing something similar...
@bowei

@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels May 24, 2018
@@ -39,6 +40,7 @@ type ServicePort struct {
Protocol annotations.AppProtocol
SvcTargetPort string
NEGEnabled bool
BackendConfig *backendconfigv1beta1.BackendConfig
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think it's necessary to make this a pointer. We never will need to modify it.

Copy link
Member Author

Choose a reason for hiding this comment

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

One idea to make this a pointer is that we can distinguish if a ServicePort has any backendConfig associated with it.

Copy link
Contributor

Choose a reason for hiding this comment

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

Okay, we can leave it for now, but we should evaluate whether we really need it. I'd like to avoid having a pointer unless we actually have to modify the object.

Copy link
Member Author

Choose a reason for hiding this comment

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

That sounds good, thanks for the quick review!

podLister cache.Indexer
endpointLister cache.Indexer
backendConfigLister cache.Indexer
negEnabled bool
Copy link
Contributor

Choose a reason for hiding this comment

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

Instead of passing in all these Indexer's, we should just pass in the controller context and create the listers when we need them. So translator should be boiled down to just:

type Translator struct {
        namer utils.Namer
        ctx *context.ControllerContext
}

Copy link
Member Author

Choose a reason for hiding this comment

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

Sounds good, passed in ctx instead.

@MrHohn MrHohn force-pushed the empty-backendconfig-workflow branch from ec1011c to 3195a54 Compare May 24, 2018 19:21
@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels May 24, 2018
negEnabled bool
namer *utils.Namer
ctx *context.ControllerContext
negEnabled bool
Copy link
Contributor

Choose a reason for hiding this comment

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

You can do this in a separate PR, but we can also put a flag that indicates whether NEG is enabled in the ContollerContext.

@rramkumar1
Copy link
Contributor

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label May 24, 2018
@rramkumar1
Copy link
Contributor

/assign @nicksardo

@nicksardo nicksardo merged commit e00e925 into kubernetes:master May 24, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants