forked from kubeovn/kube-ovn
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
delete legacy acls when upgrading to v1.13.x (kubeovn#4742)
the acls in v1.13.x are in tier 2 rather than tier 0 in v1.12.x, the legacy acls may cause some unexpected behaviors because acls in tier 0 have the higest priority. we should delete legacy acls and recreate them when upgrading to v1.13.x. Signed-off-by: suo <[email protected]>
- Loading branch information
Showing
20 changed files
with
435 additions
and
59 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package controller | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/kubeovn/kube-ovn/pkg/util" | ||
"github.com/stretchr/testify/require" | ||
"go.uber.org/mock/gomock" | ||
netv1 "k8s.io/api/networking/v1" | ||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | ||
) | ||
|
||
func Test_upgradeNetworkPolicies(t *testing.T) { | ||
t.Parallel() | ||
|
||
fakeController := newFakeController(t) | ||
ctrl := fakeController.fakeController | ||
fakeinformers := fakeController.fakeInformers | ||
mockOvnClient := fakeController.mockOvnClient | ||
|
||
np := &netv1.NetworkPolicy{ | ||
ObjectMeta: metav1.ObjectMeta{ | ||
Name: "np1", | ||
Namespace: "default", | ||
}, | ||
} | ||
|
||
err := fakeinformers.npInformer.Informer().GetStore().Add(np) | ||
require.NoError(t, err) | ||
|
||
mockOvnClient.EXPECT().DeleteAcls(gomock.Any(), portGroupKey, "", nil, util.DefaultACLTier).Return(nil) | ||
|
||
err = ctrl.upgradeNetworkPolicies() | ||
require.NoError(t, err) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.