Skip to content
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

Override audit policy for conformance informing jobs #19502

Merged
merged 1 commit into from
Oct 16, 2020

Conversation

hh
Copy link
Member

@hh hh commented Oct 8, 2020

An alternative to kubernetes/kubernetes#95388

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Oct 8, 2020
@k8s-ci-robot k8s-ci-robot added area/config Issues or PRs related to code in /config area/jobs area/provider/gcp Issues or PRs related to gcp provider sig/cloud-provider Categorizes an issue or PR as relevant to SIG Cloud Provider. sig/testing Categorizes an issue or PR as relevant to SIG Testing. labels Oct 8, 2020
env:
- name: ENABLE_APISERVER_ADVANCED_AUDIT
value: "true"
- name: ADVANCED_AUDIT_POLICY
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we should change the default audit policy for the default e2e job

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Currently we need the results of a full test run (for all tests, not just the conformance runs, so we can see tests that we could promote, or emulate to hit with conformance tests.

Is there another job we could modify that has similar perodicity that's not the default job?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm fine leaving it alone for now. It means we might be lacking non-conformance test coverage, but it's not as important as conformance coverage itself.

env:
- name: ENABLE_APISERVER_ADVANCED_AUDIT
value: "true"
- name: ADVANCED_AUDIT_POLICY
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you comment why this is here? In an ideal world, this job would be rewritten to patch the existing default policy .yaml, and explain why the patch. Pretend you're a future maintainer trying to understand what this is, whether this is safe to remove, or when/why it needs to be changed.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems to be the correct place to over-ride based on the underlying scripts.

https://github.com/kubernetes/kubernetes/blob/397466dec4c3f8cbf577cb7378a081fe9dad4c6c/cluster/gce/gci/configure-kubeapiserver.sh#L146-L150

Should we instead update the cmd/args of the job to run a series of commands to first run 'sed/awk' to patch / remove this, before we run the existing job:

https://github.com/kubernetes/kubernetes/blob/b1e3a2ac7a80d49ef6153457eaa35dac4fc98444/cluster/gce/gci/configure-helper.sh#L1178-L1182

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The patch, if we found a way to cleanly apply it within the job:

    diff default-policy.json new-policy.json 2>&1
  71,75d70
  <   # Don't log events requests.
  <   - level: None
  <     resources:
  <       - group: "" # core
  <         resources: ["events"]

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I updated the PR to only update the conformance job, and added a comment as to why we override the audit policy, including that it would be better to patch rather than override if possible.

@hh hh force-pushed the conformance-audit-policy branch from 6fe3323 to 7bb4a9f Compare October 9, 2020 19:27
# and then removed the block that says "don't log events"
#
# NOTE: if the default audit policy changes, this will need to be updated accordingly
# TODO(link-to-a-github-issue): ideally we could do this via a patch instead
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I meant to imply you should make a github issue and link to it here

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry I missed that: #19613 created and added to the comment.

Co-authored-by: Aaron Crickenberger <spiffxp@google.com>
@hh hh force-pushed the conformance-audit-policy branch from 3fa5485 to 57d7311 Compare October 16, 2020 22:42
Copy link
Member

@spiffxp spiffxp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/approve
/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Oct 16, 2020
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: hh, spiffxp

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Oct 16, 2020
@k8s-ci-robot k8s-ci-robot merged commit 4fdaee8 into kubernetes:master Oct 16, 2020
@k8s-ci-robot k8s-ci-robot added this to the v1.20 milestone Oct 16, 2020
@k8s-ci-robot
Copy link
Contributor

@hh: Updated the job-config configmap in namespace default at cluster test-infra-trusted using the following files:

  • key gce-conformance.yaml using file config/jobs/kubernetes/sig-cloud-provider/gcp/gce-conformance.yaml

In response to this:

An alternative to kubernetes/kubernetes#95388

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@spiffxp
Copy link
Member

spiffxp commented Oct 19, 2020

This caused the job to start failing (ref: #19613 (comment)) so I opened a revert #19618

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. area/config Issues or PRs related to code in /config area/jobs area/provider/gcp Issues or PRs related to gcp provider cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. sig/cloud-provider Categorizes an issue or PR as relevant to SIG Cloud Provider. sig/testing Categorizes an issue or PR as relevant to SIG Testing. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants