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

Allow plugins to be installed from URL #16

Merged
merged 6 commits into from
Nov 22, 2022

Conversation

mayurvaid-redvest
Copy link
Contributor

@mayurvaid-redvest mayurvaid-redvest commented Oct 17, 2022

  • This would help in custom plugin or secured environments for eg: may be pulling from artifactory
  • Also allow to pull latest as well

@mayurvaid-redvest
Copy link
Contributor Author

@pb82 , Can you please review

@mayurvaid-redvest
Copy link
Contributor Author

@pb82 @NissesSenap Can you please review

@NissesSenap
Copy link
Member

@mayurvaid-redvest my initial look I think it looks okay. But there are a few to many splits for my brain right now.
Could you write a small test just to show that everything works as intended?

Using the existing use case and your new functionality.

@mayurvaid-redvest
Copy link
Contributor Author

@NissesSenap , Thanks for reviewing this . Have added the test case Please let me know if anything else is required

@mayurvaid-redvest
Copy link
Contributor Author

mayurvaid-redvest commented Nov 21, 2022

@NissesSenap , Please let me know updates on this ...Appreciate your help !!

@NissesSenap
Copy link
Member

So I gave it a try on my client.

You need to use OS = os.environ.get("OS", platform.system().lower()) or something similar in your tests. Else the tests won't work on any client.

Since I'm a happy Linux user I get.

FAIL: test_get_plugin_withurl_multiple_withoutversion_reverse (plugins_test.TestGetPlugins)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/edvin/go/src/github.com/NissesSenap/grafana-plugin/plugins_test.py", line 136, in test_get_plugin_withurl_multiple_withoutversion_reverse
    self.assertEqual(actual, expected)
AssertionError: Lists differ: [('ht[73 chars]d?os=linux&arch=x86_64', '/tmp/grafana-clock-p[102 chars]ip')] != [('ht[73 chars]d?os=darwin&arch=x86_64', '/tmp/grafana-clock-[103 chars]ip')]

First differing element 0:
('htt[72 chars]d?os=linux&arch=x86_64', '/tmp/grafana-clock-panel_latest.zip')
('htt[72 chars]d?os=darwin&arch=x86_64', '/tmp/grafana-clock-[13 chars]zip')

- [('https://grafana.com/api/plugins/grafana-clock-panel/versions/latest/download?os=linux&arch=x86_64',
?                                                                                    ^  --

+ [('https://grafana.com/api/plugins/grafana-clock-panel/versions/latest/download?os=darwin&arch=x86_64',
?                                                                                    ^^^^

    '/tmp/grafana-clock-panel_latest.zip'),
   ('https://grafana.com/api/plugins/grafana-clock-panel',
    '/tmp/grafana-clock-panel.zip')]

----------------------------------------------------------------------

Since you have written your change in the master branch I don't have access to update the PR for you.

@NissesSenap
Copy link
Member

Thanks for the tests btw, it really makes it easier to verify that everything looks okay :)

@mayurvaid-redvest
Copy link
Contributor Author

mayurvaid-redvest commented Nov 22, 2022

So I gave it a try on my client.

You need to use OS = os.environ.get("OS", platform.system().lower()) or something similar in your tests. Else the tests won't work on any client.

Since I'm a happy Linux user I get.

FAIL: test_get_plugin_withurl_multiple_withoutversion_reverse (plugins_test.TestGetPlugins)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/edvin/go/src/github.com/NissesSenap/grafana-plugin/plugins_test.py", line 136, in test_get_plugin_withurl_multiple_withoutversion_reverse
    self.assertEqual(actual, expected)
AssertionError: Lists differ: [('ht[73 chars]d?os=linux&arch=x86_64', '/tmp/grafana-clock-p[102 chars]ip')] != [('ht[73 chars]d?os=darwin&arch=x86_64', '/tmp/grafana-clock-[103 chars]ip')]

First differing element 0:
('htt[72 chars]d?os=linux&arch=x86_64', '/tmp/grafana-clock-panel_latest.zip')
('htt[72 chars]d?os=darwin&arch=x86_64', '/tmp/grafana-clock-[13 chars]zip')

- [('https://grafana.com/api/plugins/grafana-clock-panel/versions/latest/download?os=linux&arch=x86_64',
?                                                                                    ^  --

+ [('https://grafana.com/api/plugins/grafana-clock-panel/versions/latest/download?os=darwin&arch=x86_64',
?                                                                                    ^^^^

    '/tmp/grafana-clock-panel_latest.zip'),
   ('https://grafana.com/api/plugins/grafana-clock-panel',
    '/tmp/grafana-clock-panel.zip')]

----------------------------------------------------------------------

Since you have written your change in the master branch I don't have access to update the PR for you.

Hey Thanks for this , Have updated it @NissesSenap .. Please validate

@NissesSenap NissesSenap merged commit 0ed8bef into grafana-operator:master Nov 22, 2022
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.

2 participants