alibaba / alibaba/virtual-environment

在services中修改annotations:kt-virtual-environment/rule: 后不会更新vs,需要重新删除svc重新创建。

Open
#38 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
222
Forks
40
PR merge metrics
No merged PRs in 30d

Description

在services中修改annotations:kt-virtual-environment/rule: 后不会更新vs,需要重新删除svc重新创建。

测试过修改svc中Prefix字段或allowOrigin字段

```
kt-virtual-environment/rule: '{"Match":[{"Uri":{"Prefix":"/"}}],"corsPolicy":{"allowOrigin":["*"],"allowCredentials":true,"allowHeaders":["app-key","xxx"],"allowMethods":["GET","POST","PUT","DELETE","PATCH","OPTIONS"]}}'
```

之后 virtual-env-operator 多出如下日志

```
[Info] 2022-02-18 11:04:27 Adding Service gateway
[Info] 2022-02-18 11:04:27 Trigger reconcile VirtualEnvironment
[Info] 2022-02-18 11:04:32 Send reconcile signal
[Info] 2022-02-18 11:04:32 Receive reconcile request with name: virtualenv
[Info] 2022-02-18 11:04:32 Unmarshal route rule successful
```

但vs中配置并未更新

删除svc重建后vs更新,virtual-env-operator 日志如下

```
[Info] 2022-02-18 11:09:09 Removing Service gateway
[Info] 2022-02-18 11:09:09 VirtualService deleted gateway
[Info] 2022-02-18 11:09:09 Push reconcile request to trigger virtualenv
[Info] 2022-02-18 11:09:09 Trigger reconcile VirtualEnvironment
[Info] 2022-02-18 11:09:09 DestinationRule deleted gateway
[Info] 2022-02-18 11:09:09 Push reconcile request to trigger virtualenv
[Info] 2022-02-18 11:09:12 Adding Service gateway
[Info] 2022-02-18 11:09:19 Send reconcile signal
[Info] 2022-02-18 11:09:19 Receive reconcile request with name: virtualenv
[Info] 2022-02-18 11:09:19 Unmarshal route rule successful
[Info] 2022-02-18 11:09:19 Push reconcile request to trigger virtualenv
[Info] 2022-02-18 11:09:19 VirtualService gateway created
[Info] 2022-02-18 11:09:19 Push reconcile request to trigger virtualenv
[Info] 2022-02-18 11:09:19 DestinationRule gateway created
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing an annotation update on a Service, changing the Prefix or CORS fields in kt-virtual-environment/rule, and inspect the virtual-env-operator reconcile logs. The issue is done when the corresponding VirtualService configuration reflects the changed rule without deleting and recreating the Service.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, kubernetes
Domain
infrastructure
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.