-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Provide a client method to bypass server side timeout on upload
- Loading branch information
1 parent
f370159
commit 6dc1369
Showing
4 changed files
with
45 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
...ed/internalclientset/typed/image/internalversion/fake/fake_imagestreamimport_expansion.go
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
2 changes: 0 additions & 2 deletions
2
pkg/image/generated/internalclientset/typed/image/internalversion/generated_expansion.go
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
26 changes: 26 additions & 0 deletions
26
...ge/generated/internalclientset/typed/image/internalversion/imagestreamimport_expansion.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package internalversion | ||
|
||
import ( | ||
"time" | ||
|
||
image "github.com/openshift/origin/pkg/image/apis/image" | ||
) | ||
|
||
type ImageStreamImportExpansion interface { | ||
CreateWithoutTimeout(*image.ImageStreamImport) (*image.ImageStreamImport, error) | ||
} | ||
|
||
// CreateWithoutTimeout imports the provided images and won't time out after 30 seconds. Use this when you must | ||
// import a large number of images. | ||
func (c *imageStreamImports) CreateWithoutTimeout(imageStreamImport *image.ImageStreamImport) (result *image.ImageStreamImport, err error) { | ||
result = &image.ImageStreamImport{} | ||
err = c.client.Post(). | ||
Namespace(c.ns). | ||
Resource("imagestreamimports"). | ||
Body(imageStreamImport). | ||
// this instructs the api server to allow our request to take up to an hour - chosen as a high boundary | ||
Timeout(time.Hour). | ||
Do(). | ||
Into(result) | ||
return | ||
} |