Skip to content
This repository has been archived by the owner on Oct 11, 2023. It is now read-only.

rancherctl service enable: when using a custom service, it's annoying that the file must be placed in a specific folder location #209

Closed
deniseschannon opened this issue Apr 22, 2015 · 12 comments · Fixed by #273

Comments

@deniseschannon
Copy link

It's annoying that I have to save a folder in a specific folder location (/var/lib/rancher/conf/) AND I have to name the the service /var/lib/rancher/conf/example.yml in order for my service to work.

@deniseschannon
Copy link
Author

enforce needing the location of a service enabled to either /var/lib/rancher/conf and show error message if it's not in that location.

@wlan0
Copy link
Contributor

wlan0 commented May 1, 2015

@deniseschannon What is needed here? Only the error message, if service is not found in that location?

@deniseschannon
Copy link
Author

yes, basically an error message indicating that the yaml file needs to be in /var/lib/rancher/conf/ if it can't be found.

right now, we add in the name of the service into the rancher.yml even if the file isn't located in that directory like i did rancherctl service enable test.yml which obviously wouldn't work.

@ibuildthecloud
Copy link
Contributor

I think enable should validate that the service is

  1. A name that contains no /
  2. A file that exists and starts with /var/lib/rancher/conf
  3. A url that starts with http:// or https://

@wlan0
Copy link
Contributor

wlan0 commented May 5, 2015

@ibuildthecloud If you look at the code change I made, the above three cases are taken care of.

#273

@ibuildthecloud
Copy link
Contributor

I didn't realize #1, #2 was taken care of. I'll try to run the code.

@wlan0
Copy link
Contributor

wlan0 commented May 5, 2015

@ibuildthecloud -- If #1 is not met, then it throws an error
It doesn't enforce #2, but we have been following the convention of putting these files in /var/lib/rancher/conf. I should enforce it. I will make that change now

@wlan0
Copy link
Contributor

wlan0 commented May 5, 2015

@ibuildthecloud I've pushed the changes to enforce #2.

@wlan0
Copy link
Contributor

wlan0 commented May 5, 2015

Also, I assumed #1 means no trailing /

wlan0 added a commit to wlan0/os that referenced this issue May 6, 2015
wlan0 added a commit to wlan0/os that referenced this issue May 6, 2015
wlan0 added a commit to wlan0/os that referenced this issue May 6, 2015
wlan0 added a commit to wlan0/os that referenced this issue May 6, 2015
wlan0 added a commit to wlan0/os that referenced this issue May 6, 2015
wlan0 added a commit to wlan0/os that referenced this issue May 6, 2015
wlan0 added a commit to wlan0/os that referenced this issue May 6, 2015
@deniseschannon
Copy link
Author

Just tested this out with rancherctl service enable test.yml. The error message was "could not load service". Would it be okay if we made the change so that if the service ended in .yml, it shows the message that the file needs to be in /var/lib/rancher/conf?

@ibuildthecloud
Copy link
Contributor

We can check if it doesn't start with http then print that message.

@deniseschannon
Copy link
Author

@ibuildthecloud just made the PR.

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

Successfully merging a pull request may close this issue.

3 participants