Files
fission-src/pkg/controller/client/v1/fake/fake_function.go
T
Ta-Ching ChenandGitHub 7b87d7c52c Add fake client for local command operation (#1515)
This PR adds a fake controller client for local CLI operations like 
offline spec generation or for unit test purposes. The fake client 
now only implements the "Version()" function and more functions 
will be implemented once we figure out how to achieve the goals 
mentioned above.
2020-01-28 17:38:43 +08:00

57 lines
1.4 KiB
Go

/*
Copyright 2016 The Fission Authors.
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 fake
import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
fv1 "github.com/fission/fission/pkg/apis/core/v1"
v1 "github.com/fission/fission/pkg/controller/client/v1"
)
type (
FakeFunction struct{}
)
func newFunctionClient(c *v1.V1) v1.FunctionInterface {
return &FakeFunction{}
}
func (c *FakeFunction) Create(f *fv1.Function) (*metav1.ObjectMeta, error) {
return nil, nil
}
func (c *FakeFunction) Get(m *metav1.ObjectMeta) (*fv1.Function, error) {
return nil, nil
}
func (c *FakeFunction) GetRawDeployment(m *metav1.ObjectMeta) ([]byte, error) {
return nil, nil
}
func (c *FakeFunction) Update(f *fv1.Function) (*metav1.ObjectMeta, error) {
return nil, nil
}
func (c *FakeFunction) Delete(m *metav1.ObjectMeta) error {
return nil
}
func (c *FakeFunction) List(functionNamespace string) ([]fv1.Function, error) {
return nil, nil
}