Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
小 白蛋
Octant
Commits
ccecf157
Commit
ccecf157
authored
5 years ago
by
Wayne Witzel III
Browse files
Options
Download
Email Patches
Plain Diff
add error store to live config
parent
7098496f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
internal/config/dash.go
+11
-0
internal/config/dash.go
internal/config/dash_test.go
+4
-1
internal/config/dash_test.go
internal/dash/dash.go
+8
-1
internal/dash/dash.go
with
23 additions
and
2 deletions
+23
-2
internal/config/dash.go
+
11
-
0
View file @
ccecf157
...
...
@@ -15,6 +15,7 @@ import (
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
"github.com/vmware/octant/internal/cluster"
internalErr
"github.com/vmware/octant/internal/errors"
"github.com/vmware/octant/internal/log"
"github.com/vmware/octant/internal/module"
"github.com/vmware/octant/internal/portforward"
...
...
@@ -77,6 +78,8 @@ type Dash interface {
ObjectStore
()
store
.
Store
ErrorStore
()
internalErr
.
ErrorStore
Logger
()
log
.
Logger
PluginManager
()
plugin
.
ManagerInterface
...
...
@@ -103,6 +106,7 @@ type Live struct {
logger
log
.
Logger
moduleManager
module
.
ManagerInterface
objectStore
store
.
Store
errorStore
internalErr
.
ErrorStore
pluginManager
plugin
.
ManagerInterface
portForwarder
portforward
.
PortForwarder
kubeConfigPath
string
...
...
@@ -120,6 +124,7 @@ func NewLiveConfig(
logger
log
.
Logger
,
moduleManager
module
.
ManagerInterface
,
objectStore
store
.
Store
,
errorStore
internalErr
.
ErrorStore
,
pluginManager
plugin
.
ManagerInterface
,
portForwarder
portforward
.
PortForwarder
,
currentContextName
string
,
...
...
@@ -132,6 +137,7 @@ func NewLiveConfig(
logger
:
logger
,
moduleManager
:
moduleManager
,
objectStore
:
objectStore
,
errorStore
:
errorStore
,
pluginManager
:
pluginManager
,
portForwarder
:
portForwarder
,
currentContextName
:
currentContextName
,
...
...
@@ -164,6 +170,11 @@ func (l *Live) ObjectStore() store.Store {
return
l
.
objectStore
}
// ErrorStore returns an error store.
func
(
l
*
Live
)
ErrorStore
()
internalErr
.
ErrorStore
{
return
l
.
errorStore
}
// KubeConfigPath returns the kube config path.
func
(
l
*
Live
)
KubeConfigPath
()
string
{
return
l
.
kubeConfigPath
...
...
This diff is collapsed.
Click to expand it.
internal/config/dash_test.go
+
4
-
1
View file @
ccecf157
...
...
@@ -16,6 +16,7 @@ import (
"github.com/vmware/octant/internal/cluster"
clusterFake
"github.com/vmware/octant/internal/cluster/fake"
internalErr
"github.com/vmware/octant/internal/errors"
"github.com/vmware/octant/internal/log"
moduleFake
"github.com/vmware/octant/internal/module/fake"
portForwardFake
"github.com/vmware/octant/internal/portforward/fake"
...
...
@@ -80,6 +81,8 @@ func TestLiveConfig(t *testing.T) {
Return
(
"/pod"
,
nil
)
objectStore
:=
objectStoreFake
.
NewMockStore
(
controller
)
errorStore
,
err
:=
internalErr
.
NewErrorStore
()
assert
.
NoError
(
t
,
err
)
pluginManager
:=
pluginFake
.
NewMockManagerInterface
(
controller
)
portForwarder
:=
portForwardFake
.
NewMockPortForwarder
(
controller
)
kubeConfigPath
:=
"/path"
...
...
@@ -90,7 +93,7 @@ func TestLiveConfig(t *testing.T) {
contextName
:=
"context-name"
restConfigOptions
:=
cluster
.
RESTConfigOptions
{}
config
:=
NewLiveConfig
(
clusterClient
,
crdWatcher
,
kubeConfigPath
,
logger
,
moduleManager
,
objectStore
,
pluginManager
,
portForwarder
,
contextName
,
restConfigOptions
)
config
:=
NewLiveConfig
(
clusterClient
,
crdWatcher
,
kubeConfigPath
,
logger
,
moduleManager
,
objectStore
,
errorStore
,
pluginManager
,
portForwarder
,
contextName
,
restConfigOptions
)
assert
.
NoError
(
t
,
config
.
Validate
())
assert
.
Equal
(
t
,
clusterClient
,
config
.
ClusterClient
())
...
...
This diff is collapsed.
Click to expand it.
internal/dash/dash.go
+
8
-
1
View file @
ccecf157
...
...
@@ -27,6 +27,7 @@ import (
"github.com/vmware/octant/internal/cluster"
"github.com/vmware/octant/internal/config"
"github.com/vmware/octant/internal/describer"
internalErr
"github.com/vmware/octant/internal/errors"
"github.com/vmware/octant/internal/log"
"github.com/vmware/octant/internal/module"
"github.com/vmware/octant/internal/modules/applications"
...
...
@@ -95,7 +96,12 @@ func Run(ctx context.Context, logger log.Logger, shutdownCh chan bool, options O
return
errors
.
Wrap
(
err
,
"initializing store"
)
}
crdWatcher
,
err
:=
describer
.
NewDefaultCRDWatcher
(
ctx
,
appObjectStore
)
errorStore
,
err
:=
internalErr
.
NewErrorStore
()
if
err
!=
nil
{
return
errors
.
Wrap
(
err
,
"initializing error store"
)
}
crdWatcher
,
err
:=
describer
.
NewDefaultCRDWatcher
(
ctx
,
appObjectStore
,
errorStore
)
if
err
!=
nil
{
return
errors
.
Wrap
(
err
,
"initializing CRD watcher"
)
}
...
...
@@ -138,6 +144,7 @@ func Run(ctx context.Context, logger log.Logger, shutdownCh chan bool, options O
logger
,
moduleManager
,
appObjectStore
,
errorStore
,
pluginManager
,
portForwarder
,
options
.
Context
,
...
...
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
Menu
Projects
Groups
Snippets
Help