-
Notifications
You must be signed in to change notification settings - Fork 1
fix: missing acl schema #888
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,4 +1,4 @@ | ||||||||||||
| import { CoreV1Api, KubeConfig, User as k8sUser, V1ObjectReference } from '@kubernetes/client-node' | ||||||||||||
| import { CoreV1Api, User as k8sUser, KubeConfig, V1ObjectReference } from '@kubernetes/client-node' | ||||||||||||
| import Debug from 'debug' | ||||||||||||
|
|
||||||||||||
| import { getRegions, ObjectStorageKeyRegions } from '@linode/api-v4' | ||||||||||||
|
|
@@ -1210,6 +1210,7 @@ export default class OtomiStack { | |||||||||||
| if (!codeRepoName) return ['HEAD'] | ||||||||||||
| const coderepo = this.getCodeRepo(teamId, codeRepoName) | ||||||||||||
| const { repositoryUrl, secret: secretName } = coderepo | ||||||||||||
| const { cluster } = this.getSettings(['cluster']) | ||||||||||||
| try { | ||||||||||||
| let sshPrivateKey = '', | ||||||||||||
| username = '', | ||||||||||||
|
|
@@ -1224,9 +1225,11 @@ export default class OtomiStack { | |||||||||||
|
|
||||||||||||
| const isPrivate = !!secretName | ||||||||||||
| const isSSH = !!sshPrivateKey | ||||||||||||
| const repoUrl = repositoryUrl.startsWith('https://gitea') | ||||||||||||
| ? repositoryUrl | ||||||||||||
| : normalizeRepoUrl(repositoryUrl, isPrivate, isSSH) | ||||||||||||
|
|
||||||||||||
| const repoUrl = | ||||||||||||
| repositoryUrl === `https://gitea.${cluster?.domainSuffix}` | ||||||||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This check would never match any actual repository URL and will cause all internal Gitea repositories to fail the equality check. For the URL check, we could use something like the following:
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I will add an isInternalGiteaURL function and replace the duplicated checks with this function call. I wil also make a test for it
Comment on lines
+1229
to
+1230
|
||||||||||||
| const repoUrl = | |
| repositoryUrl === `https://gitea.${cluster?.domainSuffix}` | |
| const giteaUrl = cluster?.domainSuffix ? `https://gitea.${cluster.domainSuffix}` : undefined | |
| const repoUrl = | |
| giteaUrl && repositoryUrl === giteaUrl |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -268,6 +268,7 @@ export async function sparseCloneChart( | |||||
| chartTargetDirName: string, | ||||||
| chartIcon?: string, | ||||||
| allowTeams?: boolean, | ||||||
| clusterDomainSuffix?: string, | ||||||
| ): Promise<boolean> { | ||||||
| const details = detectGitProvider(gitRepositoryUrl) | ||||||
| if (!details) return false | ||||||
|
|
@@ -278,7 +279,7 @@ export async function sparseCloneChart( | |||||
|
|
||||||
| if (!existsSync(localHelmChartsDir)) mkdirSync(localHelmChartsDir, { recursive: true }) | ||||||
| let gitUrl = helmChartCatalogUrl | ||||||
| if (isGiteaURL(helmChartCatalogUrl)) { | ||||||
| if (helmChartCatalogUrl === `https://gitea.${clusterDomainSuffix}`) { | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. you could also rely on
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. good tip! I will take it into account
|
||||||
| if (helmChartCatalogUrl === `https://gitea.${clusterDomainSuffix}`) { | |
| if (clusterDomainSuffix && helmChartCatalogUrl.startsWith(`https://gitea.${clusterDomainSuffix}`)) { |
Copilot
AI
Jan 9, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The URL comparison will fail when clusterDomainSuffix is undefined. The condition should check if clusterDomainSuffix exists before comparing, or use startsWith to match the URL pattern more robustly.
| if (url === `https://gitea.${clusterDomainSuffix}`) { | |
| if (clusterDomainSuffix && url.startsWith(`https://gitea.${clusterDomainSuffix}`)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why schema is called
workloadif the resource istWorkloadCatalog?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
WorkloadCatalogis part of theWorkloadworkflow