Skip to content

Commit a83330e

Browse files
authored
Remove function.Metadata and switch to fn.NewFunction (#123)
1 parent c80167f commit a83330e

3 files changed

Lines changed: 2 additions & 27 deletions

File tree

internal/controller/function_controller.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ import (
2525
"time"
2626

2727
"github.com/functions-dev/func-operator/internal/funccli"
28-
fn "github.com/functions-dev/func-operator/internal/function"
2928
"github.com/functions-dev/func-operator/internal/git"
3029
v1 "k8s.io/api/core/v1"
3130
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
@@ -200,7 +199,7 @@ func (r *FunctionReconciler) prepareSource(ctx context.Context, function *v1alph
200199
return nil, nil, fmt.Errorf("failed to setup git repository: %w", err)
201200
}
202201

203-
metadata, err := fn.Metadata(repo.Path())
202+
metadata, err := funcfn.NewFunction(repo.Path())
204203
if err != nil {
205204
function.MarkSourceNotReady("MetadataReadFailed", "Failed to read function metadata: %s", err.Error())
206205
return nil, nil, fmt.Errorf("failed to get function metadata: %w", err)

internal/function/metadata.go

Lines changed: 0 additions & 23 deletions
This file was deleted.

test/e2e/func_middleware_update_test.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ import (
2525
"time"
2626

2727
functionsdevv1alpha1 "github.com/functions-dev/func-operator/api/v1alpha1"
28-
"github.com/functions-dev/func-operator/internal/function"
2928
"github.com/functions-dev/func-operator/test/utils"
3029
. "github.com/onsi/ginkgo/v2"
3130
. "github.com/onsi/gomega"
@@ -101,7 +100,7 @@ var _ = Describe("Middleware Update", func() {
101100

102101
It("should update the middleware and mark the function as ready", func() {
103102
// Get function metadata to retrieve the deployed function name
104-
funcMetadata, err := function.Metadata(repoDir)
103+
funcMetadata, err := funcfn.NewFunction(repoDir)
105104
Expect(err).NotTo(HaveOccurred())
106105
deployedFunctionName := funcMetadata.Name
107106

0 commit comments

Comments
 (0)