Code Monkey home page Code Monkey logo

rgon-exec's People

Contributors

emcniece avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Forkers

mervynzhang

rgon-exec's Issues

Commands fail poorly if container is not running

For example, executing service nginx reload on an Nginx container that is down renders the following error:

INFO[0091] Executing notify command 'rgon-exec -name=rgon-proxy-nginx-1 -cmd="service nginx reload"'
INFO[0091] [rgon-exec -name=rgon-proxy-nginx-1 -cmd="service nginx reload"]: "Executing [service nginx reload] on container [rgon-proxy-nginx-1]"
INFO[0091] [rgon-exec -name=rgon-proxy-nginx-1 -cmd="service nginx reload"]: "Value is not a string: [{\"id\":\"1i25097\",\"type\":\"container\",\"links\":{\"self\":\"http:\\/\\/rancher.limbicmedia.ca:8080\\/v1\\/containers\\/1i25097\",\"account\":\"http:\\/\\/rancher.limbicmedia.ca:8080\\/v1\\/containers\\/1i25097\\/account\",\"credentials\":\"http:\\/\\/rancher.limbicmedia.ca:8080\\/v1\\/containers\\/1i25097\\/credentials\",\"healthcheckInstanceHostMaps\":\"http:\\/\\/rancher.limbicmedia.ca:8080\\/v1\\/containers\\/1i25097\\/healthcheckinstancehostmaps\",\"hosts\":\"http:\\/\\/rancher.limbicmedia.ca:8080\\/v1\\/containers\\/1i25097\\/hosts\",\"instanceLabels\":\"http:\\/\\/rancher.limbicmedia.ca:8080\\/v1\\/containers\\/1i25097\\/instancelabels\",\"instanceLinks\":\"http:\\/\\/rancher.limbicmedia.ca:8080\\/v1\\/containers\\/1i25097\\/instancelinks\",\"instances\":\"http:\\/\\/rancher.limbicmedia.ca:8080\\/v1\\/containers\\/1i25097\\/instances\",\"mounts\":\"http:\\/\\/rancher.limbicmedia.ca:8080\\/v1\\/containers\\/1i25097\\/mounts\",\"ports\":\"http:\\/\\/rancher.limbicmedia.ca:8080\\/v1\\/containers\\/1i25097\\/ports\",\"serviceEvents\":\"http:\\/\\/rancher.limbicmedia.ca:8080\\/v1\\/containers\\/1i25097\\/serviceevents\",\"serviceExposeMaps\":\"http:\\/\\/rancher.limbicmedia.ca:8080\\/v1\\/containers\\/1i25097\\/serviceexposemaps\",\"services\":\"http:\\/\\/rancher.limbicmedia.ca:8080\\/v1\\/containers\\/1i25097\\/services\",\"targetInstanceLinks\":\"http:\\/\\/rancher.limbicmedia.ca:8080\\/v1\\/containers\\/1i25097\\/targetinstancelinks\",\"volumes\":\"http:\\/\\/rancher.limbicmedia.ca:8080\\/v1\\/containers\\/1i25097\\/volumes\",\"stats\":\"http:\\/\\/rancher.limbicmedia.ca:8080\\/v1\\/containers\\/1i25097\\/stats\",\"containerStats\":\"http:\\/\\/rancher.limbicmedia.ca:8080\\/v1\\/containers\\/1i25097\\/containerstats\"},\"actions\":{\"update\":\"http:\\/\\/rancher.limbicmedia.ca:8080\\/v1\\/containers\\/1i25097\\/?action=update\",\"error\":\"http:\\/\\/rancher.limbicmedia.ca:8080\\/v1\\/containers\\/1i25097\\/?action=error\",\"remove\":\"http:\\/\\/rancher.limbicmedia.ca:8080\\/v1\\/containers\\/1i25097\\/?action=remove\",\"start\":\"http:\\/\\/rancher.limbicmedia.ca:8080\\/v1\\/containers\\/1i25097\\/?action=start\",\"logs\":\"http:\\/\\/rancher.limbicmedia.ca:8080\\/v1\\/containers\\/1i25097\\/?action=logs\",\"setlabels\":\"http:\\/\\/rancher.limbicmedia.ca:8080\\/v1\\/containers\\/1i25097\\/?action=setlabels\"},\"baseType\":\"instance\",\"name\":\"rgon-proxy-nginx-1\",\"state\":\"stopped\",\"accountId\":\"1a5\",\"blkioDeviceOptions\":null,\"build\":null,\"capAdd\":null,\"capDrop\":null,\"command\":null,\"cpuSet\":null,\"cpuShares\":null,\"createIndex\":1,\"created\":\"2017-03-11T00:49:09Z\",\"createdTS\":1489193349000,\"dataVolumeMounts\":{},\"dataVolumes\":[\"\\/limbic-ci\\/rancher\\/rgon-proxy\\/htpasswd:\\/etc\\/nginx\\/htpasswd\",\"\\/limbic-ci\\/rancher\\/rgon-proxy\\/conf:\\/etc\\/nginx\\/conf.d\",\"\\/limbic-ci\\/rancher\\/rgon-proxy\\/vhost:\\/etc\\/nginx\\/vhost.d\",\"\\/limbic-ci\\/rancher\\/rgon-proxy\\/certs:\\/etc\\/nginx\\/certs\"],\"dataVolumesFrom\":null,\"deploymentUnitUuid\":\"fdae4660-74c4-40e5-a0a6-5737f4d67840\",\"description\":null,\"devices\":null,\"dns\":[\"169.254.169.250\"],\"dnsSearch\":[\"rgon-proxy.rancher.internal\",\"nginx.rgon-proxy.rancher.internal\",\"rancher.internal\"],\"domainName\":null,\"entryPoint\":null,\"environment\":null,\"expose\":null,\"externalId\":\"cb27fac0866bbb7c6c69c5a36fc4d7082e2ea3635e54f8542e7c351bb1a9956b\",\"extraHosts\":null,\"firstRunning\":\"2017-03-11T00:49:26Z\",\"firstRunningTS\":1489193366000,\"healthCheck\":null,\"healthState\":null,\"hostId\":\"1h1\",\"hostname\":null,\"imageUuid\":\"docker:nginx\",\"kind\":\"container\",\"labels\":{\"io.rancher.service.deployment.unit\":\"fdae4660-74c4-40e5-a0a6-5737f4d67840\",\"io.rancher.sidekicks\":\"rgon-proxy\",\"rgon-proxy\":\"nginx\",\"io.rancher.stack_service.name\":\"rgon-proxy\\/nginx\",\"io.rancher.service.launch.config\":\"io.rancher.service.primary.launch.config\",\"io.rancher.project.name\":\"rgon-proxy\",\"io.rancher.project_service.name\":\"rgon-proxy\\/nginx\",\"io.rancher.stack.name\":\"rgon-proxy\",\"io.rancher.service.hash\":\"7884dd9853e11921f69b2b9d8525dc343b253c80\",\"io.rancher.scheduler.global\":\"false\",\"io.rancher.container.ip\":\"10.42.233.140\\/16\",\"io.rancher.container.uuid\":\"3efb884a-3050-4aa7-8566-8ab6b225370d\",\"io.rancher.cni.network\":\"ipsec\",\"io.rancher.cni.wait\":\"true\",\"io.rancher.container.name\":\"rgon-proxy-nginx-1\"},\"logConfig\":{\"type\":\"logConfig\",\"config\":{\"max-file\":\"5\",\"max-size\":\"10m\"},\"driver\":\"json-file\"},\"lxcConf\":null,\"memory\":null,\"memorySwap\":null,\"nativeContainer\":false,\"networkContainerId\":null,\"networkMode\":\"managed\",\"pidMode\":null,\"ports\":[\"80:80\\/tcp\",\"443:443\\/tcp\"],\"primaryIpAddress\":\"10.42.233.140\",\"privileged\":false,\"publishAllPorts\":false,\"readOnly\":false,\"registryCredentialId\":null,\"removed\":null,\"requestedHostId\":null,\"restartPolicy\":null,\"securityOpt\":null,\"startCount\":4,\"startOnCreate\":true,\"stdinOpen\":true,\"systemContainer\":null,\"transitioning\":\"no\",\"transitioningMessage\":null,\"transitioningProgress\":null,\"tty\":true,\"user\":null,\"uuid\":\"3efb884a-3050-4aa7-8566-8ab6b225370d\",\"version\":\"0\",\"volumeDriver\":null,\"workingDir\":null,\"primaryNetworkId\":\"1n5\"}]"
INFO[0091] [rgon-exec -name=rgon-proxy-nginx-1 -cmd="service nginx reload"]: "2017/03/11 00:51:07 [EXEC] Fatal: Couldn't parse container JSON"

Command doesn't support &&

It would be nice to be able to chain a few commands, ie. nginx -t && service nginx reload.

INFO[0181] [rgon-exec -name=rgon-proxy-nginx-1 -cmd="nginx -t && service nginx reload"]: "Executing [nginx -t && service nginx reload] on container [rgon-proxy-nginx-1]"
INFO[0181] [rgon-exec -name=rgon-proxy-nginx-1 -cmd="nginx -t && service nginx reload"]: "nginx: invalid option: \"&&\"\r"
INFO[0181] [rgon-exec -name=rgon-proxy-nginx-1 -cmd="nginx -t && service nginx reload"]: "websocket: close 1000 (normal)"
DEBU[0181] Notify cmd output: "Executing [nginx -t && service nginx reload] on container [rgon-proxy-nginx-1]\nnginx: invalid option: \"&&\"\r\nwebsocket: close 1000 (normal)\n"

Travis

Add travis.ci for testing and deployment

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.