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

No longer only search for apbs that end with -apb #719

Merged
merged 1 commit into from
Feb 2, 2018

Conversation

rthallisey
Copy link
Contributor

@rthallisey rthallisey commented Feb 1, 2018

Describe what this PR does and why we need it:
Give full respect to the whitelist config value by no longer filtering for '-apb'.

Changes proposed in this pull request

  • Remove hardcoded filter on the suffix '-apb'

Which issue this PR fixes (This will close that issue when PR gets merged)
fixes #685

@openshift-ci-robot openshift-ci-robot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Feb 1, 2018
@rthallisey
Copy link
Contributor Author

Turns out we do skip if we don't find the apb label.

        if conf.Config.Label.Spec == "" {
                log.Infof("Didn't find encoded Spec label. Assuming image is not APB and skiping")
                return nil, nil
        }

Copy link
Contributor

@maleck13 maleck13 left a comment

Choose a reason for hiding this comment

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

LGTM

@jmrodri
Copy link
Contributor

jmrodri commented Feb 1, 2018

What was the premise behind this change? Do we know if there is any performance impact with this?
Can we use the white list and just add another name to include? This seems to cause my spidey senses to tingle but I may be over reacting.

@jmrodri
Copy link
Contributor

jmrodri commented Feb 2, 2018

Just using the ansibleplaybookbundle repo, I don't see any time difference in bootstrapping the broker.
With this change it took 5.674 seconds.

[2018-02-01T21:47:31.829Z] [INFO] - Attempting bootstrap...
[2018-02-01T21:47:37.503Z] [NOTICE] - Broker successfully bootstrapped on startup

Using the code in master, bootstrap took: 6.27 seconds

[2018-02-01T21:53:25.571Z] [INFO] - Attempting bootstrap...
[2018-02-01T21:53:31.841Z] [NOTICE] - Broker successfully bootstrapped on startup

I only did one run and captured the logs for each. Surprisingly this change came in faster by 0.596 seconds. :)

@jmrodri
Copy link
Contributor

jmrodri commented Feb 2, 2018

I'd like for us to look at cleaning up our logging for bootstrapping to make it more organized, possibly for a later PR.

@jmrodri
Copy link
Contributor

jmrodri commented Feb 2, 2018

Would it be bad to make this behavior configurable? that is disable the -apb check by default, but allow someone to turn it on with a flag? I mean this has served us well so far while removing it will solve one use case, I can see someone wanting to keep the original behavior.

@maleck13
Copy link
Contributor

maleck13 commented Feb 2, 2018

Forgive the lack of knowledge here but does the white_list not provide them with this functionality?

@rthallisey
Copy link
Contributor Author

Would it be bad to make this behavior configurable? that is disable the -apb check by default, but allow someone to turn it on with a flag? I mean this has served us well so far while removing it will solve one use case, I can see someone wanting to keep the original behavior.

It's already configurable with whitelist and the default behaviour is identical to the filter I'm removing. https://github.com/openshift/ansible-service-broker/blob/master/templates/deploy-ansible-service-broker.template.yaml#L311-L312.

What I'm doing with this patch is removing the redundancy because we are filtering in two places. Whitelist should work as advertised and filter on the regex the user expects. Right now, that's not true because we always filter on the suffix -apb in addition to what's in whitelist.

@jmrodri There's some additional information in the issue #685 if I didn't address your concern. Let me know if you have any more comments/concerns.

Copy link
Contributor

@jmrodri jmrodri left a comment

Choose a reason for hiding this comment

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

ACK

@jmrodri
Copy link
Contributor

jmrodri commented Feb 2, 2018

@rthallisey thanks for that clarification. This makes a lot of sense now.

Copy link
Contributor

@eriknelson eriknelson left a comment

Choose a reason for hiding this comment

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

I was concerned about this change possibly introducing a regression issue over something we missed, but I honestly can't think of anything. This is a problem for APB devs, I think I helped 3 different people in the last couple weeks who didn't understand why their APBs were not showing up in the catalog.

Copy link
Contributor

@shawn-hurley shawn-hurley left a comment

Choose a reason for hiding this comment

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

I initially had concerns that the filter and pulling of metadata required that they be APBs but that does not appear to be the case.

I was also concerned that we may have wanted to change the interface here, but it seems that this change plus the change in whitelist behavior to require a whitelist value, seems to be more obvious.

👍 LGTM

@jmrodri jmrodri merged commit b6f1742 into openshift:master Feb 2, 2018
jianzhangbjz pushed a commit to jianzhangbjz/ansible-service-broker that referenced this pull request May 17, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Give more respect to the whitelist param
6 participants