Unverified Commit 9bb49e69 authored by Jonathan S. Katz's avatar Jonathan S. Katz
Browse files

Update JSON 6902 patch for compatibility with older kubectl

The inline patch technique only works on kubectl v1.21.0 and
later. While it is certainly much more convenient to write it
out in that manner, this uses the previously available technique
of referencing the location of a patch file to apply a patch,
thus ensuring greater compatibility.
parent 099bc0c4
Loading
Loading
Loading
Loading
+9 −5
Original line number Diff line number Diff line
@@ -21,8 +21,12 @@ patchesJson6902:
      version: v1
      kind: Deployment
      name: pgo
    patch: |-
      - op: remove
        path: /spec/selector/matchLabels/app.kubernetes.io~1name
      - op: remove
        path: /spec/selector/matchLabels/app.kubernetes.io~1version
    path: ./patches/selectors.yaml
    # path is used for compatibility with version of kubectl prior to v1.21.0.
    # newer version of kubectl can use the inline patch below, which is the
    # preferred method going forward.
    # patch: |-
    #   - op: remove
    #     path: /spec/selector/matchLabels/app.kubernetes.io~1name
    #   - op: remove
    #     path: /spec/selector/matchLabels/app.kubernetes.io~1version
+4 −0
Original line number Diff line number Diff line
- op: remove
  path: /spec/selector/matchLabels/app.kubernetes.io~1name
- op: remove
  path: /spec/selector/matchLabels/app.kubernetes.io~1version