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

Remove EnqueueRequestForAnnotation handler from SDK #3506

Conversation

varshaprasad96
Copy link
Member

@varshaprasad96 varshaprasad96 commented Jul 23, 2020

Description of the change:
This commit removes pkg/handler/enqueue_annotation.go from SDK,
and modifies helm/ansible to use EnqueueRequestForAnnotation handler
implemented in Operator-lib.

Motivation for the change:
Efforts to move towards SDK 1.0 involves moving SDK helper functions to operator-lib.

Checklist

If the pull request includes user-facing changes, extra documentation is required:

description: 'Kind is a string value representing the REST resource this
object represents. Servers may infer this from the endpoint the client
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
description: 'Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
Copy link
Member Author

@varshaprasad96 varshaprasad96 Jul 23, 2020

Choose a reason for hiding this comment

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

The newlines present in-between strings were not passing the tests. So removed them.

Copy link
Member

Choose a reason for hiding this comment

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

They pass in master.

Copy link
Contributor

@camilamacedo86 camilamacedo86 Jul 24, 2020

Choose a reason for hiding this comment

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

What was the error? Can you share?

Copy link
Member Author

@varshaprasad96 varshaprasad96 Jul 24, 2020

Choose a reason for hiding this comment

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

There were errors due to the presence of newline in the expected string output with backticks (back quotes). This was after bumping versions of some of the dependencies along with controller-runtime (though I didn't look into what was the exact one causing this). This does not happen in master. For ex in case of one of the test TestCRDGo:

Diff:
            	            	--- Expected
            	            	+++ Actual
            	            	@@ -19,10 +19,6 @@
            	            	         apiVersion:
            	            	-		  description: 'APIVersion defines the versioned schema of this representation
            	            	-		  of an object. Servers should convert recognized schemas to the latest 
            	            	-		  internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
            	            	+          description: 'APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
            	            	           type: string
            	            	         kind:
            	            	-		  description: 'Kind is a string value representing the REST resource this 
            	            	-		  object represents. Servers may infer this from the endpoint the client 
            	            	-		  submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
            	            	+          description: 'Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
            	            	           type: string

Copy link
Member

Choose a reason for hiding this comment

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

@varshaprasad96 I saw the same error in my new PR #3523. I think the new version of ginkgo or gomega caused it.

Copy link
Member Author

Choose a reason for hiding this comment

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

Oh..The failing tests here are written in the old golang testing framework though. Not sure which, but some other dependency maybe causing it.

@joelanford joelanford mentioned this pull request Jul 23, 2020
92 tasks
pkg/ansible/proxy/proxy.go Outdated Show resolved Hide resolved
@hasbro17
Copy link
Contributor

Add a CHANGELOG fragment for this?
Even if we're mostly using this internally, EnqueueRequestForAnnotation in pkg/handler is still a public API.

@varshaprasad96 varshaprasad96 force-pushed the update_handler/ansible branch 2 times, most recently from 5e39f27 to 726ec66 Compare July 24, 2020 00:42
Copy link
Member

@joelanford joelanford left a comment

Choose a reason for hiding this comment

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

Totally minor nit just to align with other variable names in the function.

/lgtm

pkg/ansible/proxy/proxy.go Outdated Show resolved Hide resolved
@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Jul 24, 2020
@varshaprasad96 varshaprasad96 force-pushed the update_handler/ansible branch from 726ec66 to 0f6d9f8 Compare July 24, 2020 05:51
@openshift-ci-robot openshift-ci-robot removed the lgtm Indicates that a PR is ready to be merged. label Jul 24, 2020
This commit removes pkg/handler/enqueue_annotation.go from SDK,
and modifies helm/ansible to use EnqueueRequestForAnnotation handler
implemented in Operator-lib.
@varshaprasad96 varshaprasad96 force-pushed the update_handler/ansible branch from 0f6d9f8 to 6e10a23 Compare July 24, 2020 06:00
Copy link
Member

@jmrodri jmrodri left a comment

Choose a reason for hiding this comment

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

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Jul 24, 2020
@varshaprasad96 varshaprasad96 merged commit a8946fb into operator-framework:master Jul 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants