[ARVADOS] created: 1.3.0-1426-gfdb22c767

Git user git at public.curoverse.com
Tue Jul 30 15:27:40 UTC 2019


        at  fdb22c767bb60ebe931a6a86b2fb812dd2073950 (commit)


commit fdb22c767bb60ebe931a6a86b2fb812dd2073950
Author: Eric Biagiotti <ebiagiotti at veritasgenetics.com>
Date:   Thu Jul 25 17:18:56 2019 -0400

    14813: Adds ClusterID to config export
    
    Arvados-DCO-1.1-Signed-off-by: Eric Biagiotti <ebiagiotti at veritasgenetics.com>

diff --git a/lib/config/export.go b/lib/config/export.go
index 6ff72afcc..ed330454c 100644
--- a/lib/config/export.go
+++ b/lib/config/export.go
@@ -26,6 +26,10 @@ func ExportJSON(w io.Writer, cluster *arvados.Cluster) error {
 	if err != nil {
 		return err
 	}
+
+	// ClusterID is not marshalled by default (see `json:"-"`).
+	// Add it back here so it is included in the exported config.
+	m["ClusterID"] = cluster.ClusterID
 	err = redactUnsafe(m, "", "")
 	if err != nil {
 		return err
@@ -55,62 +59,55 @@ func ExportJSON(w io.Writer, cluster *arvados.Cluster) error {
 // exists.
 var whitelist = map[string]bool{
 	// | sort -t'"' -k2,2
-	"API":                                          true,
-	"API.AsyncPermissionsUpdateInterval":           false,
-	"API.DisabledAPIs":                             false,
-	"API.MaxIndexDatabaseRead":                     false,
-	"API.MaxItemsPerResponse":                      true,
-	"API.MaxRequestAmplification":                  false,
-	"API.MaxRequestSize":                           true,
-	"API.RailsSessionSecretToken":                  false,
-	"API.RequestTimeout":                           true,
-	"API.WebsocketClientEventQueue":                false,
-	"API.SendTimeout":                              true,
-	"API.WebsocketServerEventQueue":                false,
-	"AuditLogs":                                    false,
-	"AuditLogs.MaxAge":                             false,
-	"AuditLogs.MaxDeleteBatch":                     false,
-	"AuditLogs.UnloggedAttributes":                 false,
-	"Collections":                                  true,
-	"Collections.BlobSigning":                      true,
-	"Collections.BlobSigningKey":                   false,
-	"Collections.BlobSigningTTL":                   true,
-	"Collections.CollectionVersioning":             false,
-	"Collections.DefaultReplication":               true,
-	"Collections.DefaultTrashLifetime":             true,
-	"Collections.ManagedProperties":                true,
-	"Collections.ManagedProperties.*":              true,
-	"Collections.ManagedProperties.*.*":            true,
-	"Collections.PreserveVersionIfIdle":            true,
-	"Collections.TrashSweepInterval":               false,
-	"Collections.TrustAllContent":                  false,
-	"Containers":                                   true,
-	"Containers.CloudVMs":                          false,
-	"Containers.CrunchRunCommand":                  false,
-	"Containers.CrunchRunArgumentsList":            false,
-	"Containers.DefaultKeepCacheRAM":               true,
-	"Containers.DispatchPrivateKey":                false,
-	"Containers.JobsAPI":                           true,
-	"Containers.JobsAPI.CrunchJobUser":             false,
-	"Containers.JobsAPI.CrunchJobWrapper":          false,
-	"Containers.JobsAPI.CrunchRefreshTrigger":      false,
-	"Containers.JobsAPI.DefaultDockerImage":        false,
-	"Containers.JobsAPI.Enable":                    true,
-	"Containers.JobsAPI.GitInternalDir":            false,
-	"Containers.JobsAPI.ReuseJobIfOutputsDiffer":   false,
-	"Containers.Logging":                           false,
-	"Containers.LogReuseDecisions":                 false,
-	"Containers.MaxComputeVMs":                     false,
-	"Containers.MaxDispatchAttempts":               false,
-	"Containers.MaxRetryAttempts":                  true,
-	"Containers.MinRetryPeriod":                    true,
-	"Containers.ReserveExtraRAM":                   true,
-	"Containers.SLURM":                             false,
-	"Containers.StaleLockTimeout":                  false,
-	"Containers.SupportedDockerImageFormats":       true,
-	"Containers.SupportedDockerImageFormats.*":     true,
-	"Containers.UsePreemptibleInstances":           true,
-	"EnableBetaController14287":                    false,
+	"ClusterID": true,
+	"API":       true,
+	"API.AsyncPermissionsUpdateInterval":         false,
+	"API.DisabledAPIs":                           false,
+	"API.MaxIndexDatabaseRead":                   false,
+	"API.MaxItemsPerResponse":                    true,
+	"API.MaxRequestAmplification":                false,
+	"API.MaxRequestSize":                         true,
+	"API.RailsSessionSecretToken":                false,
+	"API.RequestTimeout":                         true,
+	"AuditLogs":                                  false,
+	"AuditLogs.MaxAge":                           false,
+	"AuditLogs.MaxDeleteBatch":                   false,
+	"AuditLogs.UnloggedAttributes":               false,
+	"Collections":                                true,
+	"Collections.BlobSigning":                    true,
+	"Collections.BlobSigningKey":                 false,
+	"Collections.BlobSigningTTL":                 true,
+	"Collections.CollectionVersioning":           false,
+	"Collections.DefaultReplication":             true,
+	"Collections.DefaultTrashLifetime":           true,
+	"Collections.ManagedProperties":              true,
+	"Collections.ManagedProperties.*":            true,
+	"Collections.ManagedProperties.*.*":          true,
+	"Collections.PreserveVersionIfIdle":          true,
+	"Collections.TrashSweepInterval":             false,
+	"Collections.TrustAllContent":                false,
+	"Containers":                                 true,
+	"Containers.CloudVMs":                        false,
+	"Containers.DefaultKeepCacheRAM":             true,
+	"Containers.DispatchPrivateKey":              false,
+	"Containers.JobsAPI":                         true,
+	"Containers.JobsAPI.CrunchJobUser":           false,
+	"Containers.JobsAPI.CrunchJobWrapper":        false,
+	"Containers.JobsAPI.CrunchRefreshTrigger":    false,
+	"Containers.JobsAPI.DefaultDockerImage":      false,
+	"Containers.JobsAPI.Enable":                  true,
+	"Containers.JobsAPI.GitInternalDir":          false,
+	"Containers.JobsAPI.ReuseJobIfOutputsDiffer": false,
+	"Containers.Logging":                         false,
+	"Containers.LogReuseDecisions":               false,
+	"Containers.MaxComputeVMs":                   false,
+	"Containers.MaxDispatchAttempts":             false,
+	"Containers.MaxRetryAttempts":                true,
+	"Containers.SLURM":                           false,
+	"Containers.StaleLockTimeout":                false,
+	"Containers.SupportedDockerImageFormats":     true,
+	"Containers.UsePreemptibleInstances":         true,
+	"EnableBetaController14287":                  false,
 	"Git":                                          false,
 	"InstanceTypes":                                true,
 	"InstanceTypes.*":                              true,
diff --git a/lib/config/export_test.go b/lib/config/export_test.go
index e12fbdc7f..7af117e38 100644
--- a/lib/config/export_test.go
+++ b/lib/config/export_test.go
@@ -20,11 +20,12 @@ func (s *ExportSuite) TestExport(c *check.C) {
 	confdata := strings.Replace(string(DefaultYAML), "SAMPLE", "testkey", -1)
 	cfg, err := testLoader(c, confdata, nil).Load()
 	c.Assert(err, check.IsNil)
-	cluster := cfg.Clusters["xxxxx"]
+	cluster, err := cfg.GetCluster("xxxxx")
+	c.Assert(err, check.IsNil)
 	cluster.ManagementToken = "abcdefg"
 
 	var exported bytes.Buffer
-	err = ExportJSON(&exported, &cluster)
+	err = ExportJSON(&exported, cluster)
 	c.Check(err, check.IsNil)
 	if err != nil {
 		c.Logf("If all the new keys are safe, add these to whitelist in export.go:")
@@ -32,5 +33,7 @@ func (s *ExportSuite) TestExport(c *check.C) {
 			c.Logf("\t%q: true,", strings.Replace(k, `"`, "", -1))
 		}
 	}
-	c.Check(exported.String(), check.Not(check.Matches), `(?ms).*abcdefg.*`)
+	var exportedStr = exported.String()
+	c.Check(exportedStr, check.Matches, `(?ms).*ClusterID":"xxxxx.*`)
+	c.Check(exportedStr, check.Not(check.Matches), `(?ms).*abcdefg.*`)
 }

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list