Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

passing entire s3 notification payload as event data #78

Merged
merged 2 commits into from
Aug 1, 2018

Conversation

magaldima
Copy link
Contributor

No description provided.

@@ -31,7 +32,7 @@ import (
)

func (c *SensorController) watchControllerConfigMap(ctx context.Context) (cache.Controller, error) {
c.log.Info("watching sensor controller config map updates")
log.Info("watching sensor controller config map updates")
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you rebase off of master again; now that the logging changes have been merged?

@magaldima
Copy link
Contributor Author

fixed the conflicts

@magaldima magaldima force-pushed the make-s3-notifications-the-event-data branch from a29644e to 118eec5 Compare July 31, 2018 21:08
@magaldima
Copy link
Contributor Author

@shrinandj can you re-approve this?

@@ -466,7 +466,7 @@ type ArtifactLocation struct {

// S3Artifact contains information about an artifact in S3
type S3Artifact struct {
S3Bucket `json:",inline" protobuf:"bytes,4,opt,name=s3Bucket"`
S3Bucket `json:",inline"`
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't understand protobufs yet... Why is this change needed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I noticed this when I ran make codegen.. seems to be related to hack/generate-proto.sh where it overrides the types.go file's protobuf annotations. I'm definitely not a protobuf expert, but I deduced a pattern when defining the API:

When you have an inline field, you don't have a protobuf annotation for it. For example:

// Sensor is the definition of a sensor resource
// +genclient
// +genclient:noStatus
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
type Sensor struct {
	v1.TypeMeta   `json:",inline"`
	v1.ObjectMeta `json:"metadata" protobuf:"bytes,1,opt,name=metadata"`
	Spec          SensorSpec   `json:"spec" protobuf:"bytes,2,opt,name=spec"`
	Status        SensorStatus `json:"status" protobuf:"bytes,3,opt,name=status"`
}

However, when I defined an inlined type and then ran make codegen it added a protobuf annotation where I originally didn't have one:

// ArtifactSignal describes an external object dependency
type ArtifactSignal struct {
	ArtifactLocation `json:",inline" protobuf:"bytes,2,opt,name=artifactLocation"`

	// Target is the stream to listen for artifact notifications
	Target Stream `json:"target" protobuf:"bytes,1,opt,name=target"`
}

Either way, this doesn't cause issues when sending signals and events via the Listen() gRPC so it's not a concern right now. However, we can raise an issue to look into this as it relates to the github.com/gogo/protobuf/protoc-gen-gofast or k8s.io/code-generator/cmd/go-to-protobuf tools.

Copy link
Contributor

@shrinandj shrinandj left a comment

Choose a reason for hiding this comment

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

Looks good (modulo one question).

@magaldima magaldima merged commit ab9b1b6 into master Aug 1, 2018
@magaldima magaldima deleted the make-s3-notifications-the-event-data branch August 3, 2018 15:45
juliev0 pushed a commit to juliev0/argo-events that referenced this pull request Mar 29, 2022
* adding s3 with param example

* fixing tests and adding logging to s3 signal
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.

None yet

3 participants