mirror of
https://github.com/helmfile/helmfile.git
synced 2026-10-21 12:50:02 +02:00
feat(template): added secret template function (#1221)
* feat(tmpl): added fetchSecretValue template function
This adds a tmpl `fetchSecretValue` and `expandSecretRefs` function by:
- Adding:
- `expandSecretRefs` function in tmpl package that uses vals
package to fetch secrets
- `fetchSecretValue` function in tmpl package like below but for
single string value
- gomock for tests purpose
- Changing:
- move init of vals package to function (so the same instance can be used for template values and rendering the whole template)
* doc(secret): added doc how to use new tmpl methods
Added example usage of `fetchSecretValue` and `expandSecretRefs`
This commit is contained in:
@@ -0,0 +1,45 @@
|
||||
// Code generated by MockGen. DO NOT EDIT.
|
||||
// Source: expand_secret_ref.go
|
||||
|
||||
package tmpl
|
||||
|
||||
import (
|
||||
gomock "github.com/golang/mock/gomock"
|
||||
reflect "reflect"
|
||||
)
|
||||
|
||||
// MockvalClient is a mock of valClient interface
|
||||
type MockvalClient struct {
|
||||
ctrl *gomock.Controller
|
||||
recorder *MockvalClientMockRecorder
|
||||
}
|
||||
|
||||
// MockvalClientMockRecorder is the mock recorder for MockvalClient
|
||||
type MockvalClientMockRecorder struct {
|
||||
mock *MockvalClient
|
||||
}
|
||||
|
||||
// NewMockvalClient creates a new mock instance
|
||||
func NewMockvalClient(ctrl *gomock.Controller) *MockvalClient {
|
||||
mock := &MockvalClient{ctrl: ctrl}
|
||||
mock.recorder = &MockvalClientMockRecorder{mock}
|
||||
return mock
|
||||
}
|
||||
|
||||
// EXPECT returns an object that allows the caller to indicate expected use
|
||||
func (_m *MockvalClient) EXPECT() *MockvalClientMockRecorder {
|
||||
return _m.recorder
|
||||
}
|
||||
|
||||
// Eval mocks base method
|
||||
func (_m *MockvalClient) Eval(template map[string]interface{}) (map[string]interface{}, error) {
|
||||
ret := _m.ctrl.Call(_m, "Eval", template)
|
||||
ret0, _ := ret[0].(map[string]interface{})
|
||||
ret1, _ := ret[1].(error)
|
||||
return ret0, ret1
|
||||
}
|
||||
|
||||
// Eval indicates an expected call of Eval
|
||||
func (_mr *MockvalClientMockRecorder) Eval(arg0 interface{}) *gomock.Call {
|
||||
return _mr.mock.ctrl.RecordCallWithMethodType(_mr.mock, "Eval", reflect.TypeOf((*MockvalClient)(nil).Eval), arg0)
|
||||
}
|
||||
Reference in New Issue
Block a user