mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-14 13:45:06 +00:00
cloudprovider/mesos: fix panics when the Mesos master cannot be reached
This commit is contained in:
@@ -91,13 +91,19 @@ func (c *stateCache) cachedState(ctx context.Context) (*mesosState, error) {
|
|||||||
// clusterName returns the cached Mesos cluster name.
|
// clusterName returns the cached Mesos cluster name.
|
||||||
func (c *stateCache) clusterName(ctx context.Context) (string, error) {
|
func (c *stateCache) clusterName(ctx context.Context) (string, error) {
|
||||||
cached, err := c.cachedState(ctx)
|
cached, err := c.cachedState(ctx)
|
||||||
return cached.clusterName, err
|
if err != nil {
|
||||||
|
return "", err
|
||||||
|
}
|
||||||
|
return cached.clusterName, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// nodes returns the cached list of slave nodes.
|
// nodes returns the cached list of slave nodes.
|
||||||
func (c *stateCache) nodes(ctx context.Context) (map[string]*slaveNode, error) {
|
func (c *stateCache) nodes(ctx context.Context) (map[string]*slaveNode, error) {
|
||||||
cached, err := c.cachedState(ctx)
|
cached, err := c.cachedState(ctx)
|
||||||
return cached.nodes, err
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return cached.nodes, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func newMesosClient(
|
func newMesosClient(
|
||||||
|
Reference in New Issue
Block a user