-
Notifications
You must be signed in to change notification settings - Fork 1.4k
[confcom] Define the format for ACI policy specifications #9262
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
Open
DomAyre
wants to merge
22
commits into
Azure:main
Choose a base branch
from
DomAyre:dataclasses
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
903d348
Initial dataclasses commit
DomAyre f01ec00
Get all tests passing
DomAyre b4264cb
Parse parameter values from arm template
DomAyre 2194653
Avoid adding default fragments twice when loading arm template
DomAyre 87e59ff
Avoid adding mounts multiple times
DomAyre f2921d2
Avoid adding debug exec processes multiple times
DomAyre 83b4081
Remove diff_mode arg for loading arm template
DomAyre e0724ef
Add path as a field of AciFragmentSpec
DomAyre 83844a2
Respect fragments args
DomAyre c2fc0dc
Fix case with no fragments
DomAyre bd271bd
Satisfy azdev style
DomAyre 41babb3
Preserve arbitrary orders to break dependency on fixes
DomAyre f6fb965
Restore the functionality of --diff
DomAyre 7d62b05
Satisfy azdev style
DomAyre 0d73ba9
Only use infrastructure-svn on the infrastructure fragment
DomAyre 9cfd2d6
Add mypy tests and fix the couple of issues it finds
DomAyre b08b012
Fix error message
DomAyre 3a0701a
Prevent the new test failing at the --discover step
DomAyre 21989a3
Fix skipping behaviour
DomAyre 65c5286
Clean up test
DomAyre 4e2eba1
Add missing licenses
DomAyre c940d6c
Don't consider test files for mypy tests
DomAyre File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -36,3 +36,5 @@ azext_confcom/bin/* | |
**/.coverage | ||
|
||
**/htmlcov | ||
|
||
!lib/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
# -------------------------------------------------------------------------------------------- | ||
# Copyright (c) Microsoft Corporation. All rights reserved. | ||
# Licensed under the MIT License. See License.txt in the project root for license information. | ||
# -------------------------------------------------------------------------------------------- | ||
|
||
from dataclasses import dataclass | ||
from typing import Optional | ||
from typing_extensions import Literal | ||
|
||
|
||
@dataclass | ||
class AciContainerPropertyEnvVariable: | ||
name: str | ||
value: str | ||
strategy: str | ||
required: Optional[bool] = False | ||
|
||
|
||
@dataclass | ||
class AciContainerPropertyExecProcesses: | ||
command: list[str] | ||
signals: Optional[list[str]] = None | ||
allow_stdio_access: bool = True | ||
|
||
|
||
@dataclass | ||
class AciContainerPropertyVolumeMounts: | ||
mountPath: str | ||
name: Optional[str] = None | ||
readonly: bool = False | ||
mountType: Optional[Literal["azureFile", "secret", "configMap", "emptyDir"]] = None | ||
|
||
|
||
@dataclass | ||
class AciContainerPropertySecurityContextCapabilities: | ||
add: list[str] | ||
drop: list[str] | ||
|
||
|
||
@dataclass | ||
class AciContainerPropertySecurityContext: | ||
privileged: Optional[bool] = None | ||
allowPrivilegeEscalation: Optional[bool] = None | ||
runAsUser: Optional[int] = None | ||
runAsGroup: Optional[int] = None | ||
runAsNonRoot: Optional[bool] = None | ||
readOnlyRootFilesystem: Optional[bool] = None | ||
capabilities: Optional[AciContainerPropertySecurityContextCapabilities] = None | ||
seccompProfile: Optional[str] = None | ||
|
||
|
||
@dataclass | ||
class AciContainerProperties(): | ||
image: str | ||
allowStdioAccess: bool = True | ||
environmentVariables: Optional[list[AciContainerPropertyEnvVariable]] = None | ||
execProcesses: Optional[list[AciContainerPropertyExecProcesses]] = None | ||
volumeMounts: Optional[list[AciContainerPropertyVolumeMounts]] = None | ||
securityContext: Optional[AciContainerPropertySecurityContext] = None | ||
command: Optional[list[str]] = None | ||
|
||
|
||
# ------------------------------------------------------------------------------ | ||
|
||
|
||
@dataclass | ||
class AciFragmentSpec: | ||
feed: str | ||
issuer: str | ||
minimum_svn: str | ||
includes: list[Literal["containers", "fragments"]] | ||
path: Optional[str] = None | ||
|
||
|
||
@dataclass | ||
class AciContainerSpec: | ||
name: str | ||
properties: AciContainerProperties | ||
|
||
|
||
@dataclass | ||
class AciPolicySpec: | ||
fragments: Optional[list[AciFragmentSpec]] | ||
containers: Optional[list[AciContainerSpec]] |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.