Skip to content
Merged
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: 1 addition & 1 deletion .ai/checkpoints/topic-11-sp-provider-commands.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions .ai/specs/dcm-cli.spec.md
Original file line number Diff line number Diff line change
Expand Up @@ -1246,8 +1246,8 @@ SP provider health check.
#### Table Output Columns

```
ID NAME SERVICE TYPE STATUS HEALTH CREATED
kubevirt-123 KubeVirt SP compute registered healthy 2026-03-09T10:00:00Z
ID NAME SERVICE TYPE HEALTH CREATED
kubevirt-123 KubeVirt SP compute healthy 2026-03-09T10:00:00Z
```

#### Acceptance Criteria
Expand Down
2 changes: 1 addition & 1 deletion .ai/test-plans/dcm-cli-unit.test-plan.md
Original file line number Diff line number Diff line change
Expand Up @@ -1174,7 +1174,7 @@ test classes. Instead:
- **Type:** Unit
- **Given:** A mock server returning an SP provider with all fields populated
- **When:** `dcm sp provider get kubevirt-123` is executed with `--output table`
- **Then:** The table output includes columns: ID, NAME, SERVICE TYPE, STATUS, HEALTH, CREATED
- **Then:** The table output includes columns: ID, NAME, SERVICE TYPE, HEALTH, CREATED

### TC-U147: SP command registers provider subcommand

Expand Down
5 changes: 2 additions & 3 deletions internal/commands/sp_provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,16 @@ import (
)

var spProviderTableDef = &output.TableDef{
Headers: []string{"ID", "NAME", "SERVICE TYPE", "STATUS", "HEALTH", "CREATED"},
Headers: []string{"ID", "NAME", "SERVICE TYPE", "HEALTH", "CREATED"},
RowFunc: func(resource any) []string {
m, ok := resource.(map[string]any)
if !ok {
return []string{"", "", "", "", "", ""}
return []string{"", "", "", "", ""}
}
return []string{
stringifyValue(m, "id"),
stringifyValue(m, "name"),
stringifyValue(m, "service_type"),
stringifyValue(m, "status"),
stringifyValue(m, "health_status"),
stringifyValue(m, "create_time"),
}
Expand Down
6 changes: 1 addition & 5 deletions internal/commands/sp_provider_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ func sampleSPProviderResponse() map[string]any {
"path": "providers/kubevirt-123",
"name": "KubeVirt SP",
"service_type": "compute",
"status": "registered",
"health_status": "healthy",
"create_time": "2026-03-09T10:00:00Z",
}
Expand Down Expand Up @@ -91,7 +90,6 @@ var _ = Describe("SP Provider Commands", func() {
Expect(out).To(ContainSubstring("kubevirt-123"))
Expect(out).To(ContainSubstring("KubeVirt SP"))
Expect(out).To(ContainSubstring("compute"))
Expect(out).To(ContainSubstring("registered"))
})

// TC-U140: List SP providers with pagination
Expand Down Expand Up @@ -180,7 +178,6 @@ var _ = Describe("SP Provider Commands", func() {
Expect(out).To(ContainSubstring("kubevirt-123"))
Expect(out).To(ContainSubstring("KubeVirt SP"))
Expect(out).To(ContainSubstring("compute"))
Expect(out).To(ContainSubstring("registered"))
})

// TC-U143: Get SP provider without PROVIDER_ID fails
Expand Down Expand Up @@ -225,13 +222,12 @@ var _ = Describe("SP Provider Commands", func() {
Expect(out).To(ContainSubstring("ID"))
Expect(out).To(ContainSubstring("NAME"))
Expect(out).To(ContainSubstring("SERVICE TYPE"))
Expect(out).To(ContainSubstring("STATUS"))
Expect(out).To(ContainSubstring("HEALTH"))
Expect(out).To(ContainSubstring("CREATED"))
Expect(out).NotTo(ContainSubstring("STATUS"))
Expect(out).To(ContainSubstring("kubevirt-123"))
Expect(out).To(ContainSubstring("KubeVirt SP"))
Expect(out).To(ContainSubstring("compute"))
Expect(out).To(ContainSubstring("registered"))
Expect(out).To(ContainSubstring("healthy"))
Expect(out).To(ContainSubstring("2026-03-09T10:00:00Z"))
})
Expand Down