Skip to content

Commit

Permalink
add oci url to the list of acceptable urls
Browse files Browse the repository at this point in the history
  • Loading branch information
Mo Mesgin authored and Mo Mesgin committed Oct 29, 2024
1 parent 78df731 commit 5e97830
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions shell/utils/validators/formRules/__tests__/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1117,6 +1117,7 @@ describe('formRules', () => {
const testCases = [
['', undefined],
['https://github.com/rancher/fleet-examples.git', undefined],
['oci://test.rancher.io/charts/mychart', undefined],
['[email protected]:rancher/fleet-examples.git', undefined],
['http://100.100.100.127', undefined],
['aaaAAAA111//', message],
Expand Down
2 changes: 1 addition & 1 deletion shell/utils/validators/formRules/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,7 @@ export default function(t: Translation, { key = 'Value' }: ValidationOptions): {
return runValidators(val, [startHyphen('label'), endHyphen('label'), startDot('label'), endDot('label'), required]);
};

const repo: Validator = (val) => val && !/((git|ssh|http(s)?)|(git@[\w\.]+))(\:(\/\/)?)([\w\.@\:/\-~]+)(\.git)?(\/)?/.test(val) ? t('validation.setting.repo') : undefined;
const repo: Validator = (val) => val && !/((git|ssh|oci|http(s)?)|(git@[\w\.]+))(\:(\/\/)?)([\w\.@\:/\-~]+)(\.git)?(\/)?/.test(val) ? t('validation.setting.repo') : undefined;

return {
absolutePath,
Expand Down

0 comments on commit 5e97830

Please sign in to comment.