Skip to content
This repository has been archived by the owner on Jun 8, 2022. It is now read-only.

[Feature] Add conflictsWith to TraitDefitnition #141

Open
resouer opened this issue Jul 26, 2020 · 4 comments
Open

[Feature] Add conflictsWith to TraitDefitnition #141

resouer opened this issue Jul 26, 2020 · 4 comments

Comments

@resouer
Copy link
Contributor

resouer commented Jul 26, 2020

Is your feature request related to a problem? Please describe.

For registering a given capability, we should support a field named conflictsWith

Describe the solution you'd like

$ kubectl get traits
NAME          DEFINITION                                 APPLIES TO      CONFLICTS WITH
traffic       virtualservices.networking.istio.io        apps.k8s.io     services.k8s.io
cronscaler    cronscaler.core.oam.dev                    apps.k8s.io     hpa.k8s.io
tls           tls.core.oam.dev                           apps.k8s.io

So in case when operator apply cronscaler and hpa trait to the same component, oam runtime will report error.

Describe alternatives you've considered

Additional context

@hongchaodeng
Copy link
Member

ref: oam-dev/spec#352

@wonderflow
Copy link
Member

ConflictWith could be presentation layer, and conflict labe in oam-dev/spec#352 could be real implementation.

@resouer
Copy link
Contributor Author

resouer commented Jul 29, 2020

@wonderflow appliesTo and conflictsWith should follow the same pattern, one example is:

apiVersion: core.oam.dev/v1alpha2
kind: TraitDefinition
metadata:
  name: virtualservices.networking.istio.io
  annotations:
    alias: traffic
spec:
  appliesTo:
    - apps.k8s.io
  conflictsWith:
    - services.k8s.io # API resource/crd name
    - *.networking.k8s.io # API group
    - labelSelector:foo=bar
  definition: virtualservices.networking.istio.io

@wonderflow
Copy link
Member

@zzxwill is working on it

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants