Skip to content

Commit

Permalink
fix ads start issues
Browse files Browse the repository at this point in the history
Signed-off-by: superCharge-xsy <[email protected]>
  • Loading branch information
supercharge-xsy committed Aug 24, 2024
1 parent ad12d91 commit 82a01b8
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
1 change: 0 additions & 1 deletion bpf/include/bpf_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,6 @@ static inline void *kmesh_get_ptr_val(const void *ptr)
__u32 inner_idx = 0;
__u64 idx = (__u64)ptr;

BPF_LOG(DEBUG, KMESH, "kmesh_get_ptr_val idx=%u\n", idx);
if (!ptr) {
return NULL;
}
Expand Down
5 changes: 3 additions & 2 deletions pkg/auth/policy_store.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ func newPolicyStore() *policyStore {
}
}

func flushAuthzMap(policyName string, authzPolicy *security.Authorization) error {
//go:noinline
func FlushAuthzMap(policyName string, authzPolicy *security.Authorization) error {
return maps_v2.AuthorizationUpdate(policyName, authzPolicy)
}

Expand All @@ -52,7 +53,7 @@ func (ps *policyStore) updatePolicy(authPolicy *security.Authorization) error {
return nil
}
key := authPolicy.ResourceName()
if err := flushAuthzMap(key, authPolicy); err != nil {
if err := FlushAuthzMap(key, authPolicy); err != nil {
return fmt.Errorf("flushAuthzMap failed %v ", err)

Check warning on line 57 in pkg/auth/policy_store.go

View check run for this annotation

Codecov / codecov/patch

pkg/auth/policy_store.go#L57

Added line #L57 was not covered by tests
}

Expand Down
3 changes: 2 additions & 1 deletion pkg/controller/workload/workload_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ func TestWorkloadStreamCreateAndSend(t *testing.T) {
Stream: fakeClient.DeltaClient,
}

patches0 := gomonkey.NewPatches()
patches1 := gomonkey.NewPatches()
patches2 := gomonkey.NewPatches()
tests := []struct {
Expand Down Expand Up @@ -148,8 +149,8 @@ func TestWorkloadStreamCreateAndSend(t *testing.T) {
{
name: "should take initial authorization versions",
beforeFunc: func(t *testing.T) {
patches0.ApplyFuncReturn(auth.FlushAuthzMap, nil)
patches1.ApplyMethodReturn(fakeClient.Client, "DeltaAggregatedResources", fakeClient.DeltaClient, nil)

workloadController.Processor = newProcessor(workloadMap)
workloadController.Rbac = auth.NewRbac(nil)
workloadController.Rbac.UpdatePolicy(&security.Authorization{
Expand Down

0 comments on commit 82a01b8

Please sign in to comment.