Skip to content

patch.Helper doesn't work with secrets and configmaps #588

Description

@errordeveloper

I was using patcher in a project and discovered the hard way that it doesn't actually patch secrets.

The reason behind that is to do with this logic:

pkg/runtime/patch/patch.go

Lines 239 to 242 in a04ccbf

func (h *Helper) patch(ctx context.Context, obj client.Object, opts ...client.PatchOption) error {
if !h.shouldPatch("metadata") && !h.shouldPatch("spec") {
return nil
}

So it very deliberately checks spec field, which is something secrets and configmaps don't have.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions