Skip to content

Commit 5cb4ade

Browse files
authored
Remove function.Metadata and switch to fn.NewFunction (#123)
1 parent 460ac39 commit 5cb4ade

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"
@@ -108,7 +107,7 @@ var _ = Describe("Middleware Update", func() {
108107

109108
It("should update the middleware and mark the function as ready", func() {
110109
// Get function metadata to retrieve the deployed function name
111-
funcMetadata, err := function.Metadata(repoDir)
110+
funcMetadata, err := funcfn.NewFunction(repoDir)
112111
Expect(err).NotTo(HaveOccurred())
113112
deployedFunctionName := funcMetadata.Name
114113

0 commit comments

Comments
 (0)