Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions linter_exclusions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3567,3 +3567,15 @@ confcom containers from_image:
image:
rule_exclusions:
- no_positional_parameters

confcom containers from_radius:
parameters:
template:
rule_exclusions:
- no_positional_parameters

confcom radius policy_insert:
parameters:
policy_file:
rule_exclusions:
- no_positional_parameters
5 changes: 5 additions & 0 deletions src/confcom/HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@
Release History
===============

1.9.0
+++++
* Add command for generating container policy defintions from radius application templates
* Add command to insert generated policy into radius application templates

1.8.0
+++++
* Ensure that fragments are attached to the correct manifest for a multiarch image.
Expand Down
60 changes: 60 additions & 0 deletions src/confcom/azext_confcom/_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import argparse
import sys
from knack.arguments import CLIArgumentType
from argcomplete.completers import FilesCompleter
from azext_confcom._validators import (
validate_params_file,
validate_diff,
Expand Down Expand Up @@ -504,3 +505,62 @@ def load_arguments(self, _):
type=str,
help='The name of the container in the template to use. If omitted, all containers are returned.'
)

with self.argument_context("confcom containers from_radius") as c:
c.positional(
"template",
type=str,
completer=FilesCompleter(),
help="Radius Bicep template to create container definition from",
)
c.argument(
"parameters",
options_list=['--parameters', '-p'],
action='append',
nargs='+',
completer=FilesCompleter(),
required=False,
default=[],
help='The parameters for the radius template'
)
c.argument(
"container_index",
options_list=['--idx'],
required=False,
default=0,
type=int,
help='The index of the container definition in the template to use'
)
c.argument(
"platform",
options_list=["--platform"],
required=False,
default="aci",
type=str,
help="Platform to create container definition for",
)

with self.argument_context("confcom radius policy_insert") as c:
c.positional(
"policy_file",
nargs='?',
type=argparse.FileType('rb'),
default=sys.stdin.buffer,
help="Policy file to insert (reads from stdin if not provided)",
)
c.argument(
"template_path",
options_list=['--template', '-t'],
required=True,
type=str,
completer=FilesCompleter(),
help='Path to Radius Bicep template to update with the policy',
)
c.argument(
"container_index",
options_list=['--idx'],
required=False,
default=0,
type=int,
help='Index of the container in the template to update (0-based). Defaults to 0.'
)
Loading
Loading