Skip to content

Commit

Permalink
(CONT-493) PPA validation adjustment
Browse files Browse the repository at this point in the history
Prior to this commit, one of our updates (#1052)
implemented a regex validation for ppa packages that were to be
installed. However, this validation did not account for resource
names that were dotted.

This commit aims to fix this bug in our validation process so that it
works as intended.
  • Loading branch information
LukasAud committed Jan 18, 2023
1 parent f12c74c commit a14262b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion manifests/ppa.pp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
}

# Validate the resource name
if $name !~ /^ppa:([a-zA-Z0-9\-_]+)\/([a-zA-z0-9\-_\.]+)$/ {
if $name !~ /^ppa:([a-zA-Z0-9\-_.]+)\/([a-zA-z0-9\-_\.]+)$/ {
fail("Invalid PPA name: ${name}")
}

Expand Down
2 changes: 1 addition & 1 deletion spec/defines/ppa_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def ppa_exec_params(user, repo, distro = 'trusty', environment = [])
[
'ppa:foo!/bar',
'ppa:foo/bar!',
'ppa:foo1.0/bar',
'ppa:foo1,0/bar',
'ppa:foo/bar/foobar',
'|| ls -la ||',
'|| touch /tmp/foo.txt ||',
Expand Down

0 comments on commit a14262b

Please sign in to comment.