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
3 changes: 3 additions & 0 deletions controlplane/admin/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -523,6 +523,7 @@ type managedWarehouseRequest struct {
MetadataStore configstore.ManagedWarehouseMetadataStore `json:"metadata_store"`
PgBouncer configstore.ManagedWarehousePgBouncer `json:"pgbouncer"`
S3 configstore.ManagedWarehouseS3 `json:"s3"`
Iceberg configstore.ManagedWarehouseIceberg `json:"iceberg"`
WorkerIdentity configstore.ManagedWarehouseWorkerIdentity `json:"worker_identity"`
WarehouseDatabaseCredentials configstore.SecretRef `json:"warehouse_database_credentials"`
MetadataStoreCredentials configstore.SecretRef `json:"metadata_store_credentials"`
Expand All @@ -536,6 +537,8 @@ type managedWarehouseRequest struct {
MetadataStoreStatusMessage string `json:"metadata_store_status_message"`
S3State configstore.ManagedWarehouseProvisioningState `json:"s3_state"`
S3StatusMessage string `json:"s3_status_message"`
IcebergState configstore.ManagedWarehouseProvisioningState `json:"iceberg_state"`
IcebergStatusMessage string `json:"iceberg_status_message"`
IdentityState configstore.ManagedWarehouseProvisioningState `json:"identity_state"`
IdentityStatusMessage string `json:"identity_status_message"`
SecretsState configstore.ManagedWarehouseProvisioningState `json:"secrets_state"`
Expand Down
19 changes: 19 additions & 0 deletions controlplane/admin/api_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -532,6 +532,25 @@ func TestPutWarehouseDisablesPgBouncerWhenSetToFalse(t *testing.T) {
}
}

func TestPutWarehouseEnablesIcebergWhenSetToTrue(t *testing.T) {
store := newFakeAPIStore()
seedOrgWithWarehouse(store, "analytics")
router := newTestAPIRouter(store)

body := []byte(`{"iceberg": {"enabled": true}}`)
req := httptest.NewRequest(http.MethodPut, "/api/v1/orgs/analytics/warehouse", bytes.NewReader(body))
req.Header.Set("Content-Type", "application/json")
rec := httptest.NewRecorder()
router.ServeHTTP(rec, req)

if rec.Code != http.StatusOK {
t.Fatalf("status = %d, want %d: %s", rec.Code, http.StatusOK, rec.Body.String())
}
if !store.warehouses["analytics"].Iceberg.Enabled {
t.Fatal("expected iceberg.enabled=true after PUT")
}
}

func TestPutWarehousePreservesNestedFieldsOnPartialUpdate(t *testing.T) {
store := newFakeAPIStore()
seedOrgWithWarehouse(store, "analytics")
Expand Down
Loading