[ARVADOS] updated: 2.1.0-20-g87e3b2dd6
Git user
git at public.arvados.org
Tue Oct 20 20:07:15 UTC 2020
Summary of changes:
lib/controller/localdb/conn.go | 7 ++++---
lib/controller/router/response.go | 21 +++++++++++++++------
sdk/go/arvados/container.go | 17 ++++++++++-------
3 files changed, 29 insertions(+), 16 deletions(-)
via 87e3b2dd69e25bc1fdcf50c0dca623e871bce99b (commit)
from d22acf136643f7324a76a7225491567956baae4c (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
commit 87e3b2dd69e25bc1fdcf50c0dca623e871bce99b
Author: Nico Cesar <nico at nicocesar.com>
Date: Tue Oct 20 16:06:00 2020 -0400
17014: missing fields and rails compat added to CR
Arvados-DCO-1.1-Signed-off-by: <nico at curii.com>
diff --git a/lib/controller/localdb/conn.go b/lib/controller/localdb/conn.go
index ac120c6f3..98ec6d59d 100644
--- a/lib/controller/localdb/conn.go
+++ b/lib/controller/localdb/conn.go
@@ -32,13 +32,14 @@ func NewConn(cluster *arvados.Cluster) *Conn {
}
func (conn *Conn) Logout(ctx context.Context, opts arvados.LogoutOptions) (arvados.LogoutResponse, error) {
- return conn.loginController.Logout(ctx, opts)
+ return conn.railsProxy.Logout(ctx, opts) // REVIEW: will this handle return_to?
}
func (conn *Conn) Login(ctx context.Context, opts arvados.LoginOptions) (arvados.LoginResponse, error) {
- return conn.loginController.Login(ctx, opts)
+ return conn.railsProxy.Login(ctx, opts)
}
func (conn *Conn) UserAuthenticate(ctx context.Context, opts arvados.UserAuthenticateOptions) (arvados.APIClientAuthorization, error) {
- return conn.loginController.UserAuthenticate(ctx, opts)
+ // REVIEW:Should this be conn.railsProxy?
+ return conn.railsProxy.UserAuthenticate(ctx, opts)
}
diff --git a/lib/controller/router/response.go b/lib/controller/router/response.go
index f062da78f..1217d11d0 100644
--- a/lib/controller/router/response.go
+++ b/lib/controller/router/response.go
@@ -107,11 +107,6 @@ func (rtr *router) sendResponse(w http.ResponseWriter, req *http.Request, resp i
}
for k, v := range tmp {
- if k == "output_uuid" {
- if tv == "" {
- tmp[k] = nil
- }
- }
if strings.HasSuffix(k, "_at") {
// Format non-nil timestamps as
// rfc3339NanoFixed (by default they will have
@@ -124,7 +119,11 @@ func (rtr *router) sendResponse(w http.ResponseWriter, req *http.Request, resp i
}
tmp[k] = tv.Format(rfc3339NanoFixed)
case time.Time:
- tmp[k] = tv.Format(rfc3339NanoFixed)
+ if tv.IsZero() {
+ tmp[k] = nil
+ } else {
+ tmp[k] = tv.Format(rfc3339NanoFixed)
+ }
case string:
t, err := time.Parse(time.RFC3339Nano, tv)
if err != nil {
@@ -133,6 +132,16 @@ func (rtr *router) sendResponse(w http.ResponseWriter, req *http.Request, resp i
tmp[k] = t.Format(rfc3339NanoFixed)
}
}
+ switch k {
+ case "output_uuid", "output_name", "log_uuid", "modified_by_client_uuid", "description", "requesting_container_uuid", "expires_at":
+ if v == "" {
+ tmp[k] = nil
+ }
+ case "container_count_max":
+ if v == float64(0) {
+ tmp[k] = nil
+ }
+ }
}
w.Header().Set("Content-Type", "application/json")
enc := json.NewEncoder(w)
diff --git a/sdk/go/arvados/container.go b/sdk/go/arvados/container.go
index 3d08f2235..d97116eab 100644
--- a/sdk/go/arvados/container.go
+++ b/sdk/go/arvados/container.go
@@ -65,6 +65,9 @@ type ContainerRequest struct {
LogUUID string `json:"log_uuid"`
OutputUUID string `json:"output_uuid"`
RuntimeToken string `json:"runtime_token"`
+ ExpiresAt string `json:"expires_at"`
+ Filters []string `json:"filters"`
+ ContainerCount int `json:"container_count"`
}
// Mount is special behavior to attach to a filesystem path or device.
@@ -86,18 +89,18 @@ type Mount struct {
// RuntimeConstraints specify a container's compute resources (RAM,
// CPU) and network connectivity.
type RuntimeConstraints struct {
- API *bool
- RAM int64 `json:"ram"`
- VCPUs int `json:"vcpus"`
- KeepCacheRAM int64 `json:"keep_cache_ram"`
+ API *bool `json:",omitempty"`
+ RAM int64 `json:"ram,omitempty"`
+ VCPUs int `json:"vcpus,omitempty"`
+ KeepCacheRAM int64 `json:"keep_cache_ram,omitempty"`
}
// SchedulingParameters specify a container's scheduling parameters
// such as Partitions
type SchedulingParameters struct {
- Partitions []string `json:"partitions"`
- Preemptible bool `json:"preemptible"`
- MaxRunTime int `json:"max_run_time"`
+ Partitions []string `json:"partitions,omitempty"`
+ Preemptible bool `json:"preemptible,omitempty"`
+ MaxRunTime int `json:"max_run_time,omitempty"`
}
// ContainerList is an arvados#containerList resource.
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list