Skip to content

Commit 1f6bb19

Browse files
authored
Merge pull request #2470 from minrk/ovh2-creds
ovh2: update registry credentials
2 parents 2c7880d + 6784799 commit 1f6bb19

File tree

3 files changed

+51
-13
lines changed

3 files changed

+51
-13
lines changed

mybinder/values.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -621,7 +621,7 @@ federationRedirect:
621621
versions: https://ovh.mybinder.org/versions
622622
ovh2:
623623
url: https://ovh2.mybinder.org
624-
weight: 0
624+
weight: 100
625625
health: https://ovh2.mybinder.org/health
626626
versions: https://ovh2.mybinder.org/versions
627627
turing:

secrets/config/ovh2.yaml

-1.21 KB
Binary file not shown.

terraform/ovh/main.tf

Lines changed: 50 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -184,18 +184,56 @@ resource "harbor_project" "mybinder-builds" {
184184
name = "mybinder-builds"
185185
}
186186

187-
resource "harbor_robot_account" "builder" {
188-
name = "builder"
189-
description = "BinderHub builder: push new user images"
190-
project_id = harbor_project.mybinder-builds.id
191-
actions = ["push", "pull"]
187+
# we should be able to use robot accounts
188+
# after an update to Harbor and the harbor provider
189+
# resource "harbor_robot_account" "builder" {
190+
# name = "builder"
191+
# description = "BinderHub builder: push new user images"
192+
# project_id = harbor_project.mybinder-builds.id
193+
# actions = ["push", "pull"]
194+
# }
195+
#
196+
# resource "harbor_robot_account" "user-puller" {
197+
# name = "user-puller"
198+
# description = "Pull access to user images"
199+
# project_id = harbor_project.mybinder-builds.id
200+
# actions = ["pull"]
201+
# }
202+
203+
resource "random_password" "builder" {
204+
length = 16
205+
special = true
206+
}
207+
208+
resource "random_password" "user-puller" {
209+
length = 16
210+
special = true
211+
}
212+
213+
resource "harbor_user" "builder" {
214+
username = "mybinder-builder"
215+
password = random_password.builder.result
216+
full_name = "MyBinder Builder"
217+
218+
}
219+
220+
resource "harbor_user" "user-puller" {
221+
username = "mybinder-puller"
222+
password = random_password.user-puller.result
223+
full_name = "MyBinder Puller"
224+
225+
}
226+
227+
resource "harbor_project_member_user" "builder" {
228+
project_id = harbor_project.mybinder-builds.id
229+
user_name = harbor_user.builder.username
230+
role = "developer"
192231
}
193232

194-
resource "harbor_robot_account" "user-puller" {
195-
name = "user-puller"
196-
description = "Pull access to user images"
197-
project_id = harbor_project.mybinder-builds.id
198-
actions = ["pull"]
233+
resource "harbor_project_member_user" "user-puller" {
234+
project_id = harbor_project.mybinder-builds.id
235+
user_name = harbor_user.user-puller.username
236+
role = "limitedguest"
199237
}
200238

201239
# retention policies created by hand
@@ -237,11 +275,11 @@ output "registry_admin_password" {
237275
}
238276

239277
output "registry_builder_token" {
240-
value = harbor_robot_account.builder.token
278+
value = harbor_user.builder.password
241279
sensitive = true
242280
}
243281

244282
output "registry_user_puller_token" {
245-
value = harbor_robot_account.user-puller.token
283+
value = harbor_user.user-puller.password
246284
sensitive = true
247285
}

0 commit comments

Comments
 (0)