-
Notifications
You must be signed in to change notification settings - Fork 147
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
azurefile: kata/kata-cc: add kata node conditional #2346
base: master
Are you sure you want to change the base?
Conversation
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: arc9693 The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Hi @arc9693. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. 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-sigs/prow repository. |
b602c0f
to
aab21e8
Compare
To do for ready to be reviewed:
|
Also to support vanilla Kata |
aab21e8
to
6ff0679
Compare
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.
/ok-to-test
a7aee7d
to
bebaae9
Compare
@arc9693: The following test failed, say
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. 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-sigs/prow repository. I understand the commands that are listed here. |
} | ||
|
||
func isKataNode(ctx context.Context, nodeID string, kubeClient clientset.Interface) bool { | ||
kataVMIsolationLabel, kataRuntimeLabel, err := getNodeInfoFromLabels(ctx, nodeID, kubeClient) |
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.
if nodeID == "" {
// driver controller
return false
}
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.
thus in driver controller pod, it does not need to get node labels since nodeID is empty
func TestGetNodeInfoFromLabels(t *testing.T) { | ||
ctx := context.TODO() | ||
|
||
// Test case where kubeClient is nil |
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.
could you write unit test like this?
azurefile-csi-driver/pkg/azurefile/utils_test.go
Lines 154 to 198 in 7756c11
func TestIsSupportedShareNamePrefix(t *testing.T) { | |
tests := []struct { | |
prefix string | |
expectedResult bool | |
}{ | |
{ | |
prefix: "", | |
expectedResult: true, | |
}, | |
{ | |
prefix: "ext3", | |
expectedResult: true, | |
}, | |
{ | |
prefix: "ext-2", | |
expectedResult: true, | |
}, | |
{ | |
prefix: "-xfs", | |
expectedResult: false, | |
}, | |
{ | |
prefix: "Absdf", | |
expectedResult: false, | |
}, | |
{ | |
prefix: "tooooooooooooooooooooooooolong", | |
expectedResult: false, | |
}, | |
{ | |
prefix: "+invalid", | |
expectedResult: false, | |
}, | |
{ | |
prefix: " invalidspace", | |
expectedResult: false, | |
}, | |
} | |
for _, test := range tests { | |
result := isSupportedShareNamePrefix(test.prefix) | |
if result != test.expectedResult { | |
t.Errorf("isSupportedShareNamePrefix(%s) returned with %v, not equal to %v", test.prefix, result, test.expectedResult) | |
} | |
} |
} | ||
|
||
func TestIsKataNode(t *testing.T) { | ||
ctx := context.TODO() |
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.
could you write unit test like this?
azurefile-csi-driver/pkg/azurefile/utils_test.go
Lines 154 to 198 in 7756c11
func TestIsSupportedShareNamePrefix(t *testing.T) { | |
tests := []struct { | |
prefix string | |
expectedResult bool | |
}{ | |
{ | |
prefix: "", | |
expectedResult: true, | |
}, | |
{ | |
prefix: "ext3", | |
expectedResult: true, | |
}, | |
{ | |
prefix: "ext-2", | |
expectedResult: true, | |
}, | |
{ | |
prefix: "-xfs", | |
expectedResult: false, | |
}, | |
{ | |
prefix: "Absdf", | |
expectedResult: false, | |
}, | |
{ | |
prefix: "tooooooooooooooooooooooooolong", | |
expectedResult: false, | |
}, | |
{ | |
prefix: "+invalid", | |
expectedResult: false, | |
}, | |
{ | |
prefix: " invalidspace", | |
expectedResult: false, | |
}, | |
} | |
for _, test := range tests { | |
result := isSupportedShareNamePrefix(test.prefix) | |
if result != test.expectedResult { | |
t.Errorf("isSupportedShareNamePrefix(%s) returned with %v, not equal to %v", test.prefix, result, test.expectedResult) | |
} | |
} |
What type of PR is this?
/kind feature
What this PR does / why we need it:
New Volumes: AzureFile CSI volumes created after enabling ConfPods are functional and shared across new Confidential and Non confidential Pods as expected.
Existing Volumes: Volumes created earlier for runc or Kata containers cannot be leveraged by Confidential Pods.
enableKataCCMount
and instead relies on node labels to get the infoWhich issue(s) this PR fixes:
Fixes #
Related ADO bugs: https://microsoft.visualstudio.com/OS/_workitems/edit/55326325/, https://microsoft.visualstudio.com/OS/_workitems/edit/56384073/
Requirements:
Special notes for your reviewer:
Release note: