Skip to content
This repository was archived by the owner on Apr 15, 2024. It is now read-only.

Docker registry default #657

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from
Open

Conversation

jgielstra-cs
Copy link
Contributor

Checklist:

Please check you fulfill ALL of the relevant checkboxes

  • Notified docs of any potential USER-facing changes
  • Added short description of the change - with relevant motivation and context.
  • Branch has the ticket number in its name (along with a ticket summary)
  • Commented the code, particularly in hard-to-understand areas
  • Added tests that prove my fix is effective or that my feature works
  • [ X] Ran npm test and it passes
  • [ X] Changes generate no new warnings
  • [ X] Changes are backward compatible with older clusters

try {
// TODO fetch this from new endpoint or maybe store this in the profile??
const registryUrl = (new URL(profile.url)).hostname.replace('api', 'private-registry');
// First try to see if we have of registries from /v4/info, grab the first one with isCortex == true
Copy link
Contributor

Choose a reason for hiding this comment

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

do we want any unit tests to check these scenarios?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah need to add some... I just added a quick fix cause it was blocking me from some other testing..

// TODO fetch this from new endpoint or maybe store this in the profile??
const registryUrl = (new URL(profile.url)).hostname.replace('api', 'private-registry');
// First try to see if we have of registries from /v4/info, grab the first one with isCortex == true
let registryUrl = Object.values(profile?.registries ?? {}).find((v) => v?.isCortex === true)?.url;
Copy link
Collaborator

Choose a reason for hiding this comment

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

If a cluster has 2 or more registries(one of them being private-registry.) then we are choosing the default only.. Maybe a warning to the user that a certain registry is being used of the 2 or more options.
The below warning comes up ONLY when profile.registries.url is undefined

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't know what a good alternative is though... unless we want to add a registry to cortex configure &&|| `cortex workspaces --registry so you can specify one. ??

Just using string replace isn't good enough though

@pkandarpa-cs
Copy link
Contributor

@jgielstra-cs I've resolved merge conflicts so we can get this into develop soon

@@ -10,6 +10,9 @@
"ecmaVersion": 2022
},
"extends": "airbnb-base",
"parserOptions": {
Copy link
Contributor

Choose a reason for hiding this comment

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

unsure if this is still needed. maybe not? @jgielstra-cs

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants