Skip to content

Commit

Permalink
feat: [google-cloud-binary-authorization] add container_name, contain…
Browse files Browse the repository at this point in the history
…er_type fields to Continuous Validation Logs (#12051)

- [ ] Regenerate this pull request now.

PiperOrigin-RevId: 585695887

Source-Link:
googleapis/googleapis@4eccaaf

Source-Link:
googleapis/googleapis-gen@6648795
Copy-Tag:
eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWJpbmFyeS1hdXRob3JpemF0aW9uLy5Pd2xCb3QueWFtbCIsImgiOiI2NjQ4Nzk1MDFkNTE2ZTljNjdkMDQ4NTE0MjlhM2YxOWYyMGIwOWE1In0=

---------

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
  • Loading branch information
gcf-owl-bot[bot] and gcf-owl-bot[bot] authored Nov 28, 2023
1 parent a927596 commit b063395
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 13 deletions.
24 changes: 12 additions & 12 deletions packages/google-cloud-binary-authorization/CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -35,21 +35,21 @@ Using a Development Checkout
You'll have to create a development environment using a Git checkout:

- While logged into your GitHub account, navigate to the
``python-binary-authorization`` `repo`_ on GitHub.
``google-cloud-python`` `repo`_ on GitHub.

- Fork and clone the ``python-binary-authorization`` repository to your GitHub account by
- Fork and clone the ``google-cloud-python`` repository to your GitHub account by
clicking the "Fork" button.

- Clone your fork of ``python-binary-authorization`` from your GitHub account to your local
- Clone your fork of ``google-cloud-python`` from your GitHub account to your local
computer, substituting your account username and specifying the destination
as ``hack-on-python-binary-authorization``. E.g.::
as ``hack-on-google-cloud-python``. E.g.::

$ cd ${HOME}
$ git clone git@github.com:USERNAME/python-binary-authorization.git hack-on-python-binary-authorization
$ cd hack-on-python-binary-authorization
# Configure remotes such that you can pull changes from the googleapis/python-binary-authorization
$ git clone git@github.com:USERNAME/google-cloud-python.git hack-on-google-cloud-python
$ cd hack-on-google-cloud-python
# Configure remotes such that you can pull changes from the googleapis/google-cloud-python
# repository into your local repository.
$ git remote add upstream git@github.com:googleapis/python-binary-authorization.git
$ git remote add upstream git@github.com:googleapis/google-cloud-python.git
# fetch and merge changes from upstream into main
$ git fetch upstream
$ git merge upstream/main
Expand All @@ -60,7 +60,7 @@ repo, from which you can submit a pull request.
To work on the codebase and run the tests, we recommend using ``nox``,
but you can also use a ``virtualenv`` of your own creation.

.. _repo: https://github.com/googleapis/python-binary-authorization
.. _repo: https://github.com/googleapis/google-cloud-python

Using ``nox``
=============
Expand Down Expand Up @@ -113,7 +113,7 @@ Coding Style
export GOOGLE_CLOUD_TESTING_BRANCH="main"

By doing this, you are specifying the location of the most up-to-date
version of ``python-binary-authorization``. The
version of ``google-cloud-python``. The
remote name ``upstream`` should point to the official ``googleapis``
checkout and the branch should be the default branch on that remote (``main``).

Expand Down Expand Up @@ -209,7 +209,7 @@ The `description on PyPI`_ for the project comes directly from the
``README``. Due to the reStructuredText (``rst``) parser used by
PyPI, relative links which will work on GitHub (e.g. ``CONTRIBUTING.rst``
instead of
``https://github.com/googleapis/python-binary-authorization/blob/main/CONTRIBUTING.rst``)
``https://github.com/googleapis/google-cloud-python/blob/main/CONTRIBUTING.rst``)
may cause problems creating links or rendering the description.

.. _description on PyPI: https://pypi.org/project/google-cloud-binary-authorization
Expand All @@ -236,7 +236,7 @@ We support:

Supported versions can be found in our ``noxfile.py`` `config`_.

.. _config: https://github.com/googleapis/python-binary-authorization/blob/main/packages/google-cloud-binary-authorization/noxfile.py
.. _config: https://github.com/googleapis/google-cloud-python/blob/main/packages/google-cloud-binary-authorization/noxfile.py


**********
Expand Down
2 changes: 1 addition & 1 deletion packages/google-cloud-binary-authorization/docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@
html_theme_options = {
"description": "Google Cloud Client Libraries for google-cloud-binary-authorization",
"github_user": "googleapis",
"github_repo": "python-binary-authorization",
"github_repo": "google-cloud-python",
"github_banner": True,
"font_family": "'Roboto', Georgia, sans",
"head_font_family": "'Roboto', Georgia, serif",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,11 @@ class ImageDetails(proto.Message):
Attributes:
image (str):
The name of the image.
container_name (str):
The name of the container.
container_type (google.cloud.binaryauthorization_v1beta1.types.ContinuousValidationEvent.ContinuousValidationPodEvent.ImageDetails.ContainerType):
The container type that this image belongs
to.
result (google.cloud.binaryauthorization_v1beta1.types.ContinuousValidationEvent.ContinuousValidationPodEvent.ImageDetails.AuditResult):
The result of the audit for this image.
description (str):
Expand All @@ -97,6 +102,27 @@ class ImageDetails(proto.Message):
List of check results.
"""

class ContainerType(proto.Enum):
r"""The container type.
Values:
CONTAINER_TYPE_UNSPECIFIED (0):
The container type should always be
specified. This is an error.
CONTAINER (1):
A regular deployment.
INIT_CONTAINER (2):
Init container defined as specified at
https://kubernetes.io/docs/concepts/workloads/pods/init-containers/
EPHEMERAL_CONTAINER (3):
Ephemeral container defined as specified at
https://kubernetes.io/docs/concepts/workloads/pods/ephemeral-containers/
"""
CONTAINER_TYPE_UNSPECIFIED = 0
CONTAINER = 1
INIT_CONTAINER = 2
EPHEMERAL_CONTAINER = 3

class AuditResult(proto.Enum):
r"""Result of the audit.
Expand Down Expand Up @@ -225,6 +251,15 @@ class CheckSetScope(proto.Message):
proto.STRING,
number=1,
)
container_name: str = proto.Field(
proto.STRING,
number=5,
)
container_type: "ContinuousValidationEvent.ContinuousValidationPodEvent.ImageDetails.ContainerType" = proto.Field(
proto.ENUM,
number=6,
enum="ContinuousValidationEvent.ContinuousValidationPodEvent.ImageDetails.ContainerType",
)
result: "ContinuousValidationEvent.ContinuousValidationPodEvent.ImageDetails.AuditResult" = proto.Field(
proto.ENUM,
number=2,
Expand Down

0 comments on commit b063395

Please sign in to comment.