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

Update examples for Tanzu Sources for Knative #1080

Merged
merged 1 commit into from
Aug 4, 2023

Conversation

lamw
Copy link
Contributor

@lamw lamw commented Jul 18, 2023

Summary

This change updates all examples (include applicable) source to support Tanzu Sources for Knative which uses slightly different event schema format.

Pull Request Checklist

🚨 Please review the guidelines for contributing to this repository.

  • Please ensure that you are making a pull request against the Development branch
  • Please use the WIP keyword in the title of your PR if you are not ready for review
  • Please ensure that you have opened a Github Issue if you are resolving/fixing a problem
  • Please ensure that you have signed all commits and that you have squashed all relevant commits related to your change
  • Please make sure that you have tested your change locally by successfully building and deploying the VMware Event Broker Appliance and/or building and deploying VMware Event Router
  • Please include any relevant screenshots and/or output as part of your testing
  • Please include any documentation updates that is applicable for your changes

Change Type

What types of changes does your code introduce to the VMware Event Broker Appliance?

Put an x in all boxes that apply

Please check the type of change your PR introduces:

  • Bugfix (non-breaking change which fixes an issue)
  • Feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • Documentation changes
  • Other (please describe):

Resolved Issues

List of Issues closed or resolved by this PR. Add multiple Closes keyword followed by the issue number (e.g. Closes #ISSUE-NUMBER)

Closes: #1073

Testing Verification

  • Short summary of testing (e.g. successfully built and deployed VMware Event Broker Appliance)
  • Please include any relevant screenshots and/or output as part of the testing

Additional Information

  • Any other details you wish to include or mention

If you have any questions/comments, feel free to reach out to team on Slack #vcenter-event-broker-appliance

Thank you from the VEBA Team! 🥳

@lamw lamw added the enhancement New feature or request label Jul 18, 2023
@lamw lamw added this to the v0.8.0 milestone Jul 18, 2023
@lamw lamw requested a review from embano1 July 18, 2023 00:04
Copy link
Collaborator

@embano1 embano1 left a comment

Choose a reason for hiding this comment

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

@@ -60,7 +60,7 @@ spec:
broker: default
filter:
attributes:
subject: com.vmware.cis.tagging.attach
subject: com.vmware.vsphere.com.vmware.cis.tagging.attach.v0
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
subject: com.vmware.vsphere.com.vmware.cis.tagging.attach.v0
type: com.vmware.vsphere.com.vmware.cis.tagging.attach.v0

same below

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated

Copy link
Collaborator

Choose a reason for hiding this comment

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

You need to change subject to type ;)

@@ -47,15 +47,15 @@ def handler():
resp.status_code = sc
return resp

if subject in ["DrsVmPoweredOnEvent", "VmPoweredOnEvent"]:
if type in ["DrsVmPoweredOnEvent", "VmPoweredOnEvent"]:
Copy link
Collaborator

Choose a reason for hiding this comment

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

types are now com.vmware.vsphere.DrsVmPoweredOnEvent.v0 etc.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updatd

app.logger.info(f"Apply attribute > {attr_last_poweredon.name}")
vc_s.set_custom_attr(
entity=vm_obj,
key=attr_last_poweredon.key,
value=date.today().strftime("%d/%m/%Y")
)

if subject in ["VmCreatedEvent", "VmClonedEvent", "VmRegisteredEvent"]:
if type in ["VmCreatedEvent", "VmClonedEvent", "VmRegisteredEvent"]:
Copy link
Collaborator

Choose a reason for hiding this comment

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

see above

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated

@@ -0,0 +1,10 @@
apiVersion: projectcontour.io/v1alpha1
Copy link
Collaborator

Choose a reason for hiding this comment

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

are those files supposed to be in here? looks like you based this PR off on the other PR instead of development

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yea, I figured since this has to go in, that I'd simply base it off of prior PR. I guess best to do it from Development in future and just rebase ... Noted

@@ -60,7 +60,7 @@ spec:
broker: default
filter:
attributes:
subject: com.vmware.cis.tagging.attach
subject: com.vmware.vsphere.com.vmware.cis.tagging.attach.v0
Copy link
Collaborator

Choose a reason for hiding this comment

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

You need to change subject to type ;)

@@ -44,8 +44,7 @@ spec:
broker: default
filter:
attributes:
subject: VmPoweredOffEvent
type: com.vmware.event.router/event
type: com.vmware.vsphere.com.vmware.cis.tagging.attach.v0
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should be VmPoweredOffEvent event

Copy link
Contributor Author

Choose a reason for hiding this comment

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

whoops! Fixed :D

@lamw lamw requested a review from embano1 August 4, 2023 12:03
Copy link
Collaborator

@embano1 embano1 left a comment

Choose a reason for hiding this comment

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

LGTM

@lamw lamw merged commit fe086ce into vmware-samples:development Aug 4, 2023
1 check passed
@lamw lamw deleted the issue-1073 branch August 4, 2023 12:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Update Examples for Tanzu Sources for Knative
2 participants