diff --git a/pkg/server/config.go b/pkg/server/config.go index 2f290ca0c0f5..7922c286fc07 100644 --- a/pkg/server/config.go +++ b/pkg/server/config.go @@ -521,6 +521,7 @@ func (cfg *Config) CreateEngines(ctx context.Context) (Engines, error) { storage.Attributes(spec.Attributes), storage.CacheSize(cfg.CacheSize), storage.MaxSize(sizeInBytes), + storage.EncryptionAtRest(spec.EncryptionOptions), storage.Settings(cfg.Settings)) if err != nil { return Engines{}, err diff --git a/pkg/server/sticky_engine.go b/pkg/server/sticky_engine.go index a7cff27f4f93..a99c1a571844 100644 --- a/pkg/server/sticky_engine.go +++ b/pkg/server/sticky_engine.go @@ -112,6 +112,7 @@ func (registry *stickyInMemEnginesRegistryImpl) GetOrCreateStickyInMemEngine( storage.Attributes(spec.Attributes), storage.CacheSize(cfg.CacheSize), storage.MaxSize(spec.Size.InBytes), + storage.EncryptionAtRest(spec.EncryptionOptions), storage.ForTesting) engineEntry := &stickyInMemEngine{ diff --git a/pkg/storage/open.go b/pkg/storage/open.go index 29f0136478e7..2d4f166209ce 100644 --- a/pkg/storage/open.go +++ b/pkg/storage/open.go @@ -106,6 +106,19 @@ func CacheSize(size int64) ConfigOption { } } +// EncryptionAtRest configures an engine to use encryption-at-rest. It is used +// for configuring in-memory engines, which are used in tests. It is not safe +// to modify the given slice afterwards as it is captured by reference. +func EncryptionAtRest(encryptionOptions []byte) ConfigOption { + return func(cfg *engineConfig) error { + if len(encryptionOptions) > 0 { + cfg.UseFileRegistry = true + cfg.EncryptionOptions = encryptionOptions + } + return nil + } +} + // Hook configures a hook to initialize additional storage options. It's used // to initialize encryption-at-rest details in CCL builds. func Hook(hookFunc func(*base.StorageConfig) error) ConfigOption { diff --git a/pkg/ui/src/views/jobs/jobTable.tsx b/pkg/ui/src/views/jobs/jobTable.tsx index cb2f3e76b3d8..d72c29276760 100644 --- a/pkg/ui/src/views/jobs/jobTable.tsx +++ b/pkg/ui/src/views/jobs/jobTable.tsx @@ -12,7 +12,7 @@ import React, { MouseEvent } from "react"; import _ from "lodash"; import { cockroach } from "src/js/protos"; import { TimestampToMoment } from "src/util/convert"; -import { DATE_FORMAT } from "src/util/format"; +import { DATE_FORMAT_24_UTC } from "src/util/format"; import { JobStatusCell } from "src/views/jobs/jobStatusCell"; import { SortSetting } from "src/views/shared/components/sortabletable"; import { CachedDataReducerState } from "src/redux/cachedDataReducer"; @@ -59,7 +59,7 @@ const jobsTableColumns: ColumnDescriptor[] = [ { name: "creationTime", title: "Creation Time", - cell: (job) => TimestampToMoment(job?.created).format(DATE_FORMAT), + cell: (job) => TimestampToMoment(job?.created).format(DATE_FORMAT_24_UTC), sort: (job) => TimestampToMoment(job?.created).valueOf(), }, {