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

ContainerServicePortConfigs using [:container_service, :name] #16454

Conversation

Ladas
Copy link
Contributor

@Ladas Ladas commented Nov 13, 2017

ContainerServicePortConfigs using [:container_service, :name]
as manager_ref

ContainerServicePortConfigs using [:container_service, :name]
as manager_ref
@Ladas
Copy link
Contributor Author

Ladas commented Nov 13, 2017

@miq-bot assign @agrare
@miq-bot add_label bug

@Ladas Ladas changed the title ContainerServicePortConfigs using [:container_service, :name] [WIP] ContainerServicePortConfigs using [:container_service, :name] Nov 13, 2017
@Ladas
Copy link
Contributor Author

Ladas commented Nov 13, 2017

@cben @simon3z ok so continuing ManageIQ/manageiq-providers-kubernetes#89 (comment)

But what is :name exactly, I see that we test it's nil in https://github.com/Ladas/manageiq-providers-kubernetes/blob/c89165a29404a3903030ed86ec2cb34a68e53329/spec/models/manageiq/providers/kubernetes/container_manager/refresher_spec.rb#L260 , so can we really use it?

(Also, using :name would make ems_ref unused, so it can be removed.)

@miq-bot
Copy link
Member

miq-bot commented Nov 13, 2017

Checked commit Ladas@83f0e9f with ruby 2.3.3, rubocop 0.47.1, and haml-lint 0.20.0
1 file checked, 0 offenses detected
Everything looks fine. 🏆

@cben
Copy link
Contributor

cben commented Nov 14, 2017

https://v1-5.docs.kubernetes.io/docs/api-reference/v1/definitions/#_v1_serviceport

Name Description Required Schema Default
name The name of this port within the service. This must be a DNS_LABEL. All ports within a ServiceSpec must have unique names. This maps to the Namefield in EndpointPort objects. Optional if only one ServicePort is defined on this service. [emphasis mine] false string

AFAICT it's always been like this. 1.8 api doc says the same. didn't find 1.4 api docs but user guide says the same.
1.0 source code and 1.8 source code say the same.

=> LGTM, it's always unique within a service, just sometimes nil (and possibly sometimes ""? I saw "" in old kubectl sources while searching this).

Do we need any extra tests for nil being treated as distinct from other values?

@Ladas Ladas changed the title [WIP] ContainerServicePortConfigs using [:container_service, :name] ContainerServicePortConfigs using [:container_service, :name] Nov 14, 2017
@Ladas
Copy link
Contributor Author

Ladas commented Nov 14, 2017

@miq-bot remove_label wip

@miq-bot miq-bot removed the wip label Nov 14, 2017
@Ladas
Copy link
Contributor Author

Ladas commented Nov 14, 2017

@cben awesome, hm might be add extra specs. You are thinking about manual VCR modification?

@cben
Copy link
Contributor

cben commented Nov 14, 2017 via email

@cben
Copy link
Contributor

cben commented Jan 25, 2018

Sorry, neglected all this. LGTM 👍. @agrare can we merge this?

Found example in current VCRs => added test in ManageIQ/manageiq-providers-openshift#86, fails classic refresh now, passes with this PR.

I don't remember if this is user-visible, will check soon to see if worth backporting.

Copy link
Member

@agrare agrare left a comment

Choose a reason for hiding this comment

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

👍 LGTM

@agrare agrare merged commit ef0c6da into ManageIQ:master Jan 25, 2018
@agrare agrare added this to the Sprint 78 Ending Jan 29, 2018 milestone Jan 25, 2018
@cben
Copy link
Contributor

cben commented Jan 25, 2018

UPDATE: Yes, it's user-visible. Pre-fix (classic refresh):
ports-bad
fixed:
ports-good

fine/yes? I suppose I need to open a BZ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants