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

Implement list command #2

Merged
merged 5 commits into from
May 15, 2024
Merged

Implement list command #2

merged 5 commits into from
May 15, 2024

Conversation

yokaze
Copy link
Contributor

@yokaze yokaze commented Apr 3, 2024

This PR contains the following four commits:

1. Respect cached files

Fix Makefile and Helm file cache to make them work properly.

2. Run test pods

Deploy some test pods with L3 policies.

  • self: entry point
  • ingress-explicit-allow: egress from self and ingress to ingress-explicit-allow are allowed
  • ingress-no-rule: egress from self is allowed and ingress to ingress-no-rule is implicitly allowed (no rule)
  • ingress-explicit-deny: egress from self is allowed but ingress to ingress-explicit-deny is explicitly denied
  • egress-implicit-deny: egress from self to egress-implicit-deny is implicitly denied
  • egress-explicit-deny: egress from self to egress-explicit-deny is explicitly denied

3. Implement list command

Implement cilium-policy list that shows the list of NetworkPolicy applied to a specific pod.
Currently the available output format is only json: simple will be available in future.

Also cilium-policy dump is heavily refactored using common helper functions.

4. Check go.mod

Just check go.mod is up-to-date.

Signed-off-by: Daichi Sakaue daichi-sakaue@cybozu.co.jp

@yokaze yokaze self-assigned this Apr 3, 2024
@yokaze yokaze marked this pull request as ready for review April 3, 2024 07:23
@yokaze yokaze requested a review from chez-shanpu April 3, 2024 07:23
@chez-shanpu chez-shanpu marked this pull request as draft April 5, 2024 04:17
@yokaze yokaze force-pushed the l3-test-setup branch 4 times, most recently from 9cf3c38 to fe67c77 Compare April 5, 2024 06:09
Signed-off-by: Daichi Sakaue <daichi-sakaue@cybozu.co.jp>
Signed-off-by: Daichi Sakaue <daichi-sakaue@cybozu.co.jp>
@yokaze yokaze force-pushed the l3-test-setup branch 2 times, most recently from 1b951c7 to d831339 Compare April 5, 2024 07:06
@yokaze yokaze changed the title Run test pods Implement list command Apr 5, 2024
@yokaze yokaze marked this pull request as ready for review April 5, 2024 07:18
Signed-off-by: Daichi Sakaue <daichi-sakaue@cybozu.co.jp>
Signed-off-by: Daichi Sakaue <daichi-sakaue@cybozu.co.jp>
@@ -5,7 +5,7 @@ on:
branches:
- main
env:
cache-version: 1
cache-version: "2024-04-05"

Choose a reason for hiding this comment

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

Why do you use date as cache-version?
And also, I wonder if we need cache-version. Are there any cases that hashFiles is not sufficient?

Copy link
Contributor Author

@yokaze yokaze Apr 8, 2024

Choose a reason for hiding this comment

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

@chez-shanpu
It is an old practice to allow invalidating caches when it is contaminated by a broken CI workflow.
However I always hesitate to update the version one: it looks like having a special meaning. Using a date looks more meaningless.

Choose a reason for hiding this comment

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

@yokaze I see. How about deleting a cache like gh cache delete when it is contaminated instead of using cache-version?

Copy link
Contributor Author

@yokaze yokaze Apr 9, 2024

Choose a reason for hiding this comment

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

@chez-shanpu
It looks reasonable, I removed the cache-version parameter. Thanks for the info!

Makefile Show resolved Hide resolved
@yokaze yokaze requested a review from chez-shanpu April 8, 2024 09:07
Signed-off-by: Daichi Sakaue <daichi-sakaue@cybozu.co.jp>
Copy link

@chez-shanpu chez-shanpu left a comment

Choose a reason for hiding this comment

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

LGTM

@yokaze yokaze merged commit 321b6a5 into main May 15, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants