Skip to content

Commit

Permalink
Add optional parameter to disable cookie
Browse files Browse the repository at this point in the history
Add a optional parameter OCI_DISABLE_COOKIE to set the http client cookie jar to nil.
This parameter can disable save cookies in api contacting.

Signed-off-by: wang yan <[email protected]>
  • Loading branch information
wy65701436 committed Apr 24, 2020
1 parent d763ec8 commit 823a56f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions conformance/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export OCI_NAMESPACE="myorg/myrepo"
export OCI_USERNAME="myuser"
export OCI_PASSWORD="mypass"
export OCI_DEBUG="true"
export OCI_DISABLE_COOKIE="true"
```

Lastly, run the tests:
Expand Down Expand Up @@ -157,6 +158,7 @@ docker run --rm \
-e OCI_USERNAME="myuser" \
-e OCI_PASSWORD="mypass" \
-e OCI_DEBUG="true" \
-e OCI_DISABLE_COOKIE="true" \
conformance:latest
```

Expand Down
4 changes: 4 additions & 0 deletions conformance/setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ func init() {
password := os.Getenv("OCI_PASSWORD")
authScope := os.Getenv(envVarAuthScope)
debug := os.Getenv("OCI_DEBUG") == "true"
disableCookie := os.Getenv("OCI_DISABLE_COOKIE") == "true"

for envVar, enableTest := range testMap {
if os.Getenv(envVar) == envTrue {
Expand All @@ -152,6 +153,9 @@ func init() {
}

client.SetLogger(logger)
if disableCookie {
client.SetCookieJar(nil)
}

config := imagespec.Image{
Architecture: "amd64",
Expand Down

0 comments on commit 823a56f

Please sign in to comment.