GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Update the new architecture interface of the umem (#94) by ucloud-umem-qingpfang · Pull Request #95 · ucloud/ucloud-cli

Conversation

@ucloud-umem-qingpfang

@ucloud-umem-qingpfang ucloud-umem-qingpfang commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Features:

Add automatic VPC and Subnet selection for Redis and Memcache creation

Automatically fills default VPC and subnet when not specified
Supports filtering subnets by availability zone
Enhance Redis create command with new parameters

Add --block-cnt parameter for distributed Redis (default: 2)
Add --proxy-size parameter for distributed Redis (default: 2 cores)
Improve shell completion support

Add dynamic completion for region, zone, project-id, charge-type
Update Redis version options: 4.0, 5.0, 6.0, 7.0 (previously 3.0, 3.2, 4.0)

Fixes:

Support new Redis instance ID prefixes: uhredis (master-replica), udredis (distributed)

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
ucloud-umem-qingpfang and others added 2 commits June 17, 2026 16:40
@ucloud-umem-qingpfang
Update the new architecture interface of the umem (ucloud#94)
42b49df
@ucloud-umem-qingpfang @claude
refactor(umem): simplify memcache create by removing unnecessary para…
aea3ad9
…m struct

- Remove memcacheCreateParams struct and createMemcache helper function
- Use SDK request object directly since memcache only has one create type
- Keep redis param structs as they are shared between master-replica and distributed types

Co-Authored-By: Claude <[email protected]>
Episkey-G
Episkey-G requested changes Jun 17, 2026
View reviewed changes
Comment thread cmd/umem.go Outdated

size := p.size
if size < p.blockCnt || size%p.blockCnt != 0 {
size = p.blockCnt

@Episkey-G Episkey-G Jun 17, 2026

Copy link
Copy Markdown
Collaborator

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When the user explicitly passes --size-gb 5 --block-cnt 2 (5 is not a multiple of 2), the value is silently reduced to 2GB with no warning. Other create commands in this repo (count in udisk create, disk/memory in mysql create, size in memcache create) reject out-of-range input with an error and return, rather than silently correcting it — suggest keeping this consistent.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread cmd/umem.go Outdated
flags.IntVar(&p.blockCnt, "block-cnt", 2, "Optional. Block count. Default value 2(for distributed redis type).")
flags.IntVar(&p.proxySize, "proxy-size", 2, "Optional. Proxy size. Default value 2(for distributed redis type) Unit Core")

p.region = base.ConfigIns.Region

@Episkey-G Episkey-G Jun 17, 2026

Copy link
Copy Markdown
Collaborator

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These region/zone/project-id flags are bound by hand, but cmd/util.go already provides bindRegionS / bindZoneS / bindProjectIDS (which set the default value and the completion func). Suggest reusing them to avoid copying the help text into three commands and the drift that follows when the text or default changes. The same hand-written pattern in redis delete (346-351) and memcache create (569-574) should be replaced too.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread cmd/umem.go Outdated
flags.SortFlags = false

req.Name = flags.String("name", "", "Required. Name of the redis to create. Range of the password length is [6,63] and the password can only contain letters and numbers")
flags.StringVar(&p.name, "name", "", "Required. Name of the redis to create.")

@Episkey-G Episkey-G Jun 17, 2026

Copy link
Copy Markdown
Collaborator

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The validation actually applies to name (len(p.name) must be within [6,63]), but the [6,63] constraint is documented on --password, which has no length validation at all. So --name's real constraint is undocumented while --password advertises a constraint that isn't enforced. Suggest moving the constraint back to --name; if password really has a rule, add the matching validation too.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@ucloud-umem-qingpfang ucloud-umem-qingpfang Jun 17, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

好的,我检查了下API的接口,name长度 目前限制为 6 - 63,password限制长度为 6 - 36。 我补充下

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
ucloud-umem-qingpfang and others added 2 commits June 17, 2026 18:39
@ucloud-umem-qingpfang @claude
refactor(umem): improve flag binding and add parameter validation
85b89b5
- Use bindRegionS/bindZoneS/bindProjectIDS helpers to reduce code duplication
- Add name validation with utf8.RuneCountInString for Chinese support
- Add password validation with len() (ASCII only)
- Add distributed redis validation: size must be divisible by block-cnt, proxy-size must be multiple of 2
- Update help text for name and password flags

Co-Authored-By: Claude <[email protected]>
@ucloud-umem-qingpfang @claude
feat(umem): update size default to 2GB and support uregionredis delete
10fe685
- Change size-gb default value from 1GB to 2GB
- Simplify size-gb help text
- Add support for 'uregionredis' prefix in redis delete command

Co-Authored-By: Claude <[email protected]>
@Ali1213
Ali1213 force-pushed the master branch from 808f973 to 8c12f7e Compare June 18, 2026 02:56
@Ali1213
Ali1213 merged commit 79ebcdf into ucloud:master Jun 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@Episkey-G Episkey-G Episkey-G requested changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@ucloud-umem-qingpfang @Episkey-G @Ali1213
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.