diff --git a/.claude/CLAUDE.md b/.claude/CLAUDE.md index 4310b80db..ea0870dcb 100644 --- a/.claude/CLAUDE.md +++ b/.claude/CLAUDE.md @@ -19,30 +19,10 @@ Each component can be used independently or as part of the integrated Hive stack - `../viperblock/CLAUDE.md` - Viperblock development guide - `../predastore/CLAUDE.md` - Predastore development guide -## Build Commands +## Project Standards -### Hive (Platform Orchestrator) -```bash -make build # Build the hive binary -make test # Run Go tests -make bench # Run benchmarks -make clean # Clean build artifacts -``` - -### **MANDATORY: Unit Testing Requirements** - -**⚠️ CRITICAL: Always run unit tests before any commit or push operation.** - -```bash -# REQUIRED before any git commit or push -make test # Must pass with zero failures - -# Example workflow: -make test # Verify all tests pass -git add . # Stage changes -git commit -m "..." # Only after tests pass -git push origin main # Only after tests pass -``` +- Use log/slog instead of log. Use appropriate log level, eg `slog.Info` +- All new features must have comprehensive unit tests **Testing Policy:** - **All unit tests MUST pass** before committing changes @@ -51,25 +31,6 @@ git push origin main # Only after tests pass - Use `make test` command to run the full test suite - If tests fail, fix issues before proceeding with git operations -### Component Build Commands - -For detailed build instructions, see component-specific CLAUDE.md files: - -**Viperblock** (`../viperblock/CLAUDE.md`): -```bash -cd ../viperblock && make build # Build sfs, vblock binaries + NBD plugin -``` - -**Predastore** (`../predastore/CLAUDE.md`): -```bash -cd ../predastore && make build # Build s3d binary -``` - -**NBDkit** (system dependency): -```bash -cd nbdkit && autoreconf -i && ./configure && make && make install -``` - ## Architecture Notes Read `DESIGN.md` to understand the full architecture diff --git a/hive/handlers/ec2/volume/service_impl.go b/hive/handlers/ec2/volume/service_impl.go index 5fee78154..90b3847b2 100644 --- a/hive/handlers/ec2/volume/service_impl.go +++ b/hive/handlers/ec2/volume/service_impl.go @@ -219,6 +219,7 @@ func (s *VolumeServiceImpl) getVolumeByID(volumeID string) (*ec2.Volume, error) Device: aws.String(volMeta.DeviceName), State: aws.String(attachState), DeleteOnTermination: aws.Bool(false), + AttachTime: aws.Time(volMeta.AttachedAt), }, } } @@ -344,6 +345,9 @@ func (s *VolumeServiceImpl) UpdateVolumeState(volumeID, state, attachedInstance cfg.VolumeMetadata.State = state cfg.VolumeMetadata.AttachedInstance = attachedInstance + if attachedInstance != "" { + cfg.VolumeMetadata.AttachedAt = time.Now() + } if err := s.putVolumeConfig(volumeID, cfg); err != nil { return fmt.Errorf("failed to write volume config for state update: %w", err)