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

Patching objects that do not support watch #36

Open
X-dark opened this issue Jul 27, 2022 · 3 comments
Open

Patching objects that do not support watch #36

X-dark opened this issue Jul 27, 2022 · 3 comments

Comments

@X-dark
Copy link

X-dark commented Jul 27, 2022

Hi,

I have a patch that seems to be working but on an object that do not support the watch method (ImageStreamTags). As a consequence, I am seeing a lot of error messages like:

E0727 12:34:19.465865       1 reflector.go:138] pkg/mod/k8s.io/[email protected]/tools/cache/reflector.go:167: Failed to watch image.openshift.io/v1, Kind=ImageStreamTag: the server does not allow this method on the requested resource

What is the impact of this, feature and performance wise?

If needed my patch:

apiVersion: redhatcop.redhat.io/v1alpha1
kind: Patch
metadata:
  name: image-sample-scheduled-patch
  namespace: openshift
spec:
  serviceAccountRef:
    name: patchoperator-imagetag
  patches:
    image-sample-scheduled-patch:
      targetObjectRef:
        apiVersion: image.openshift.io/v1
        kind: ImageStreamTag
        namespace: openshift
      patchTemplate: |
        {{- if eq (index . 0).tag.from.kind "DockerImage" }}
        tag:
          importPolicy:
            scheduled: true
        {{- end }}
      patchType: application/strategic-merge-patch+json
@raffaelespazzoli
Copy link
Collaborator

to be honest I have no idea. And it shouldn't work in my opinion, so I'm not sure what is going on. Possible the client go library is able to degrade a watch to a polling when watch is not supported.

@X-dark
Copy link
Author

X-dark commented Jul 27, 2022

At least I can confirm it works beyond initial apply of the patch. If I manually revert the patch on one of the objects, it get applied again within the minute.

@leotomas837
Copy link

leotomas837 commented Dec 6, 2022

@raffaelespazzoli any news about this ? It basically highlights that the patch-operator service account (controller-manager) does not have the permissions.
And indeed, the serviceAccountRef does not reference the patch-operator service account, but another one created specifically for the patch. This is how it is supposed to work as wrote in the README. And it is working fine. The question is why is this error message showing up ? Does it try to check something with the patch-operator service account ?

It can be a bit annoying trying to debug with all these extra logs.

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

No branches or pull requests

3 participants