components-contrib icon indicating copy to clipboard operation
components-contrib copied to clipboard

Proposal: CRDs add a field to constrain micrologic behavior and improve experience.

Open 1046102779 opened this issue 2 years ago • 3 comments

apiVersion: dapr.io/v1alpha1
kind: Component
metadata:
  name: messagebus
spec:
  type: pubsub.pulsar
  version: v1
  validatation: 
  - name: delieverAfter
    value: denied # MicroLogic server can't carry delieverAfter field.
  - name: initialOffset
    value: required # MicroLogic server must carry initialOffset field.
  - name: backOffDuration
    value: optional 
  - name: a, b, c, d
   value: optional
  - name: e, f, g
    value: required
  metadata:
  - name: brokers
    value: localhost:19092,localhost:29092,localhost:39092
  - name: delieverAfter
    value:  2min # Init setting.
    ...
if err = config.Client().PublishEvent(ctx, name, topic, data, &runtime.PublishEventRequest{
  Metadata: map[string]string{
     "deliverAt": deliverAt.Format(time.RFC3339), 
  },
}); err !=nil{
   return err //  it must be executed and return err.
}

In the financial sector, we do not want a MicroLogic server to carry a field value such as delieverAt, and the risk is very high. We want to be able to control it in the CRDs. We will write delieverAfter = 2min to a CRDs file. And it will be stored to metadata in Init phase.

In the CRDs issued by the control panel, we now encounter a business scenario. We hope that this CRDs can have a new field, the type is kv, the key represents the field name, and the value represents the attribute of the field; for example: Optional, Required, Denied Three properties:

  • For Optional, weak verification, indicating that the field name is carried into the metadata by micrologic in an optional way;
  • For Required, strong verification, indicating that the field name is carried into metdata by micrologic in the required way. If the user does not pass in this field, the dapr runtime will return an error;
  • For Denied, strong verification, indicating that the field name is microloigc and cannot write this field into the metadata. If the user passes in this field, the dapr runtime will return an error;

1046102779 avatar Aug 18 '22 12:08 1046102779

/cc @berndverst @ItalyPaleAle @daixiang0 .

1046102779 avatar Aug 18 '22 13:08 1046102779

Can we move this to the dapr/dapr repo? If it's a CRD change, should be discussed by the STC there first. CC: @yaron2

ItalyPaleAle avatar Aug 18 '22 19:08 ItalyPaleAle

This issue has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed in the next 7 days unless it is tagged (pinned, good first issue, help wanted or triaged/resolved) or other activity occurs. Thank you for your contributions.

dapr-bot avatar Sep 17 '22 19:09 dapr-bot

This issue has been automatically closed because it has not had activity in the last 37 days. If this issue is still valid, please ping a maintainer and ask them to label it as pinned, good first issue, help wanted or triaged/resolved. Thank you for your contributions.

dapr-bot avatar Sep 24 '22 19:09 dapr-bot