Skip to content

Commit 9be0f11

Browse files
committed
Fix style and linter issues
1 parent 22d7889 commit 9be0f11

File tree

3 files changed

+33
-1
lines changed

3 files changed

+33
-1
lines changed

linter_exclusions.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3516,3 +3516,9 @@ confcom fragment attach:
35163516
signed_fragment:
35173517
rule_exclusions:
35183518
- no_positional_parameters
3519+
3520+
confcom fragment references from_image:
3521+
parameters:
3522+
image:
3523+
rule_exclusions:
3524+
- no_positional_parameters

src/confcom/azext_confcom/_help.py

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -321,3 +321,28 @@
321321
- name: Attach the output of acifragmentgen to a registry
322322
text: az confcom acifragmentgen --chain my.cert.pem --key my_key.pem --svn "1" --namespace contoso --feed "test-feed" --input ./fragment_spec.json | az confcom fragment attach --manifest-tag myregistry.azurecr.io/image:latest
323323
"""
324+
325+
helps[
326+
"confcom fragment references"
327+
] = """
328+
type: group
329+
short-summary: Commands which generate Security Policy Fragment References.
330+
"""
331+
332+
333+
helps[
334+
"confcom fragment references from_image"
335+
] = """
336+
type: command
337+
short-summary: Create a Security Policy Fragment Reference based on an image reference.
338+
339+
parameters:
340+
- name: --minimum-svn
341+
type: str
342+
short-summary: 'The value of the minimum SVN field in the generated fragment reference, defaults to current fragment reference'
343+
344+
345+
examples:
346+
- name: Input an image reference and generate fragment reference
347+
text: az confcom fragment references from_image my.azurecr.io/myimage:tag
348+
"""

src/confcom/azext_confcom/lib/images.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,4 +66,5 @@ def get_image_config(image: str) -> dict:
6666

6767

6868
def sanitize_image_reference(image_reference: str) -> str:
69-
return re.sub(f"[{re.escape(r'<>:"/\\|?*@\0')}]", "-", image_reference)
69+
illegal = r'<>:"/\\|?*@\0'
70+
return re.sub(f"[{re.escape(illegal)}]", "-", image_reference)

0 commit comments

Comments
 (0)