Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
68916: [CRDB-7715] Change date times on jobs page to use 24 hr utc r=Santamaura a=Santamaura

This change updates the date time format used on the jobs page from 12 hr to 24 hr utc. This change is needed since the rest of crdb uses 24 hr utc time.

Release note (ui change): change date times on jobs page to use 24 hr utc

Screenshot:
![Screen Shot 2021-08-13 at 1 08 06 PM](https://user-images.githubusercontent.com/17861665/129413228-74ec5e0b-9804-405a-b180-1386ad017525.png)


68931: storage: add config option for enabling encryption-at-rest r=jbowens a=andyyang890

This patch adds the ability to configure encryption-at-rest for
in-memory engines, which are used in tests.

Release note: None

Co-authored-by: Santamaura <[email protected]>
Co-authored-by: Andy Yang <[email protected]>
  • Loading branch information
3 people committed Aug 16, 2021
3 parents f2aded5 + a945ffd + 506a61c commit 39d59f1
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 2 deletions.
1 change: 1 addition & 0 deletions pkg/server/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions pkg/server/sticky_engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down
13 changes: 13 additions & 0 deletions pkg/storage/open.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
4 changes: 2 additions & 2 deletions pkg/ui/src/views/jobs/jobTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -59,7 +59,7 @@ const jobsTableColumns: ColumnDescriptor<Job>[] = [
{
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(),
},
{
Expand Down

0 comments on commit 39d59f1

Please sign in to comment.