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

SC settings for ApiServerSource's Receive Adapter's container/deployment #6788

Merged
merged 1 commit into from
Mar 3, 2023

Conversation

matzew
Copy link
Member

@matzew matzew commented Feb 28, 2023

Fixes #6787

Proposed Changes

Pre-review Checklist

  • At least 80% unit test coverage
  • E2E tests for any new behavior
  • Docs PR for any user-facing impact
  • Spec PR for any new API feature
  • Conformance test for any change to the spec

Release Note

SecurityContext settings for ApiServerSource's Receive Adapter's container/deployment 

Docs

@knative-prow knative-prow bot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. approved Indicates a PR has been approved by an approver from all required OWNERS files. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Feb 28, 2023
@codecov
Copy link

codecov bot commented Feb 28, 2023

Codecov Report

Patch coverage: 100.00% and no project coverage change

Comparison is base (b474770) 80.44% compared to head (a5a6d5f) 80.45%.

❗ Current head a5a6d5f differs from pull request most recent head 527cfb6. Consider uploading reports for the commit 527cfb6 to get more accurate results

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #6788   +/-   ##
=======================================
  Coverage   80.44%   80.45%           
=======================================
  Files         236      236           
  Lines       12206    12212    +6     
=======================================
+ Hits         9819     9825    +6     
  Misses       1896     1896           
  Partials      491      491           
Impacted Files Coverage Δ
...ciler/apiserversource/resources/receive_adapter.go 92.62% <100.00%> (+0.38%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@matzew matzew changed the title WIP: Set them all, like on the manifests SC settings for ApiServerSource's Receive Adapter's container/deployment Mar 3, 2023
@knative-prow knative-prow bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Mar 3, 2023
@matzew
Copy link
Member Author

matzew commented Mar 3, 2023

I tested this with 1.24 and also 1.26 -> works fine

Comment on lines 106 to 112
SecurityContext: &corev1.SecurityContext{
AllowPrivilegeEscalation: ptr.Bool(false),
ReadOnlyRootFilesystem: ptr.Bool(true),
RunAsNonRoot: ptr.Bool(true),
Capabilities: &corev1.Capabilities{Drop: []corev1.Capability{"ALL"}},
},
Copy link
Member

Choose a reason for hiding this comment

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

Missing SeccompProfile: &corev1.SeccompProfile{Type: corev1.SeccompProfileTypeRuntimeDefault}, ?

Copy link
Member Author

Choose a reason for hiding this comment

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

yeah, forgot to push that 🙃

@matzew
Copy link
Member Author

matzew commented Mar 3, 2023

For now we just set the SC and skip the SeccompProfile

If we want we can update the PR

@pierDipi
Copy link
Member

pierDipi commented Mar 3, 2023

We're setting seccompProfile on every other deployment why not setting it for this as well?

https://github.com/knative/eventing/blob/7d7df2daa569b7220f9810733acee99e42ee03a8/config/core/deployments/controller.yaml#LL100-L101

Signed-off-by: Matthias Wessendorf <mwessend@redhat.com>
@matzew
Copy link
Member Author

matzew commented Mar 3, 2023

yeah, it is more consistent, I've update the deployment and its test

@matzew
Copy link
Member Author

matzew commented Mar 3, 2023

@pierDipi please take a look

Copy link
Member

@pierDipi pierDipi left a comment

Choose a reason for hiding this comment

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

/lgtm
/approve

@knative-prow knative-prow bot added the lgtm Indicates that a PR is ready to be merged. label Mar 3, 2023
@knative-prow
Copy link

knative-prow bot commented Mar 3, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: matzew, pierDipi

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

@knative-prow knative-prow bot merged commit 397387e into knative:main Mar 3, 2023
@matzew
Copy link
Member Author

matzew commented Mar 6, 2023

/cherry-pick release-1.9

@matzew
Copy link
Member Author

matzew commented Mar 6, 2023

/cherry-pick release-1.8

@knative-prow-robot
Copy link
Contributor

@matzew: new pull request created: #6792

In response to this:

/cherry-pick release-1.9

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.

@knative-prow-robot
Copy link
Contributor

@matzew: new pull request created: #6793

In response to this:

/cherry-pick release-1.8

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.

knative-prow bot pushed a commit that referenced this pull request Mar 6, 2023
…tainer/deployment (#6793)

This is an automated cherry-pick of #6788

```release-note
SecurityContext settings for ApiServerSource's Receive Adapter's container/deployment
```

Signed-off-by: Matthias Wessendorf <mwessend@redhat.com>
Co-authored-by: Matthias Wessendorf <mwessend@redhat.com>
knative-prow bot pushed a commit that referenced this pull request Mar 6, 2023
…tainer/deployment (#6792)

This is an automated cherry-pick of #6788

```release-note
SecurityContext settings for ApiServerSource's Receive Adapter's container/deployment
```

Signed-off-by: Matthias Wessendorf <mwessend@redhat.com>
Co-authored-by: Matthias Wessendorf <mwessend@redhat.com>
vishal-chdhry pushed a commit to vishal-chdhry/eventing that referenced this pull request Mar 14, 2023
…ent (knative#6788)

Fixes knative#6787

<!-- Please include the 'why' behind your changes if no issue exists -->

## Proposed Changes

<!-- Please categorize your changes:
- 🎁 Add new feature
- 🐛 Fix bug
- 🧹 Update or clean up current behavior
- 🗑️ Remove feature or internal logic
-->

- similar to our static manifests we set the required SC bits (see:
knative#6533), except SeccompProfile

### Pre-review Checklist

<!-- If these boxes are not checked, you will be asked to complete these
requirements or explain why they do not apply to your PR. -->

- [ ] **At least 80% unit test coverage**
- [ ] **E2E tests** for any new behavior
- [ ] **Docs PR** for any user-facing impact
- [ ] **Spec PR** for any new API feature
- [ ] **Conformance test** for any change to the spec

**Release Note**

<!--
:page_facing_up: If this change has user-visible impact, write a release
note in the block
below. Include the string "action required" if additional action is
required of
users switching to the new release, for example in case of a breaking
change.

Write as if you are speaking to users, not other Knative contributors.
If this
change has no user-visible impact, no release note is needed.
-->

```release-note
SecurityContext settings for ApiServerSource's Receive Adapter's container/deployment 
```


**Docs**

<!--
:book: If this change has user-visible impact, link to an issue or PR in
https://github.com/knative/docs.
-->

Signed-off-by: Matthias Wessendorf <mwessend@redhat.com>
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. lgtm Indicates that a PR is ready to be merged. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ApiServerSource creates receive adapter deployments dynamically without setting SecurityContext
4 participants