Skip to content

Feature: Support partial sync in ADC to avoid deleting unrelated services #308

@azabrha

Description

@azabrha

Description

Title: Support partial sync in ADC to avoid deleting unrelated services

Body:

Hi,

I'm using ADC to add and edit my services in APISIX.
When I run:

adc sync

It replaces all services with only the ones defined in the current YAML file.
Is there a way to make adc sync only add, update, or delete the services explicitly listed in the file, and leave the rest untouched?

Let me give you an example.

Assume my current state is something like this:

services:
  - name: farid pet store
    description: service for farid pet store
    routes:
      - name: farid pet store/pet_PUT
        description: Update an existing pet.
        methods: [PUT]
        uris: [/pet]

      - name: farid pet store/pet/{petId}_DELETE
        description: Deletes a pet.
        methods: [DELETE]
        uris: [/pet/*]

Now I want to add a new service and run adc sync with this file:

services:
  - name: test
    description: test service
    routes:
      - name: test put
        description: Update an existing pet.
        methods: [PUT]
        uris: [/pet]

This causes the previous farid pet store service to be completely deleted, since it's not present in the new file.

Is there any way to avoid this? Maybe something like a partial sync mode?

Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions