higress icon indicating copy to clipboard operation
higress copied to clipboard

feat: hgctl upgrade support from-helm flag

Open sjcsjc123 opened this issue 1 year ago • 6 comments

Ⅰ. Describe what this PR did

upgrade命令支持读取helm最新版本的信息

Ⅱ. Does this pull request fix one issue?

fixes: #570

Ⅲ. Why don't you add test cases (unit test/integration test)?

Ⅳ. Describe how to verify it

Ⅴ. Special notes for reviews

简单debug了一下,运行hgctl upgrade --from-helm命令后进入如下地方,已经可以看到更换到latest版本号

image

upgrade本质上也是install命令

image

sjcsjc123 avatar Feb 07 '24 14:02 sjcsjc123

当 higress 用 helm 安装后,执行hgctl upgrade --from-helm 表示从用helm安装higress时设置参数生成 hgctl install profile。可以通过 helm status RELEASENAME -oyaml 命令读取 helm 安装配置参数。

2456868764 avatar Feb 16 '24 08:02 2456868764

@sjcsjc123 如上面Jun所说,这个issue的目的是继承helm安装时的参数,从而完全替代helm安装方式

johnlanni avatar Feb 20 '24 03:02 johnlanni

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 38.17%. Comparing base (9c112a0) to head (e1cc05b).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #824      +/-   ##
==========================================
+ Coverage   38.14%   38.17%   +0.02%     
==========================================
  Files          61       61              
  Lines       10434    10434              
==========================================
+ Hits         3980     3983       +3     
+ Misses       6154     6152       -2     
+ Partials      300      299       -1     

see 1 file with indirect coverage changes

codecov-commenter avatar Feb 21 '24 07:02 codecov-commenter

helm upgrade的时候要将profileName设置为k8s还是local-k8s,目前的思路是如果指定了from-helm参数,通过helm status获取config的值,将其转化为valuesOverlay,通过GenProfile(profileName, valuesOverlay, setFlags)方法生成profile;然后继续往下执行upgrade流程

sjcsjc123 avatar Feb 28 '24 04:02 sjcsjc123

helm upgrade的时候要将profileName设置为k8s还是local-k8s,目前的思路是如果指定了from-helm参数,通过helm status获取config的值,将其转化为valuesOverlay,通过GenProfile(profileName, valuesOverlay, setFlags)方法生成profile;然后继续往下执行upgrade流程

是否是 local-k8s 是根据 global.local是否 True来判断, 同时 profile里的global 设置是否可以从 helm 安装安装参数中恢复?

2456868764 avatar Feb 28 '24 07:02 2456868764

helm upgrade的时候要将profileName设置为k8s还是local-k8s,目前的思路是如果指定了from-helm参数,通过helm status获取config的值,将其转化为valuesOverlay,通过GenProfile(profileName, valuesOverlay, setFlags)方法生成profile;然后继续往下执行upgrade流程

是否是 local-k8s 是根据 global.local是否 True来判断, 同时 profile里的global 设置是否可以从 helm 安装安装参数中恢复?

可以恢复出来

sjcsjc123 avatar Feb 28 '24 12:02 sjcsjc123