Skip to content

Commit

Permalink
resource_id is not nullable, so no need for Option
Browse files Browse the repository at this point in the history
  • Loading branch information
cindy-broadinstitute committed Feb 9, 2024
1 parent 364330d commit 3e5c852
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ final case class WsmManagedAzureIdentity(wsmResourceName: String, managedIdentit

final case class WsmControlledDatabaseResource(wsmDatabaseName: String,
azureDatabaseName: String,
controlledResourceId: Option[UUID] = None
controlledResourceId: UUID = null
)

final case class LandingZoneResources(landingZoneId: UUID,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ class AKSInterpreter[F[_]](config: AKSInterpreterConfig,
.map(db =>
WsmControlledDatabaseResource(db.getMetadata.getName,
db.getAttributes.getDatabaseName,
Option(db.getMetadata.getResourceId)
db.getMetadata.getResourceId
)
)
}
Expand Down Expand Up @@ -807,7 +807,7 @@ class AKSInterpreter[F[_]](config: AKSInterpreterConfig,
// a database already exists (because of workspace cloning) verify or create a APP_CONTROLLED_RESOURCE for it
case Some(existingDb) =>
// there is an existing db, so check to see if we have previously mapped it to appControlledResource
val resourceId = existingDb.controlledResourceId.get
val resourceId = existingDb.controlledResourceId

for {
count <- dbRef.inTransaction(
Expand All @@ -822,7 +822,7 @@ class AKSInterpreter[F[_]](config: AKSInterpreterConfig,
_ <- appControlledResourceQuery
.insert(
app.id.id,
WsmControlledResourceId(existingDb.controlledResourceId.get),
WsmControlledResourceId(existingDb.controlledResourceId),
WsmResourceType.AzureDatabase,
AppControlledResourceStatus.Created
)
Expand All @@ -838,7 +838,7 @@ class AKSInterpreter[F[_]](config: AKSInterpreterConfig,
db =>
WsmControlledDatabaseResource(db.getAzureDatabase.getMetadata.getName,
db.getAzureDatabase.getAttributes.getDatabaseName,
Option(db.getAzureDatabase.getMetadata.getResourceId)
db.getAzureDatabase.getMetadata.getResourceId
)
}
}
Expand Down Expand Up @@ -983,7 +983,7 @@ class AKSInterpreter[F[_]](config: AKSInterpreterConfig,
.map(r =>
WsmControlledDatabaseResource(r.getMetadata().getName(),
r.getResourceAttributes().getAzureDatabase().getDatabaseName(),
Option(r.getMetadata().getResourceId)
r.getMetadata().getResourceId
)
)
}
Expand Down

0 comments on commit 3e5c852

Please sign in to comment.