-
Notifications
You must be signed in to change notification settings - Fork 9.6k
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
[Provider] Rancher #9173
[Provider] Rancher #9173
Conversation
e269d54
to
8fc2983
Compare
@stack72 how do we go about providing the external system for the acceptance tests? Is there some scripting that we can add stuff to spin up docker containers or something? |
@johnrengelman did you also take note of rancher/go-rancher#121 ? |
@raphink - yeah, this is still using your patched catalog client. |
nice thanks @johnrengelman , I had the same question you ask @stack72 for the tests... what do you think about version compatibility?? this provider should be compatible with rancher api v1 and v2 that is coming later this month?? (also I don't really know if rancher 1.2.0 will support both api versions) |
I'm not sure on compatibility...there were definitely some significant changes (i.e. |
rancher/go-rancher#124 seems to suggest v2 should be used as soon as it is available. |
There are 2 different clients though: |
Is Rancher PaaS or do we have to build infra to run these tests? |
@stack72 there is not a hosted solution that I know of, but it's as simple as doing |
If that's the case, then I can test the provider and add it to our nightly tests easily enough |
@stack72 - great! @raphink - I'm running the acceptance tests now and I'm having issues with them. It appears the code is configured to require access control to be enabled on Rancher, but I'm not sure that should be a requirement. I could conceive someone running an authenticated cluster on a private network (or in CI tests). Thoughts? |
@johnrengelman I don't think you need the access control enabled in rancher.. wWe are in fact running ci on travis against a newly created rancher server without any access control. |
}, | ||
"name": &schema.Schema{ | ||
Type: schema.TypeString, | ||
Required: true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should use Optinal: true
here so that we can terraformize what exists without having to update to token name in the database using SQL queries because this attribute is not updatable using the API.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This valuesappears to be updateable...there's an acceptance test that verifies that it is. Though, these should be optional where they are optional in the Rancher API. I'll do a pass through this tomorrow.
Please ping me when you feel this is worthy of final review / testing :) P. |
@stack72 will do. sorry been out sick the last few days. There's still some issues in here that I am addressing. |
You take as long as you need sir! :) |
@johnrengelman I see you added in the docs how to import these resources. The fact is the code base code for import is there, but it's only tested for the |
Yup. I'm still working on this PR. When it's ready for review, I'll remove
|
993c7c9
to
35bf3da
Compare
@raphink @blackjid Ok, I've got everything in working except 1 thing: Creating a stack from a catalog entry.
Looks like, rancher doesn't respond to |
Nevermind, when I vendor'd your fork of |
b467ab1
to
12958f3
Compare
Great, thank you! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for all the work integrating this.. We might have a rancher provider in the next terraform release.
Description: descriptions["access_key"], | ||
}, | ||
"secret_key": &schema.Schema{ | ||
Type: schema.TypeString, | ||
Required: true, | ||
DefaultFunc: schema.EnvDefaultFunc("RANCHER_SECRET_KEY", nil), | ||
Optional: true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome, makes total sense if we can use them from the environment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The point here is that Rancher doesn't require API keys. You could have a rancher server that does not have access control enabled, so it wouldn't make sense to force the user to provide these values then.
What would be the next steps to get this merged?? integrating with CI on the terraform side? |
I'm finishing up the stack upgrade piece today and then we should be set. |
@blackjid @raphink @stack72 this is ready for review. For acceptance tests this is what I've done locally:
|
d.HasChange("rancher_compose") || | ||
d.HasChange("environment") || | ||
d.HasChange("catalog_id") || | ||
d.HasChange("scope") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does a change in scope really require an upgrade?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It doesn't. I already changed this in a later commit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah great, sorry.
Delay: 1 * time.Second, | ||
MinTimeout: 3 * time.Second, | ||
} | ||
s, waitErr := stateConf.WaitForState() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should Terraform finish the upgrade when there was no error, and rollback it otherwise?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know about auto-rolling back. Is there any precedent for doing that in other providers?
As for finishing the upgrade, it's an config option you can set on the resource: fd856e5#diff-52a80e386a0d139d6f657ff76d1a692cR70
Please can you rebase this from master? :) P. |
Starting implementation taken from https://github.com/platanus/terraform-provider-rancher Commits from jidonoso@gmail.com and raphael.pinson@camptocamp.com
hey @johnrengelman now problem, thanks for that.. 👍 |
fd856e5
to
14d3eac
Compare
@stack72 branch is updated and i squashed down the commits. |
LGTM |
@stack72 fine with me. |
Any news on that? |
@stack72 anything I can do to help shepherd this along? |
@stack72 any plan to merge this? |
@johnrengelman @blackjid shall we get back to the platanus project for new features/bugfix until this gets merged? |
that make sense, but I have the feeling the merging the further changes back to this PR is not going to be easy. at least is going to be super manual.. right @johnrengelman??? |
Hi all Sorry I haven't been back to you all on this one - I am trying to work out how to get tests in place for this. We currently have no infrastructure running Rancher so I am trying to work out how to script it that it comes up as part of our test harnsess I promise I will get back to this asap P. |
@stack72 just as a reminder, I have some tests running in the plugin version of this provider... if that helps.. |
@stack72 FYI we are using this branch in production for a few weeks now (since the go for merging actually) and it works pretty well. |
hi @johnrengelman / @raphink This LGTM! I am going to come back and setup the testing for this to our CI server later in the week Thanks for all the work here Paul |
* Vendor Rancher Go library. * Implement Rancher Provider. Starting implementation taken from https://github.com/platanus/terraform-provider-rancher Commits from jidonoso@gmail.com and raphael.pinson@camptocamp.com
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |
This integrates the rancher provider from https://github.com/platanus/terraform-provider-rancher.
I've tried to retain the commit history for the interesting parts here in order to give credit to the original authors.
/cc @raphink @blackjid