Coder Social home page Coder Social logo

Comments (14)

arugal avatar arugal commented on May 31, 2024 3

Hi @tpiperatgod @benjaminhuo I'd like to try :)

from openfunction.

benjaminhuo avatar benjaminhuo commented on May 31, 2024

What does sink.ref looks like now?

from openfunction.

tpiperatgod avatar tpiperatgod commented on May 31, 2024

like this:

      apiVersion: serving.knative.dev/v1
      kind: Service
      name: serving-d2blp-ksvc-2hbp6
      namespace: default

from openfunction.

benjaminhuo avatar benjaminhuo commented on May 31, 2024

like this:

      apiVersion: serving.knative.dev/v1
      kind: Service
      name: serving-d2blp-ksvc-2hbp6
      namespace: default

The sink could be function, not knative service
It's more user friendly to user maybe

from openfunction.

tpiperatgod avatar tpiperatgod commented on May 31, 2024

The solutions are as follows:

type SinkSpec struct {
	Ref *Reference `json:"ref,omitempty"`
	Uri *string    `json:"uri,omitempty"`
}

type Reference struct {
	Kind       string `json:"kind"`
	Namespace  string `json:"namespace,omitempty"`
	Name       string `json:"name"`
	APIVersion string `json:"apiVersion"`
}

Reference provides references to Knative Service and Function resources from which to retrieve function URLs
Uri is used to pass the URL directly

When using the Sink, you must use one of these attributes, and in priority Uri > Reference

Another approach is to deprecate the reference to the Knative Service and use only the Function:

type SinkSpec struct {
	// Namespace of the Function
	Namespace string `json:"namespace,omitempty"`
	// Name of the Function
	Name string `json:"name"`
}

from openfunction.

benjaminhuo avatar benjaminhuo commented on May 31, 2024

@arugal That's great!

from openfunction.

benjaminhuo avatar benjaminhuo commented on May 31, 2024

The solutions are as follows:

type SinkSpec struct {
	Ref *Reference `json:"ref,omitempty"`
	Uri *string    `json:"uri,omitempty"`
}

type Reference struct {
	Kind       string `json:"kind"`
	Namespace  string `json:"namespace,omitempty"`
	Name       string `json:"name"`
	APIVersion string `json:"apiVersion"`
}

Reference provides references to Knative Service and Function resources from which to retrieve function URLs Uri is used to pass the URL directly

When using the Sink, you must use one of these attributes, and in priority Uri > Reference

Another approach is to deprecate the reference to the Knative Service and use only the Function:

type SinkSpec struct {
	// Namespace of the Function
	Namespace string `json:"namespace,omitempty"`
	// Name of the Function
	Name string `json:"name"`
}

Sounds good!

from openfunction.

tpiperatgod avatar tpiperatgod commented on May 31, 2024

I prefer the first solution because it might be a bit more generic 🤔 what do you think?

from openfunction.

arugal avatar arugal commented on May 31, 2024

The solutions are as follows:

type SinkSpec struct {
	Ref *Reference `json:"ref,omitempty"`
	Uri *string    `json:"uri,omitempty"`
}

type Reference struct {
	Kind       string `json:"kind"`
	Namespace  string `json:"namespace,omitempty"`
	Name       string `json:"name"`
	APIVersion string `json:"apiVersion"`
}

Reference provides references to Knative Service and Function resources from which to retrieve function URLs Uri is used to pass the URL directly

When using the Sink, you must use one of these attributes, and in priority Uri > Reference

@tpiperatgod Is this?

from openfunction.

tpiperatgod avatar tpiperatgod commented on May 31, 2024

The solutions are as follows:

type SinkSpec struct {
	Ref *Reference `json:"ref,omitempty"`
	Uri *string    `json:"uri,omitempty"`
}

type Reference struct {
	Kind       string `json:"kind"`
	Namespace  string `json:"namespace,omitempty"`
	Name       string `json:"name"`
	APIVersion string `json:"apiVersion"`
}

Reference provides references to Knative Service and Function resources from which to retrieve function URLs Uri is used to pass the URL directly
When using the Sink, you must use one of these attributes, and in priority Uri > Reference

@tpiperatgod Is this?

yes

from openfunction.

benjaminhuo avatar benjaminhuo commented on May 31, 2024

The first one looks ok

from openfunction.

arugal avatar arugal commented on May 31, 2024

https://github.com/OpenFunction/OpenFunction/blob/main/controllers/events/event.go#L177

When the URI is set, use ts-%s ts-{resourceName} as the component name template, what do you think? @tpiperatgod @benjaminhuo

from openfunction.

tpiperatgod avatar tpiperatgod commented on May 31, 2024

https://github.com/OpenFunction/OpenFunction/blob/main/controllers/events/event.go#L177

When the URI is set, use ts-%s ts-{resourceName} as the component name template, what do you think? @tpiperatgod @benjaminhuo

I think it's ok.

from openfunction.

benjaminhuo avatar benjaminhuo commented on May 31, 2024

https://github.com/OpenFunction/OpenFunction/blob/main/controllers/events/event.go#L177

The component's namespace could also be the same as the EventSource(resource)

from openfunction.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.