Skip to content

Commit

Permalink
Update config inject to use api reader
Browse files Browse the repository at this point in the history
  • Loading branch information
efiacor committed Sep 10, 2024
1 parent a98a93e commit e572dba
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ func (r *reconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Resu
vlankrmfn := fn.ResourceListProcessorFunc(vlanf.Run)
vlanFor := vlanf.GetConfig().For

configInjectf := configinjectfn.New(r.porchClient)
configInjectf := configinjectfn.New(r.apiReader)
configInjectkrmfn := fn.ResourceListProcessorFunc(configInjectf.Run)
configInjectFor := configInjectf.GetConfig().For

Expand Down
6 changes: 3 additions & 3 deletions krm-functions/configinject-fn/fn/function.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,14 @@ import (
const revisionPrefix = "v"

type FnR struct {
client.Client
client.Reader
workloadCluster *infrav1alpha1.WorkloadCluster
sdkConfig *condkptsdk.Config
}

func New(c client.Client) *FnR {
func New(c client.Reader) *FnR {
f := &FnR{
Client: c,
Reader: c,
}
f.sdkConfig = &condkptsdk.Config{
For: corev1.ObjectReference{
Expand Down
2 changes: 1 addition & 1 deletion krm-functions/configinject-fn/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import (

func main() {
r := &fnr.FnR{
Client: nil,
Reader: nil,
}

if err := fn.AsMain(fn.ResourceListProcessorFunc(r.Run)); err != nil {
Expand Down

0 comments on commit e572dba

Please sign in to comment.