Skip to content

E8-S02: BackupList CRD and observe-only controller - #31

Merged
konih merged 5 commits into
mainfrom
e8-s02-backuplist-crd-controller
Jul 28, 2026
Merged

E8-S02: BackupList CRD and observe-only controller#31
konih merged 5 commits into
mainfrom
e8-s02-backuplist-crd-controller

Conversation

@konih

@konih konih commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Adds internal/clients/gridscale_http.go: thin REST client (GridscaleClient) for the gridscale API, with authenticated GET and configurable base URL
  • Adds BackupList types (cluster + namespaced scopes) with StorageUUID parameter and StorageBackups observation
  • Adds cluster and namespaced BackupList controllers (observe-only: Create/Update return errors, Delete is a no-op)
  • Adds internal/controller/cluster/setup_custom.go and internal/controller/namespaced/setup_custom.go registering BackupList only (PublicNetwork will be added in E8-S04 after E8-S03 merges)
  • Adds BackupList CRD YAMLs: storage.gridscale.platformrelay.io_backuplists.yaml (cluster) and storage.gridscale.m.platformrelay.io_backuplists.yaml (namespaced)
  • Adds unit tests: mock-HTTP-server tests for GridscaleClient.Get and cluster BackupList controller (Observe with populated/empty list, Create/Update observe-only error)
  • Adds gate test: hack/test/e8_s02_backuplist_crd_exists_test.sh

Notes on generated files

zz_generated.deepcopy.go and zz_generated.managed.go in both storage packages are bootstrap additions — only BackupList/StorageBackupEntry blocks were spliced in; no existing Clone/StorageImport methods were touched. The source worktree (data-sources-plan) was on a stale branch with type changes in those generated files (ManagedResourceSpec vs ResourceSpec, NamespacedReference vs Reference), so a wholesale copy was not safe. The spliced methods match the patterns already present for Clone and StorageImport in each package. make generate (angryjet + controller-gen) will regenerate these files identically on next run.

Gate results

go test ./internal/clients/... -v         → 30 passed (3 new TestGridscaleClient* + existing)
go test ./internal/controller/cluster/storage/backuplist/... -v  → 4 passed
bash hack/test/e8_s02_backuplist_crd_exists_test.sh              → PASS
go build ./...                            → OK
go vet ./...                              → OK

Test plan

  • All CI gates green (build, vet, tests, golangci-lint, scorecard)
  • CRD YAMLs validated as kind: CustomResourceDefinition
  • No PublicNetwork files included (those belong to E8-S03/E8-S04)
  • cmd/provider/main.go not modified (that's E8-S04)

@codecov

codecov Bot commented Jul 28, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 81.81818% with 4 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
internal/clients/gridscale_http.go 81.81% 2 Missing and 2 partials ⚠️

📢 Thoughts on this report? Let us know!

konih added 5 commits July 28, 2026 21:49
…angelog

- gofmt internal/controller/{cluster,namespaced}/setup_custom.go
- README: 32 → 33 managed resources (BackupList CRD added)
- docs/api/out.md: regenerated to include BackupList API reference
- go.mod: google.golang.org/grpc v1.79.3 → v1.82.1 (GO-2026-6061)
- CHANGELOG.md: regenerated via git cliff
…deepcopy files

- Replace managed.WithExternalConnecter with managed.WithExternalConnector (SA1019)
- Suppress GetEventRecorderFor deprecation with nolint; direct replacement breaks
  compilation until crossplane-runtime migrates NewAPIRecorder to new events API
- Remove embedded field selector o.Options.Gate -> o.Gate (QF1008)
- Fix goimports import grouping in cluster controller_test.go
- Run angryjet: reorder BackupList methods before Clone (alphabetical), add
  BackupListList.GetItems() to both cluster and namespaced zz_generated.managedlist.go
- Run controller-gen: move StorageBackupEntry deepcopy funcs after CloneStatus
  (alphabetical type ordering) in both cluster and namespaced zz_generated.deepcopy.go
@konih
konih force-pushed the e8-s02-backuplist-crd-controller branch from 13ec074 to 927ad69 Compare July 28, 2026 19:51
@sonarqubecloud

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
47.8% Duplication on New Code (required ≤ 3%)

See analysis details on SonarQube Cloud

@konih
konih merged commit c33df06 into main Jul 28, 2026
12 of 14 checks passed
@konih
konih deleted the e8-s02-backuplist-crd-controller branch July 28, 2026 19:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant