Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
barry cho
Rancher
Commits
8cc12df0
Commit
8cc12df0
authored
6 years ago
by
orangedeng
Committed by
Alena Prokharchyk
6 years ago
Browse files
Options
Download
Email Patches
Plain Diff
Operator workload Should be displayed in Rancher UI
parent
cc0d9af6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
pkg/api/store/workload/transform_store.go
+18
-0
pkg/api/store/workload/transform_store.go
with
18 additions
and
0 deletions
+18
-0
pkg/api/store/workload/transform_store.go
+
18
-
0
View file @
8cc12df0
...
...
@@ -12,6 +12,10 @@ import (
"github.com/sirupsen/logrus"
)
var
(
hideOwnerReferenceKinds
=
map
[
string
]
bool
{
"CronJob"
:
true
,
"Deployment"
:
true
}
)
func
NewTransformStore
(
store
types
.
Store
)
types
.
Store
{
return
&
transform
.
Store
{
Store
:
store
,
...
...
@@ -24,6 +28,7 @@ func NewTransformStore(store types.Store) types.Store {
hide
=
false
}
typeName
:=
definition
.
GetType
(
data
)
hide
=
hideByOwner
(
data
)
name
,
_
:=
data
[
"name"
]
.
(
string
)
if
hide
&&
data
[
"ownerReferences"
]
!=
nil
{
pod
.
SaveOwner
(
apiContext
,
typeName
,
name
,
data
)
...
...
@@ -89,3 +94,16 @@ func update(data map[string]interface{}, statusField string, desiredField string
}
}
}
func
hideByOwner
(
data
map
[
string
]
interface
{})
bool
{
if
data
[
"ownerReferences"
]
!=
nil
{
owners
:=
convert
.
ToMapSlice
(
data
[
"ownerReferences"
])
for
_
,
owner
:=
range
owners
{
ownerKind
:=
convert
.
ToString
(
owner
[
"kind"
])
if
_
,
ok
:=
hideOwnerReferenceKinds
[
ownerKind
];
ok
{
return
true
}
}
}
return
false
}
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment