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

k8s conversion code handles 1.7 clusters #531

Merged
merged 1 commit into from
Sep 24, 2017

Conversation

caseydavenport
Copy link
Member

Description

Fixes our conversion logic in KDD such that it works on clusters running k8s <=v1.7.0.

In this scenario, the API doesn't return a policyTypes for any NetworkPolicies and we need to thus infer that the policy should only affect ingress traffic since k8s pre-1.8 (and pre-policyTypes) didn't support egress policies.

Todos

  • Tests
  • Documentation
  • Release note

Release Note

None required

@@ -846,6 +846,421 @@ var _ = Describe("Test NetworkPolicy conversion", func() {
})
})

// This suite of tests is useful for ensuring we continue to support kubernetes apiserver
// versions <= 1.7.x, and can be removed when that is no longer required.
var _ = Describe("Test NetworkPolicy conversion (k8s <= 1.7, no policyTypes)", func() {
Copy link
Member Author

@caseydavenport caseydavenport Sep 24, 2017

Choose a reason for hiding this comment

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

This is a copy of the NetworkPolicy tests from above (minus egress/cidr), but each with the policyTypes section removed to make it look like it would appear on a k8s 1.7 cluster.

The assertions made in each test are the same.

Copy link
Contributor

@bcreane bcreane left a comment

Choose a reason for hiding this comment

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

yes, this looks correct.

@caseydavenport caseydavenport merged commit 5cabf71 into projectcalico:master Sep 24, 2017
@caseydavenport caseydavenport deleted the fix-defaulting branch September 24, 2017 15:45
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