-
Notifications
You must be signed in to change notification settings - Fork 984
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
Add network policy resource with support for 1.8+ fields #118
Add network policy resource with support for 1.8+ fields #118
Conversation
7419cc5
to
405e938
Compare
Unit tests results
|
Acceptance tests results
|
405e938
to
565a859
Compare
565a859
to
773cec0
Compare
There is a bug that requires applying the configuration twice when egress contains a single empty map:
After first apply, the following diff is still there:
On second apply, it is gone. |
773cec0
to
15e6210
Compare
15e6210
to
0ba7866
Compare
The issue when the Network Policy has an egress at creation is resolved. |
Acceptance tests results
|
Acceptance tests results with policy_types assertions
|
NoteI've made the During the initial creation, a default value is determined and stored, then Leaving the Edit: I initially considered leaving it optional and overriding the default behavior client side but this started to make it overly complicated. |
3f17665
to
805e685
Compare
Rebased on master to use k8s 1.10 clients libraries. |
Acceptance tests resultsNew run after rebase on master that provides k8s 1.10 client libs with local minikube 0.29/kubernetes 1.10.0:
|
I've added the documentation for the k8s 1.8+ fields. |
Acceptance tests resultsNew run with local minikube 0.30 / kubernetes 1.12.1:
|
cc2f6b6
to
af19aa2
Compare
af19aa2
to
4736f9a
Compare
4736f9a
to
c00c61c
Compare
Hi @alexsomesan, would you mind having a look at this PR? I believe it would be a good candidate for the v1.4.0 milestone. |
…ymmetric behavior
… evaluated server side on resource creation
Rebased on master. |
05de880
to
5c45144
Compare
Acceptance tests results:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks very nice overall.
Just one small thing: please remove the d.SetId("") in the Delete function, then we're good to go.
Did you test build this with Go 1.11.x?
|
||
// Use generated swagger docs from kubernetes' client-go to avoid copy/pasting them here | ||
var ( | ||
networkPolicySpecDoc = api.NetworkPolicy{}.SwaggerDoc()["spec"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice idea!
All recent builds and tests done with:
|
Acceptance tests results:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Thank you so much @alexsomesan ! |
@@ -8,6 +8,10 @@ BUG FIXES: | |||
|
|||
* `resource/kubernetes_stateful_set`: Fix updates of stateful set images ([#252](https://github.com/terraform-providers/terraform-provider-kubernetes/issues/252)) | |||
|
|||
FEATURES: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@alexsomesan I should probably have put FEATURES
before IMPROVEMENTS
and BUG FIXES
This is basically the same as #113 but with support for k8s 1.8+ Network Policy fields: egress, ip_block and policy_types.
This requires #117 for up to date k8s 1.9 client libraries.Up to date k8s 1.10 client libraries provided by #162
TODO: