Skip to content

fix(BA-1167): Wrong custom image owner check logic #4181

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 16, 2025

Conversation

jopemachine
Copy link
Member

@jopemachine jopemachine commented Apr 16, 2025

resolves #4182 (BA-1167).

Checklist: (if applicable)

  • Mention to the original issue

@Copilot Copilot AI review requested due to automatic review settings April 16, 2025 02:08
@github-actions github-actions bot added size:XS ~10 LoC comp:manager Related to Manager component labels Apr 16, 2025
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.

@@ -798,7 +798,8 @@ def set_resource_limit(
self._resources = resources

def is_owned_by(self, user_id: UUID) -> bool:
return self.customized and self.labels["ai.backend.customized-image.owner"] == str(user_id)
owner_label = self.labels["ai.backend.customized-image.owner"]
Copy link
Preview

Copilot AI Apr 16, 2025

Choose a reason for hiding this comment

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

Splitting the label on ':' assumes it always has a colon; consider adding a check on the split result length to prevent possible IndexError if the label is improperly formatted.

Suggested change
owner_label = self.labels["ai.backend.customized-image.owner"]
owner_label = self.labels["ai.backend.customized-image.owner"]
if ":" not in owner_label:
return False

Copilot uses AI. Check for mistakes.

@jopemachine jopemachine changed the title fix: Wrong custom image owner check login fix(BA-1167): Wrong custom image owner check login Apr 16, 2025
Copy link
Contributor

@agatha197 agatha197 left a comment

Choose a reason for hiding this comment

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

LGTM

@jopemachine jopemachine changed the title fix(BA-1167): Wrong custom image owner check login fix(BA-1167): Wrong custom image owner check logic Apr 16, 2025
@HyeockJinKim HyeockJinKim added this pull request to the merge queue Apr 16, 2025
Merged via the queue into main with commit a222ddf Apr 16, 2025
26 checks passed
@HyeockJinKim HyeockJinKim deleted the fix/wrong_image_owner_check branch April 16, 2025 02:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
comp:manager Related to Manager component size:XS ~10 LoC
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Wrong custom image owner check
3 participants