Skip to content
This repository has been archived by the owner on Apr 25, 2023. It is now read-only.

Support jsonpath overrides #520

Closed
marun opened this issue Dec 17, 2018 · 3 comments
Closed

Support jsonpath overrides #520

marun opened this issue Dec 17, 2018 · 3 comments
Assignees
Labels
kind/feature Categorizes issue or PR as related to a new feature. priority/backlog Higher priority than priority/awaiting-more-evidence.

Comments

@marun
Copy link
Contributor

marun commented Dec 17, 2018

Overrides are easy to specify for simple paths (e.g. spec.replicas), but overriding paths with an indexed field (e.g. spec.template.spec.containers[0].image) requires using a separate configmap or secret resource to work around the lack of indexing support in the path-based mechanism. This suggests supporting json-patch directives:

apiVersion: generated.federation.k8s.io/v1alpha1
kind: FederatedDeployment
metadata:
  name: foo
  namespace: bar
spec:
  overrides:
  - clusterName: cluster1
     clusterOverrides:
     - path: spec.replicas
       value: 3
  - clusterName: cluster2
     # Support multiple directives and apply them in sequence
     jsonPatches:
     # Equivalent directive to the path-based override for cluster1
     - { "op": "replace", "path": "/spec/replicas", "value": 5 }
     # Indexed directive
     - { "op": "replace", "path": "/spec/template/spec/containers[0]/image", "value": "different-image" }  

It should be possible to supply both clusterOverrides and jsonPatches so long as the ordering of application is documented.

Previously: #400

cc: @danehans @mvazquezc

@senyan
Copy link

senyan commented Jan 16, 2019

support of jsonPatches would be a great step forward. In addition, I would feel if we could get more transformation logic would be even better while propagate to federated clusters. Please see here.

@marun marun self-assigned this Feb 11, 2019
@marun marun added kind/feature Categorizes issue or PR as related to a new feature. priority/backlog Higher priority than priority/awaiting-more-evidence. labels Apr 10, 2019
@font
Copy link
Contributor

font commented Jun 24, 2019

Fixed by #991.

@font font closed this as completed Jun 24, 2019
@senyan
Copy link

senyan commented Jun 25, 2019

Amazing.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/feature Categorizes issue or PR as related to a new feature. priority/backlog Higher priority than priority/awaiting-more-evidence.
Projects
None yet
Development

No branches or pull requests

3 participants