{"action":"created","comment":{"url":"https://api.github.com/repos/KostyaSha/yet-another-docker-plugin/pulls/comments/47452138","id":47452138,"diff_hunk":"@@ -0,0 +1,195 @@\n+package com.github.kostyasha.it;\n+\n+import com.github.kostyasha.it.rule.DockerRule;\n+import com.github.kostyasha.yad.DockerCloud;\n+import com.github.kostyasha.yad.DockerConnector;\n+import com.github.kostyasha.yad.DockerSlaveTemplate;\n+import com.github.kostyasha.yad.docker_java.com.github.dockerjava.api.command.CreateContainerCmd;\n+import com.github.kostyasha.yad.docker_java.com.github.dockerjava.api.command.InspectContainerResponse;\n+import com.github.kostyasha.yad.launcher.DockerComputerJNLPLauncher;\n+import com.github.kostyasha.yad.strategy.DockerOnceRetentionStrategy;\n+import hudson.cli.CLI;\n+import hudson.model.FreeStyleProject;\n+import hudson.model.Node;\n+import hudson.remoting.Callable;\n+import hudson.remoting.Channel;\n+import hudson.slaves.Cloud;\n+import hudson.slaves.JNLPLauncher;\n+import hudson.tasks.Shell;\n+import jenkins.model.Jenkins;\n+import org.jenkinsci.remoting.RoleChecker;\n+import org.junit.ClassRule;\n+import org.junit.Test;\n+import org.slf4j.Logger;\n+import org.slf4j.LoggerFactory;\n+\n+import java.io.Serializable;\n+import java.util.ArrayList;\n+import java.util.HashMap;\n+import java.util.Map;\n+\n+import static com.github.kostyasha.it.utils.JenkinsContainerUtil.createCliForInspect;\n+\n+/**\n+ * @author Kanstantsin Shautsou\n+ */\n+public class SomeTest implements Serializable {\n+    private static final long serialVersionUID = 1L;\n+    private static final Logger LOG = LoggerFactory.getLogger(SomeTest.class);\n+\n+    Map<String, String> labels = new HashMap<String, String>() {{\n+        put(SomeTest.class.getPackage().getName(), SomeTest.class.getName());\n+    }};\n+\n+    String imageName = \"jenkins:1.609.3\";\n+\n+    @ClassRule\n+    public static DockerRule d = new DockerRule(false);\n+\n+    @Test\n+    public void dockerCloudDescriptorMissing() throws Exception {\n+        // mark test method\n+        CreateContainerCmd createCmd = d.cli.createContainerCmd(imageName)\n+                .withPublishAllPorts(true)\n+                .withLabels(labels);\n+\n+        d.pullImage(imageName);\n+        final String id = d.createFreshJenkinsContainer(createCmd, true);\n+\n+        d.cli.startContainerCmd(id).exec();\n+        final InspectContainerResponse inspect = d.cli.inspectContainerCmd(id).exec();\n+        //TODO why CLI not Closeable?\n+        final CLI cli = createCliForInspect(inspect, d);\n+        cli.upgrade();\n+\n+        try (Channel channel = cli.getChannel()) {\n+            LOG.info(\"Remoteclassloading allowed {}\", channel.isRemoteClassLoadingAllowed());\n+\n+            LOG.info(\"Descriptor for Shell {}\",\n+                    channel.call(new CloudToStringCallable(){\n+                        @Override\n+                        public String call() throws Exception {\n+                            final Shell shell = new Shell(\"\");\n+                            // works\n+                            return shell.getDescriptor().toString();\n+                        }\n+                    }));\n+\n+            LOG.info(\"DockerCloud Descriptor: {}\",\n+                    channel.call(new CloudToStringCallable(){\n+                        @Override\n+                        public String call() throws Exception {\n+                            final DockerCloud dockerCloud = new DockerCloud(null, null, 0, null);\n+                            // fails\n+                            return dockerCloud.getDescriptor().toString();","path":"yet-another-docker-its/src/main/java/com/github/kostyasha/it/SomeTest.java","position":84,"original_position":84,"commit_id":"44072d8aa7cf75f8f8789a4f8dd1768452cf20c1","original_commit_id":"44072d8aa7cf75f8f8789a4f8dd1768452cf20c1","user":{"login":"KostyaSha","id":231611,"avatar_url":"https://avatars.githubusercontent.com/u/231611?v=3","gravatar_id":"","url":"https://api.github.com/users/KostyaSha","html_url":"https://github.com/KostyaSha","followers_url":"https://api.github.com/users/KostyaSha/followers","following_url":"https://api.github.com/users/KostyaSha/following{/other_user}","gists_url":"https://api.github.com/users/KostyaSha/gists{/gist_id}","starred_url":"https://api.github.com/users/KostyaSha/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KostyaSha/subscriptions","organizations_url":"https://api.github.com/users/KostyaSha/orgs","repos_url":"https://api.github.com/users/KostyaSha/repos","events_url":"https://api.github.com/users/KostyaSha/events{/privacy}","received_events_url":"https://api.github.com/users/KostyaSha/received_events","type":"User","site_admin":false},"body":"I remember your words https://groups.google.com/d/msg/jenkinsci-dev/R2_tHJDF0KI/VyaqEUn2AgAJ is it possible somehow replace classloader on remote CLI side or i must implement own hole in jenkins? :(\r\n\r\n","created_at":"2015-12-13T23:07:30Z","updated_at":"2015-12-13T23:07:30Z","html_url":"https://github.com/KostyaSha/yet-another-docker-plugin/pull/8#discussion_r47452138","pull_request_url":"https://api.github.com/repos/KostyaSha/yet-another-docker-plugin/pulls/8","_links":{"self":{"href":"https://api.github.com/repos/KostyaSha/yet-another-docker-plugin/pulls/comments/47452138"},"html":{"href":"https://github.com/KostyaSha/yet-another-docker-plugin/pull/8#discussion_r47452138"},"pull_request":{"href":"https://api.github.com/repos/KostyaSha/yet-another-docker-plugin/pulls/8"}}},"pull_request":{"url":"https://api.github.com/repos/KostyaSha/yet-another-docker-plugin/pulls/8","id":53197949,"html_url":"https://github.com/KostyaSha/yet-another-docker-plugin/pull/8","diff_url":"https://github.com/KostyaSha/yet-another-docker-plugin/pull/8.diff","patch_url":"https://github.com/KostyaSha/yet-another-docker-plugin/pull/8.patch","issue_url":"https://api.github.com/repos/KostyaSha/yet-another-docker-plugin/issues/8","number":8,"state":"open","locked":false,"title":"[WIP] integration tests","user":{"login":"KostyaSha","id":231611,"avatar_url":"https://avatars.githubusercontent.com/u/231611?v=3","gravatar_id":"","url":"https://api.github.com/users/KostyaSha","html_url":"https://github.com/KostyaSha","followers_url":"https://api.github.com/users/KostyaSha/followers","following_url":"https://api.github.com/users/KostyaSha/following{/other_user}","gists_url":"https://api.github.com/users/KostyaSha/gists{/gist_id}","starred_url":"https://api.github.com/users/KostyaSha/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KostyaSha/subscriptions","organizations_url":"https://api.github.com/users/KostyaSha/orgs","repos_url":"https://api.github.com/users/KostyaSha/repos","events_url":"https://api.github.com/users/KostyaSha/events{/privacy}","received_events_url":"https://api.github.com/users/KostyaSha/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-12-10T00:07:05Z","updated_at":"2015-12-13T23:07:30Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d53ecdf707b0f0549c6d511a9d01a6461d67b080","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/KostyaSha/yet-another-docker-plugin/pulls/8/commits","review_comments_url":"https://api.github.com/repos/KostyaSha/yet-another-docker-plugin/pulls/8/comments","review_comment_url":"https://api.github.com/repos/KostyaSha/yet-another-docker-plugin/pulls/comments{/number}","comments_url":"https://api.github.com/repos/KostyaSha/yet-another-docker-plugin/issues/8/comments","statuses_url":"https://api.github.com/repos/KostyaSha/yet-another-docker-plugin/statuses/44072d8aa7cf75f8f8789a4f8dd1768452cf20c1","head":{"label":"KostyaSha:its","ref":"its","sha":"44072d8aa7cf75f8f8789a4f8dd1768452cf20c1","user":{"login":"KostyaSha","id":231611,"avatar_url":"https://avatars.githubusercontent.com/u/231611?v=3","gravatar_id":"","url":"https://api.github.com/users/KostyaSha","html_url":"https://github.com/KostyaSha","followers_url":"https://api.github.com/users/KostyaSha/followers","following_url":"https://api.github.com/users/KostyaSha/following{/other_user}","gists_url":"https://api.github.com/users/KostyaSha/gists{/gist_id}","starred_url":"https://api.github.com/users/KostyaSha/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KostyaSha/subscriptions","organizations_url":"https://api.github.com/users/KostyaSha/orgs","repos_url":"https://api.github.com/users/KostyaSha/repos","events_url":"https://api.github.com/users/KostyaSha/events{/privacy}","received_events_url":"https://api.github.com/users/KostyaSha/received_events","type":"User","site_admin":false},"repo":{"id":45489191,"name":"yet-another-docker-plugin","full_name":"KostyaSha/yet-another-docker-plugin","owner":{"login":"KostyaSha","id":231611,"avatar_url":"https://avatars.githubusercontent.com/u/231611?v=3","gravatar_id":"","url":"https://api.github.com/users/KostyaSha","html_url":"https://github.com/KostyaSha","followers_url":"https://api.github.com/users/KostyaSha/followers","following_url":"https://api.github.com/users/KostyaSha/following{/other_user}","gists_url":"https://api.github.com/users/KostyaSha/gists{/gist_id}","starred_url":"https://api.github.com/users/KostyaSha/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KostyaSha/subscriptions","organizations_url":"https://api.github.com/users/KostyaSha/orgs","repos_url":"https://api.github.com/users/KostyaSha/repos","events_url":"https://api.github.com/users/KostyaSha/events{/privacy}","received_events_url":"https://api.github.com/users/KostyaSha/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/KostyaSha/yet-another-docker-plugin","description":"","fork":false,"url":"https://api.github.com/repos/KostyaSha/yet-another-docker-plugin","forks_url":"https://api.github.com/repos/KostyaSha/yet-another-docker-plugin/forks","keys_url":"https://api.github.com/repos/KostyaSha/yet-another-docker-plugin/keys{/key_id}","collaborators_url":"https://api.github.com/repos/KostyaSha/yet-another-docker-plugin/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/KostyaSha/yet-another-docker-plugin/teams","hooks_url":"https://api.github.com/repos/KostyaSha/yet-another-docker-plugin/hooks","issue_events_url":"https://api.github.com/repos/KostyaSha/yet-another-docker-plugin/issues/events{/number}","events_url":"https://api.github.com/repos/KostyaSha/yet-another-docker-plugin/events","assignees_url":"https://api.github.com/repos/KostyaSha/yet-another-docker-plugin/assignees{/user}","branches_url":"https://api.github.com/repos/KostyaSha/yet-another-docker-plugin/branches{/branch}","tags_url":"https://api.github.com/repos/KostyaSha/yet-another-docker-plugin/tags","blobs_url":"https://api.github.com/repos/KostyaSha/yet-another-docker-plugin/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/KostyaSha/yet-another-docker-plugin/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/KostyaSha/yet-another-docker-plugin/git/refs{/sha}","trees_url":"https://api.github.com/repos/KostyaSha/yet-another-docker-plugin/git/trees{/sha}","statuses_url":"https://api.github.com/repos/KostyaSha/yet-another-docker-plugin/statuses/{sha}","languages_url":"https://api.github.com/repos/KostyaSha/yet-another-docker-plugin/languages","stargazers_url":"https://api.github.com/repos/KostyaSha/yet-another-docker-plugin/stargazers","contributors_url":"https://api.github.com/repos/KostyaSha/yet-another-docker-plugin/contributors","subscribers_url":"https://api.github.com/repos/KostyaSha/yet-another-docker-plugin/subscribers","subscription_url":"https://api.github.com/repos/KostyaSha/yet-another-docker-plugin/subscription","commits_url":"https://api.github.com/repos/KostyaSha/yet-another-docker-plugin/commits{/sha}","git_commits_url":"https://api.github.com/repos/KostyaSha/yet-another-docker-plugin/git/commits{/sha}","comments_url":"https://api.github.com/repos/KostyaSha/yet-another-docker-plugin/comments{/number}","issue_comment_url":"https://api.github.com/repos/KostyaSha/yet-another-docker-plugin/issues/comments{/number}","contents_url":"https://api.github.com/repos/KostyaSha/yet-another-docker-plugin/contents/{+path}","compare_url":"https://api.github.com/repos/KostyaSha/yet-another-docker-plugin/compare/{base}...{head}","merges_url":"https://api.github.com/repos/KostyaSha/yet-another-docker-plugin/merges","archive_url":"https://api.github.com/repos/KostyaSha/yet-another-docker-plugin/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/KostyaSha/yet-another-docker-plugin/downloads","issues_url":"https://api.github.com/repos/KostyaSha/yet-another-docker-plugin/issues{/number}","pulls_url":"https://api.github.com/repos/KostyaSha/yet-another-docker-plugin/pulls{/number}","milestones_url":"https://api.github.com/repos/KostyaSha/yet-another-docker-plugin/milestones{/number}","notifications_url":"https://api.github.com/repos/KostyaSha/yet-another-docker-plugin/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/KostyaSha/yet-another-docker-plugin/labels{/name}","releases_url":"https://api.github.com/repos/KostyaSha/yet-another-docker-plugin/releases{/id}","created_at":"2015-11-03T19:08:26Z","updated_at":"2015-12-07T21:22:17Z","pushed_at":"2015-12-13T20:27:48Z","git_url":"git://github.com/KostyaSha/yet-another-docker-plugin.git","ssh_url":"git@github.com:KostyaSha/yet-another-docker-plugin.git","clone_url":"https://github.com/KostyaSha/yet-another-docker-plugin.git","svn_url":"https://github.com/KostyaSha/yet-another-docker-plugin","homepage":null,"size":105,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":7,"forks":0,"open_issues":7,"watchers":0,"default_branch":"master"}},"base":{"label":"KostyaSha:master","ref":"master","sha":"8062f8d799b3e7956416a93388a3d9ebaddec925","user":{"login":"KostyaSha","id":231611,"avatar_url":"https://avatars.githubusercontent.com/u/231611?v=3","gravatar_id":"","url":"https://api.github.com/users/KostyaSha","html_url":"https://github.com/KostyaSha","followers_url":"https://api.github.com/users/KostyaSha/followers","following_url":"https://api.github.com/users/KostyaSha/following{/other_user}","gists_url":"https://api.github.com/users/KostyaSha/gists{/gist_id}","starred_url":"https://api.github.com/users/KostyaSha/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KostyaSha/subscriptions","organizations_url":"https://api.github.com/users/KostyaSha/orgs","repos_url":"https://api.github.com/users/KostyaSha/repos","events_url":"https://api.github.com/users/KostyaSha/events{/privacy}","received_events_url":"https://api.github.com/users/KostyaSha/received_events","type":"User","site_admin":false},"repo":{"id":45489191,"name":"yet-another-docker-plugin","full_name":"KostyaSha/yet-another-docker-plugin","owner":{"login":"KostyaSha","id":231611,"avatar_url":"https://avatars.githubusercontent.com/u/231611?v=3","gravatar_id":"","url":"https://api.github.com/users/KostyaSha","html_url":"https://github.com/KostyaSha","followers_url":"https://api.github.com/users/KostyaSha/followers","following_url":"https://api.github.com/users/KostyaSha/following{/other_user}","gists_url":"https://api.github.com/users/KostyaSha/gists{/gist_id}","starred_url":"https://api.github.com/users/KostyaSha/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KostyaSha/subscriptions","organizations_url":"https://api.github.com/users/KostyaSha/orgs","repos_url":"https://api.github.com/users/KostyaSha/repos","events_url":"https://api.github.com/users/KostyaSha/events{/privacy}","received_events_url":"https://api.github.com/users/KostyaSha/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/KostyaSha/yet-another-docker-plugin","description":"","fork":false,"url":"https://api.github.com/repos/KostyaSha/yet-another-docker-plugin","forks_url":"https://api.github.com/repos/KostyaSha/yet-another-docker-plugin/forks","keys_url":"https://api.github.com/repos/KostyaSha/yet-another-docker-plugin/keys{/key_id}","collaborators_url":"https://api.github.com/repos/KostyaSha/yet-another-docker-plugin/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/KostyaSha/yet-another-docker-plugin/teams","hooks_url":"https://api.github.com/repos/KostyaSha/yet-another-docker-plugin/hooks","issue_events_url":"https://api.github.com/repos/KostyaSha/yet-another-docker-plugin/issues/events{/number}","events_url":"https://api.github.com/repos/KostyaSha/yet-another-docker-plugin/events","assignees_url":"https://api.github.com/repos/KostyaSha/yet-another-docker-plugin/assignees{/user}","branches_url":"https://api.github.com/repos/KostyaSha/yet-another-docker-plugin/branches{/branch}","tags_url":"https://api.github.com/repos/KostyaSha/yet-another-docker-plugin/tags","blobs_url":"https://api.github.com/repos/KostyaSha/yet-another-docker-plugin/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/KostyaSha/yet-another-docker-plugin/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/KostyaSha/yet-another-docker-plugin/git/refs{/sha}","trees_url":"https://api.github.com/repos/KostyaSha/yet-another-docker-plugin/git/trees{/sha}","statuses_url":"https://api.github.com/repos/KostyaSha/yet-another-docker-plugin/statuses/{sha}","languages_url":"https://api.github.com/repos/KostyaSha/yet-another-docker-plugin/languages","stargazers_url":"https://api.github.com/repos/KostyaSha/yet-another-docker-plugin/stargazers","contributors_url":"https://api.github.com/repos/KostyaSha/yet-another-docker-plugin/contributors","subscribers_url":"https://api.github.com/repos/KostyaSha/yet-another-docker-plugin/subscribers","subscription_url":"https://api.github.com/repos/KostyaSha/yet-another-docker-plugin/subscription","commits_url":"https://api.github.com/repos/KostyaSha/yet-another-docker-plugin/commits{/sha}","git_commits_url":"https://api.github.com/repos/KostyaSha/yet-another-docker-plugin/git/commits{/sha}","comments_url":"https://api.github.com/repos/KostyaSha/yet-another-docker-plugin/comments{/number}","issue_comment_url":"https://api.github.com/repos/KostyaSha/yet-another-docker-plugin/issues/comments{/number}","contents_url":"https://api.github.com/repos/KostyaSha/yet-another-docker-plugin/contents/{+path}","compare_url":"https://api.github.com/repos/KostyaSha/yet-another-docker-plugin/compare/{base}...{head}","merges_url":"https://api.github.com/repos/KostyaSha/yet-another-docker-plugin/merges","archive_url":"https://api.github.com/repos/KostyaSha/yet-another-docker-plugin/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/KostyaSha/yet-another-docker-plugin/downloads","issues_url":"https://api.github.com/repos/KostyaSha/yet-another-docker-plugin/issues{/number}","pulls_url":"https://api.github.com/repos/KostyaSha/yet-another-docker-plugin/pulls{/number}","milestones_url":"https://api.github.com/repos/KostyaSha/yet-another-docker-plugin/milestones{/number}","notifications_url":"https://api.github.com/repos/KostyaSha/yet-another-docker-plugin/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/KostyaSha/yet-another-docker-plugin/labels{/name}","releases_url":"https://api.github.com/repos/KostyaSha/yet-another-docker-plugin/releases{/id}","created_at":"2015-11-03T19:08:26Z","updated_at":"2015-12-07T21:22:17Z","pushed_at":"2015-12-13T20:27:48Z","git_url":"git://github.com/KostyaSha/yet-another-docker-plugin.git","ssh_url":"git@github.com:KostyaSha/yet-another-docker-plugin.git","clone_url":"https://github.com/KostyaSha/yet-another-docker-plugin.git","svn_url":"https://github.com/KostyaSha/yet-another-docker-plugin","homepage":null,"size":105,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":7,"forks":0,"open_issues":7,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/KostyaSha/yet-another-docker-plugin/pulls/8"},"html":{"href":"https://github.com/KostyaSha/yet-another-docker-plugin/pull/8"},"issue":{"href":"https://api.github.com/repos/KostyaSha/yet-another-docker-plugin/issues/8"},"comments":{"href":"https://api.github.com/repos/KostyaSha/yet-another-docker-plugin/issues/8/comments"},"review_comments":{"href":"https://api.github.com/repos/KostyaSha/yet-another-docker-plugin/pulls/8/comments"},"review_comment":{"href":"https://api.github.com/repos/KostyaSha/yet-another-docker-plugin/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/KostyaSha/yet-another-docker-plugin/pulls/8/commits"},"statuses":{"href":"https://api.github.com/repos/KostyaSha/yet-another-docker-plugin/statuses/44072d8aa7cf75f8f8789a4f8dd1768452cf20c1"}}}}