8000 docker/tags_unit_test.go at v0.7.5 · tonistiigi/docker · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
{"payload":{"allShortcutsEnabled":false,"fileTree":{"":{"items":[{"name":"archive","path":"archive","contentType":"directory"},{"name":"auth","path":"auth","contentType":"directory"},{"name":"cgroups","path":"cgroups","contentType":"directory"},{"name":"contrib","path":"contrib","contentType":"directory"},{"name":"docker","path":"docker","contentType":"directory"},{"name":"dockerinit","path":"dockerinit","contentType":"directory"},{"name":"docs","path":"docs","contentType":"directory"},{"name":"engine","path":"engine","contentType":"directory"},{"name":"graphdriver","path":"graphdriver","contentType":"directory"},{"name":"hack","path":"hack","contentType":"directory"},{"name":"integration","path":"integration","contentType":"directory"},{"name":"mount","path":"mount","contentType":"directory"},{"name":"pkg","path":"pkg","contentType":"directory"},{"name":"proxy","path":"proxy","contentType":"directory"},{"name":"registry","path":"registry","contentType":"directory"},{"name":"sysinit","path":"sysinit","contentType":"directory"},{"name":"utils","path":"utils","contentType":"directory"},{"name":"vendor","path":"vendor","contentType":"directory"},{"name":".gitignore","path":".gitignore","contentType":"file"},{"name":".mailmap","path":".mailmap","contentType":"file"},{"name":".travis.yml","path":".travis.yml","contentType":"file"},{"name":"AUTHORS","path":"AUTHORS","contentType":"file"},{"name":"CHANGELOG.md","path":"CHANGELOG.md","contentType":"file"},{"name":"CONTRIBUTING.md","path":"CONTRIBUTING.md","contentType":"file"},{"name":"Dockerfile","path":"Dockerfile","contentType":"file"},{"name":"FIXME","path":"FIXME","contentType":"file"},{"name":"LICENSE","path":"LICENSE","contentType":"file"},{"name":"MAINTAINERS","path":"MAINTAINERS","contentType":"file"},{"name":"Makefile","path":"Makefile","contentType":"file"},{"name":"NOTICE","path":"NOTICE","contentType":"file"},{"name":"README.md","path":"README.md","contentType":"file"},{"name":"REMOTE_TODO.md","path":"REMOTE_TODO.md","contentType":"file"},{"name":"VERSION","path":"VERSION","contentType":"file"},{"name":"Vagrantfile","path":"Vagrantfile","contentType":"file"},{"name":"api.go","path":"api.go","contentType":"file"},{"name":"api_params.go","path":"api_params.go","contentType":"file"},{"name":"api_unit_test.go","path":"api_unit_test.go","contentType":"file"},{"name":"buildfile.go","path":"buildfile.go","contentType":"file"},{"name":"commands.go","path":"commands.go","contentType":"file"},{"name":"commands_unit_test.go","path":"commands_unit_test.go","contentType":"file"},{"name":"config.go","path":"config.go","contentType":"file"},{"name":"config_test.go","path":"config_test.go","contentType":"file"},{"name":"container.go","path":"container.go","contentType":"file"},{"name":"container_unit_test.go","path":"container_unit_test.go","contentType":"file"},{"name":"graph.go","path":"graph.go","contentType":"file"},{"name":"http_test.go","path":"http_test.go","contentType":"file"},{"name":"image.go","path":"image.go","contentType":"file"},{"name":"links.go","path":"links.go","contentType":"file"},{"name":"links_test.go","path":"links_test.go","contentType":"file"},{"name":"lxc_template.go","path":"lxc_template.go","contentType":"file"},{"name":"lxc_template_unit_test.go","path":"lxc_template_unit_test.go","contentType":"file"},{"name":"network.go","path":"network.go","contentType":"file"},{"name":"network_test.go","path":"network_test.go","contentType":"file"},{"name":"opts.go","path":"opts.go","contentType":"file"},{"name":"opts_unit_test.go","path":"opts_unit_test.go","contentType":"file"},{"name":"reflink_copy_darwin.go","path":"reflink_copy_darwin.go","contentType":"file"},{"name":"reflink_copy_linux.go","path":"reflink_copy_linux.go","contentType":"file"},{"name":"runtime.go","path":"runtime.go","contentType":"file"},{"name":"server.go","path":"server.go","contentType":"file"},{"name":"server_unit_test.go","path":"server_unit_test.go","contentType":"file"},{"name":"sorter.go","path":"sorter.go","contentType":"file"},{"name":"sorter_unit_test.go","path":"sorter_unit_test.go","contentType":"file"},{"name":"state.go","path":"state.go","contentType":"file"},{"name":"tags.go","path":"tags.go","contentType":"file"},{"name":"tags_unit_test.go","path":"tags_unit_test.go","contentType":"file"},{"name":"utils.go","path":"utils.go","contentType":"file"},{"name":"utils_test.go","path":"utils_test.go","contentType":"file"},{"name":"version.go","path":"version.go","contentType":"file"}],"totalCount":68}},"fileTreeProcessingTime":8.929159,"foldersToFetch":[],"incompleteFileTree":false,"repo":{"id":19074395,"defaultBranch":"master","name":"docker","ownerLogin":"tonistiigi","currentUserCanPush":false,"isFork":true,"isEmpty":false,"createdAt":"2014-04-23T15:15:03.000Z","ownerAvatar":"https://avatars.githubusercontent.com/u/585223?v=4","public":true,"private":false,"isOrgOwned":false},"codeLineWrapEnabled":false,"symbolsExpanded":false,"treeExpanded":true,"refInfo":{"name":"v0.7.5","listCacheKey":"v0:1747268197.0","canEdit":false,"refType":"tag","currentOid":"c348c04fdfb00e013be9db15d37728e04fb94b76"},"path":"tags_unit_test.go","currentUser":null,"blob":{"rawLines":["package docker","","import (","\t\"github.com/dotcloud/docker/graphdriver\"","\t\"github.com/dotcloud/docker/utils\"","\t\"os\"","\t\"path\"","\t\"testing\"",")","","const (","\ttestImageName = \"myapp\"","\ttestImageID = \"foo\"",")","","func mkTestTagStore(root string, t *testing.T) *TagStore {","\tdriver, err := graphdriver.New(root)","\tif err != nil {","\t\tt.Fatal(err)","\t}","\tgraph, err := NewGraph(root, driver)","\tif err != nil {","\t\tt.Fatal(err)","\t}","\tstore, err := NewTagStore(path.Join(root, \"tags\"), graph)","\tif err != nil {","\t\tt.Fatal(err)","\t}","\tarchive, err := fakeTar()","\tif err != nil {","\t\tt.Fatal(err)","\t}","\timg := \u0026Image{ID: testImageID}","\tif err := graph.Register(nil, archive, img); err != nil {","\t\tt.Fatal(err)","\t}","\tif err := store.Set(testImageName, \"\", testImageID, false); err != nil {","\t\tt.Fatal(err)","\t}","\treturn store","}","","func TestLookupImage(t *testing.T) {","\ttmp, err := utils.TestDirectory(\"\")","\tif err != nil {","\t\tt.Fatal(err)","\t}","\tdefer os.RemoveAll(tmp)","\tstore := mkTestTagStore(tmp, t)","\tdefer store.graph.driver.Cleanup()","","\tif img, err := store.LookupImage(testImageName); err != nil {","\t\tt.Fatal(err)","\t} else if img == nil {","\t\tt.Errorf(\"Expected 1 image, none found\")","\t}","\tif img, err := store.LookupImage(testImageName + \":\" + DEFAULTTAG); err != nil {","\t\tt.Fatal(err)","\t} else if img == nil {","\t\tt.Errorf(\"Expected 1 image, none found\")","\t}","","\tif img, err := store.LookupImage(testImageName + \":\" + \"fail\"); err == nil {","\t\tt.Errorf(\"Expected error, none found\")","\t} else if img != nil {","\t\tt.Errorf(\"Expected 0 image, 1 found\")","\t}","","\tif img, err := store.LookupImage(\"fail:fail\"); err == nil {","\t\tt.Errorf(\"Expected error, none found\")","\t} else if img != nil {","\t\tt.Errorf(\"Expected 0 image, 1 found\")","\t}","","\tif img, err := store.LookupImage(testImageID); err != nil {","\t\tt.Fatal(err)","\t} else if img == nil {","\t\tt.Errorf(\"Expected 1 image, none found\")","\t}","","\tif img, err := store.LookupImage(testImageName + \":\" + testImageID); err != nil {","\t\tt.Fatal(err)","\t} else if img == nil {","\t\tt.Errorf(\"Expected 1 image, none found\")","\t}","}"],"stylingDirectives":null,"colorizedLines":null,"csv":null,"csvError":null,"dependabotInfo":{"showConfigurationBanner":false,"configFilePath":null,"networkDependabotPath":"/tonistiigi/docker/network/updates","dismissConfigurationNoticePath":"/settings/dismiss-notice/dependabot_configuration_notice","configurationNoticeDismissed":null},"displayName":"tags_unit_test.go","displayUrl":"https://github.com/tonistiigi/docker/blob/v0.7.5/tags_unit_test.go?raw=true","headerInfo":{"blobSize":"1.92 KB","deleteTooltip":"You must be signed in to make or propose changes","editTooltip":"You must be signed in to make or propose changes","ghDesktopPath":null,"isGitLfs":false,"onBranch":false,"shortPath":"1341b98","siteNavLoginPath":"/login?return_to=https%3A%2F%2Fgithub.com%2Ftonistiigi%2Fdocker%2Fblob%2Fv0.7.5%2Ftags_unit_test.go","isCSV":false,"isRichtext":false,"toc":null,"lineInfo":{"truncatedLoc":"86","truncatedSloc":"77"},"mode":"file"},"image":false,"isCodeownersFile":null,"isPlain":false,"isValidLegacyIssueTemplate":false,"issueTemplate":null,"discussionTemplate":null,"language":"Go","languageID":132,"large":false,"planSupportInfo":{"repoIsFork":null,"repoOwnedByCurrentUser":null,"requestFullPath":"/tonistiigi/docker/blob/v0.7.5/tags_unit_test.go","showFreeOrgGatedFeatureMessage":null,"showPlanSupportBanner":null,"upgradeDataAttributes":null,"upgradePath":null},"publishBannersInfo":{"dismissActionNoticePath":"/settings/dismiss-notice/publish_action_from_dockerfile","releasePath":"/tonistiigi/docker/releases/new?marketplace=true","showPublishActionBanner":false},"rawBlobUrl":"https://github.com/tonistiigi/docker/raw/refs/tags/v0.7.5/tags_unit_test.go","renderImageOrRaw":false,"richText":null,"renderedFileInfo":null,"shortPath":null,"symbolsEnabled":true,"tabSize":8,"topBannersInfo":{"overridingGlobalFundingFile":false,"globalPreferredFundingPath":null,"showInvalidCitationWarning":false,"citationHelpUrl":"https://docs.github.com/github/creating-cloning-and-archiving-repositories/creating-a-repository-on-github/about-citation-files","actionsOnboardingTip":null},"truncated":false,"viewable":true,"workflowRedirectUrl":null,"symbols":{"timed_out":false,"not_analyzed":false,"symbols":[{"name":"testImageName","kind":"constant","ident_start":140,"ident_end":153,"extent_start":156,"extent_end":163,"fully_qualified_name":"testImageName","ident_utf16":{"start":{"line_number":11,"utf16_col":1},"end":{"line_number":11,"utf16_col":14}},"extent_utf16":{"start":{"line_number":11,"utf16_col":17},"end":{"line_number":11,"utf16_col":24}}},{"name":"testImageID","kind":"constant","ident_start":165,"ident_end":176,"extent_start":181,"extent_end":186,"fully_qualified_name":"testImageID","ident_utf16":{"start":{"line_number":12,"utf16_col":1},"end":{"line_number":12,"utf16_col":12}},"extent_utf16":{"start":{"line_number":12,"utf16_col":17},"end":{"line_number":12,"utf16_col":22}}},{"name":"mkTestTagStore","kind":"function","ident_start":195,"ident_end":209,"extent_start":190,"extent_end":767,"fully_qualified_name":"mkTestTagStore","ident_utf16":{"start":{"line_number":15,"utf16_col":5},"end":{"line_number":15,"utf16_col":19}},"extent_utf16":{"start":{"line_number":15,"utf16_col":0},"end":{"line_number":40,"utf16_col":1}}},{"name":"TestLookupImage","kind":"function","ident_start":774,"ident_end":789,"extent_start":769,"extent_end":1962,"fully_qualified_name":"TestLookupImage","ident_utf16":{"start":{"line_number":42,"utf16_col":5},"end":{"line_number":42,"utf16_col":20}},"extent_utf16":{"start":{"line_number":42,"utf16_col":0},"end":{"line_number":85,"utf16_col":1}}}]}},"copilotInfo":null,"copilotAccessAllowed":false,"modelsAccessAllowed":false,"modelsRepoIntegrationEnabled":false,"csrf_tokens":{"/tonistiigi/docker/branches":{"post":"HUoHHywWTfkMjPfvZYL05H7VB4n_bGCZ36NYSomuGKFPLj6k_a1m43CmXGT-Jnr6kUODu3dWDFkMc1jxHL4gww"},"/repos/preferences":{"post":"-BkZQhevmgMx2T3RBdB_vHIIrhrndLUgLcE1J3ZP0cWjdHjIH9UIVfd9jtB7G_OfFuND85PbDQVG9N5ZIIjSpQ"}}},"title":"docker/tags_unit_test.go at v0.7.5 · tonistiigi/docker","appPayload":{"helpUrl":"https://docs.github.com","findFileWorkerPath":"/assets-cdn/worker/find-file-worker-7d7eb7c71814.js","findInFileWorkerPath":"/assets-cdn/worker/find-in-file-worker-1ae9fa256942.js","githubDevUrl":null,"enabled_features":{"code_nav_ui_events":false,"react_blob_overlay":false,"accessible_code_button":true,"github_models_repo_integration":false}}}
0