Skip to content

feat(create): retry in another location - #443

Merged
9marco merged 3 commits into
mainfrom
marco/db-default-location
Aug 19, 2026
Merged

feat(create): retry in another location#443
9marco merged 3 commits into
mainfrom
marco/db-default-location

Conversation

@9marco

@9marco 9marco commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

with mysql and postgres.

This makes use of the LocationRestricted status cause reported by the
corresponding webhook, instead of parsing the human readable response.

@9marco
9marco force-pushed the marco/db-default-location branch from 58e2d18 to b7817a4 Compare August 10, 2026 07:31
@9marco
9marco requested a review from thde August 10, 2026 07:43
@9marco
9marco marked this pull request as ready for review August 10, 2026 07:43
@9marco
9marco force-pushed the marco/db-default-location branch from b7817a4 to 1efa89f Compare August 10, 2026 08:45
@9marco

9marco commented Aug 10, 2026

Copy link
Copy Markdown
Contributor Author

Tested with a hard-coded default location on staging, where the default already is nine-cz42

                         ForProvider: storage.MySQLParameters{
-                                Location:     cmd.Location,
+                                Location:     "nine-cz41",

Fallback is being used

0:# ./nctl create mysql --machine-type=nine-db-xs --help | grep location
      --location=nine-cz41        Where the MySQL instance is created. Available

1:# ./nctl create mysql --machine-type=nine-db-xs
Warning: the default location does not currently accept new MySQL resources, creating in "nine-cz42" instead. The location cannot be changed later, pass --location to choose a different one.
 ✓ created MySQL "rich-catwoman" in project "marco" 🏗
 ⠋ waiting for MySQL to be ready (19m55s) ⏳

--location option still takes precedence

0:# ./nctl create mysql --machine-type=nine-db-xs --location=nine-cz41
nctl: error: unable to create MySQL "champion-the-professor": admission webhook "managedresource.nine.ch" denied the request: resource in location not allowed, available locations: [nine-cz42]

get all showing locations in an additional column, where available

0:# ./nctl get all --all-projects
PROJECT  NAME             KIND               GROUP               LOCATION
marco    xxxxxxxxxxxx     APIServiceAccount  iam.nine.ch         <none>
marco    bucket-xxxxxxxx  Bucket             storage.nine.ch     nine-es34
marco    marco            Bucket             storage.nine.ch     nine-es34
marco    vikunja          BucketUser         storage.nine.ch     nine-es34
marco    mysql84          MySQL              storage.nine.ch     nine-es34
marco    postgres17       Postgres           storage.nine.ch     nine-cz42
marco    postgres18       Postgres           storage.nine.ch     nine-cz42
marco    marco-test       Project            management.nine.ch  <none>
marco    marco-ssh-key    SSHKey             security.nine.ch    <none>

@thde thde left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Neat! ✨

Comment thread get/all.go
@9marco
9marco marked this pull request as draft August 13, 2026 08:47
@9marco
9marco marked this pull request as ready for review August 18, 2026 07:51
@9marco
9marco force-pushed the marco/db-default-location branch from 1efa89f to bd27136 Compare August 19, 2026 08:50
9marco added 3 commits August 19, 2026 11:02
with mysql and postgres.

This makes use of the LocationRestricted status cause reported by the
corresponding webhook, instead of parsing the human readable response.
to set nine-cz42 as the default location for mysql and postgres and to
be able to use fallback locations returned by LocationRestricted
admission cause.
@9marco
9marco force-pushed the marco/db-default-location branch from bd27136 to d370df4 Compare August 19, 2026 09:02
@9marco
9marco merged commit 99c11b4 into main Aug 19, 2026
3 checks passed
@9marco
9marco deleted the marco/db-default-location branch August 19, 2026 09:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants