Skip to content

Conversation

pantierra
Copy link
Contributor

No description provided.

Copy link

@mneagul mneagul left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The current implementation complicates the whole interaction with KNative.

What is important: K_NATIVE is an URL which can receive a POST event of a CloudEvent.

The K_CE_OVERRIDES specified an JSON encoded environment variables representing key/values that should be overwritten by the code. The Python code should ignore this as much as possible and apply it before triggering the POST corresponding to the generated event.

from ..core.plugin import BaseOutput, BasePluginConfig, PluginMetadata


class RefConfig(BaseModel):
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What I'm expecting:

  • The code in eoAPI only expects to have K_SINK defined in an environment variable
  • The ref vs url logic should be outside the code, and should only reside in the helm chart
  • The Helm chart, based on the configuration, should set K_SINK only is url is set, otherwise it should create a SinkBinding which should match the deployment/stefullset and inject the environment variable. This last part is the responsibility of KNative and no logic, besides the expectation on the presence ok K_SINK, should reside in the application code.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Python side of code should only care of K_SINK. If it's set then it has to POST to that endpoint.
A special attention should be given to the env K_CE_OVERRIDES. This is a JSON object that specifies overrides to the outbound event.

See this:

@pantierra
Copy link
Contributor Author

Thanks for your reviews and support @mneagul!

Closing this PR here in favour of these follow-ups:

@pantierra pantierra closed this Sep 16, 2025
@pantierra pantierra deleted the feature/more-native-ksink branch September 18, 2025 12:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants