forked from fluid-cloudnative/fluid
-
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.
[BUGFIX]Fix thinruntime resource overridden (fluid-cloudnative#2548)
* Fix thinruntime fuse resource overridden Signed-off-by: dongyun.xzh <[email protected]> * Fix thinruntime worker resource overridden Signed-off-by: dongyun.xzh <[email protected]> --------- Signed-off-by: dongyun.xzh <[email protected]>
- Loading branch information
1 parent
c7b32e6
commit 157865c
Showing
56 changed files
with
6,002 additions
and
1,660 deletions.
There are no files selected for viewing
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,43 @@ | ||
package testutil | ||
|
||
import ( | ||
"reflect" | ||
|
||
"github.com/stretchr/testify/assert" | ||
) | ||
|
||
// DeepEqualIgnoringSliceOrder is much like reflect.DeepEqual but ignores order of slices | ||
// in any structs. This is a function only used for unit tests since many objects in Kubernetes | ||
// should be considered same ignoring the slice order(e.g. VolumeMounts, Volumes, EnvVar, etc.) | ||
// NOTE: The func cannot handle recursive composite types like [][]interface, map[X][]interface, etc. | ||
func DeepEqualIgnoringSliceOrder(t assert.TestingT, x interface{}, y interface{}) bool { | ||
if x == nil || y == nil { | ||
return x == y | ||
} | ||
v1 := reflect.ValueOf(x) | ||
v2 := reflect.ValueOf(y) | ||
if v1.Type() != v2.Type() { | ||
return false | ||
} | ||
|
||
switch v1.Kind() { | ||
case reflect.Array: | ||
return assert.ElementsMatch(t, v1.Interface(), v2.Interface()) | ||
case reflect.Slice: | ||
return assert.ElementsMatch(t, v1.Interface(), v2.Interface()) | ||
case reflect.Ptr: | ||
if v1.Pointer() == v2.Pointer() { | ||
return true | ||
} | ||
return DeepEqualIgnoringSliceOrder(t, v1.Elem().Interface(), v2.Elem().Interface()) | ||
case reflect.Struct: | ||
for i, n := 0, v1.NumField(); i < n; i++ { | ||
if !DeepEqualIgnoringSliceOrder(t, v1.Field(i).Interface(), v2.Field(i).Interface()) { | ||
return false | ||
} | ||
} | ||
return true | ||
default: | ||
return reflect.DeepEqual(x, y) | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.