Add pod exec backup hooks

Signed-off-by: Andy Goldstein <andy.goldstein@gmail.com>
This commit is contained in:
Andy Goldstein
2017-10-20 10:20:59 -04:00
parent efcb32059a
commit 901f8e1302
32 changed files with 4006 additions and 1425 deletions
+2 -7
View File
@@ -34,13 +34,8 @@ type FakeDynamicFactory struct {
var _ client.DynamicFactory = &FakeDynamicFactory{}
func (df *FakeDynamicFactory) ClientForGroupVersionResource(gvr schema.GroupVersionResource, resource metav1.APIResource, namespace string) (client.Dynamic, error) {
args := df.Called(gvr, resource, namespace)
return args.Get(0).(client.Dynamic), args.Error(1)
}
func (df *FakeDynamicFactory) ClientForGroupVersionKind(gvk schema.GroupVersionKind, resource metav1.APIResource, namespace string) (client.Dynamic, error) {
args := df.Called(gvk, resource, namespace)
func (df *FakeDynamicFactory) ClientForGroupVersionResource(gv schema.GroupVersion, resource metav1.APIResource, namespace string) (client.Dynamic, error) {
args := df.Called(gv, resource, namespace)
return args.Get(0).(client.Dynamic), args.Error(1)
}
+3 -4
View File
@@ -17,8 +17,7 @@ limitations under the License.
package test
import (
"errors"
"github.com/pkg/errors"
"k8s.io/apimachinery/pkg/api/meta"
"k8s.io/apimachinery/pkg/runtime/schema"
)
@@ -38,12 +37,12 @@ func (m *FakeMapper) ResourceFor(input schema.GroupVersionResource) (schema.Grou
}, nil
}
if m.Resources == nil {
return schema.GroupVersionResource{}, errors.New("invalid resource")
return schema.GroupVersionResource{}, errors.Errorf("invalid resource %q", input.String())
}
if gr, found := m.Resources[input]; found {
return gr, nil
}
return schema.GroupVersionResource{}, errors.New("invalid resource")
return schema.GroupVersionResource{}, errors.Errorf("invalid resource %q", input.String())
}
+29
View File
@@ -0,0 +1,29 @@
/*
Copyright 2017 the Heptio Ark contributors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package test
import (
"io/ioutil"
"github.com/sirupsen/logrus"
)
func NewLogger() *logrus.Entry {
logger := logrus.New()
logger.Out = ioutil.Discard
return logrus.NewEntry(logger)
}