Commit Graph
629 Commits
Author SHA1 Message Date
Ayush KumarandGitHub 7a4e59b295 [Backport release-1.9] Fix: prevent unbounded read in Terraform remote configuration loader (GHSA-fmgp-q6jx-gg3x) (#7192)
* Merge commit from fork

* fix: prevent unbounded read in Terraform remote configuration loader (GHSA-fmgp-q6jx-gg3x)

* fix: bound remote Terraform clone and invalidate cache on rejection

Follow-up hardening for GHSA-fmgp-q6jx-gg3x.

Bound the clone of the attacker-supplied repository: shallow Depth:1, a
2-minute fetch timeout via PlainCloneContext, and post-clone caps on the
retained tree size (64 MiB) and file count, rejecting and removing a clone
that exceeds them.

Invalidate the clone cache: re-clone when the recorded remote URL changes,
and remove the cache on a failed clone or a rejected read so a corrected
repository is re-fetched instead of a poisoned or stale tree being reused.

Validate the module name before building the cache path, and log clone,
rejection, and eviction events.

Signed-off-by: Ayush Kumar <ayushshyamkumar888@gmail.com>

* Fix: resolve gosec G304 lint failure in Terraform module cache check (#7190)

Wrap the cache remote marker read in filepath.Clean, the same pattern
other os.ReadFile call sites in this repo use to satisfy gosec. The
path is built from filepath.Join and a constant suffix, with the module
name validated beforehand, so behavior is unchanged.

The finding surfaced on master after the GHSA-fmgp-q6jx-gg3x merge
because the advisory workflow did not run the full lint job.

Signed-off-by: Ayush Kumar <ayushshyamkumar888@gmail.com>

* Chore: bump actions/cache to v4 in CI workflows

GitHub has closed down actions/cache v1 and v2. Any job pinned to the old
SHA (704facf57e6136b1bc63b828d79edcd491f0ee84) is now automatically failed
at job setup, before any step runs. On this branch that broke check-diff,
check-windows, and unit-tests (each failing in a few seconds with no logs).

Bump the three references in go.yml and unit-test.yml to actions/cache@v4,
matching the version already used on master, so these jobs can run again.

Signed-off-by: Ayush Kumar <ayushshyamkumar888@gmail.com>

* Chore: install envtest binaries via setup-envtest in unit tests

The RyanSiu1995/kubebuilder-action step fetched kube-apiserver and kubectl
from the kubernetes-release and kubebuilder-tools storage buckets, which have
since been retired. Those downloads now return small 404 error pages that get
saved as the binaries, so envtest cannot start the control plane (exec format
error) and the unit-test BeforeSuite panics.

Replace that step with the official prebuilt setup-envtest, which pulls the
matching envtest bundle (etcd, kube-apiserver, kubectl) for Kubernetes 1.26.1
from the current controller-runtime release index and exports its path through
KUBEBUILDER_ASSETS.

Signed-off-by: Ayush Kumar <ayushshyamkumar888@gmail.com>

* Chore: pin cache action and harden envtest install per review

Address automated review feedback on the CI changes:

- Pin actions/cache to a commit SHA (v4.3.0, 0057852) in go.yml and
  unit-test.yml instead of the mutable v4 tag, matching how every other
  action in these workflows is pinned.
- Add curl -f to the setup-envtest download so an HTTP error fails the step
  immediately instead of saving an error page as the binary.
- Verify the downloaded setup-envtest against a known SHA-256 before running it.
- Capture the envtest asset path into a variable and fail fast when it is empty
  or not a directory, rather than letting a failed command substitution slip
  through and surface later as a confusing make test error.

Signed-off-by: Ayush Kumar <ayushshyamkumar888@gmail.com>

* Fix: load 0.2.0 helm test chart from local file instead of dead repo

The helm helper test fixture pointed version 0.2.0 at
https://charts.kubevela.net/example/autoscalertrait-0.1.0.tgz, but that host
no longer resolves. Once the unit-test suite could run again, "Test getValues
from chart" failed with "cannot load chart from chart repo".

Point the 0.2.0 entry at the local autoscalertrait-0.2.0.tgz that already
ships in testdata, matching how master resolves this chart, so the test no
longer depends on an external network endpoint.

Signed-off-by: Ayush Kumar <ayushshyamkumar888@gmail.com>

* Fix: point addon CLI tests at the live KubeVela registry

The addon listing and status tests registered https://addons.kubevela.net,
which no longer resolves, so the three "addon in the registry" cases failed
once the suite could run again.

Point them at https://kubevela.github.io/catalog/official, the registry that
master already uses for these same tests. The only difference between this
file and master was this URL (the assertions are identical), and that host
still serves the addons the assertions expect.

Signed-off-by: Ayush Kumar <ayushshyamkumar888@gmail.com>

* Chore: re-trigger CI for stuck e2e jobs

Signed-off-by: Ayush Kumar <ayushshyamkumar888@gmail.com>

* Fix: run release-1.9 e2e jobs on GitHub-hosted runners

The e2e-tests and e2e-multi-cluster-tests jobs targeted self-hosted runners,
which GitHub does not assign to pull requests from forks. The jobs sat queued
until the 24h ceiling and were cancelled, so they never ran on this PR (the
original run shows no runner assigned and zero steps executed).

Switch both to ubuntu-22.04, the GitHub-hosted runner that release-1.10 and
master already use for these jobs, where the same fork-based backport runs
them successfully. These workflows are self-contained (they install their own
tools and create the kind cluster inline), so no other change is needed.

Signed-off-by: Ayush Kumar <ayushshyamkumar888@gmail.com>

* Fix: wait for flux controllers before enabling the terraform e2e addon

The e2e post-hook enabled the terraform addon right after fluxcd. The
terraform addon's controller is a flux HelmRelease that needs the flux
source-controller and helm-controller pods running to reconcile, but flux
readiness was only checked after every addon had been enabled. On the
GitHub-hosted runner (slower than the self-hosted one this hook was written
for) the terraform addon enable timed out after 600s waiting on a reconcile
that could not happen until flux was up.

Add the flux-system readiness checks before the terraform addon enable so
flux is reconciling before the addon that depends on it is applied.

Signed-off-by: Ayush Kumar <ayushshyamkumar888@gmail.com>

* Fix: enable terraform e2e addon with terraform-controller 0.8.0

The terraform addon enable timed out after 600s on the GitHub-hosted runner.
A previous attempt that waited for the flux controllers to be Ready before
enabling the addon did not help: the run logs confirm source-controller and
helm-controller were Ready and the terraform addon still timed out, so flux
readiness was not the cause. Revert that wait.

The real difference from master, where this addon enables cleanly, is the
terraform-controller chart: release-1.9 pinned 0.2.11 from charts.kubevela.net,
while master uses 0.8.0 from kubevela.github.io/charts with the ghcr image.
Backport that chart version and image override so the addon controller becomes
healthy in time.

Signed-off-by: Ayush Kumar <ayushshyamkumar888@gmail.com>

* Fix: do not log or persist credentials embedded in Terraform module remote URLs

GetTerraformConfigurationFromRemote logged the raw remote URL and wrote it to
the .remote-url cache marker. An authenticated Git URL such as
https://user:token@host/repo.git embeds credentials in its userinfo, so the
raw value leaked secrets into controller logs and onto disk.

Strip any embedded userinfo with a new redactURLCredentials helper before the
URL is logged or recorded, and compare against the stripped form when checking
the cache marker so cache reuse still works. scp-style SSH URLs authenticate
with keys and carry no secret, so they pass through unchanged.

See GHSA-fmgp-q6jx-gg3x.

Signed-off-by: Ayush Kumar <65535504+roguepikachu@users.noreply.github.com>

* Fix: discover traits from a reachable registry in the e2e raw-url test

The e2e registry test discovered traits from oss://registry.kubevela.net,
whose TLS certificate expired in May 2025, so e2e-tests failed with a
certificate verification error. The default-registry listing test hits the
same expired endpoint.

Match release-1.10: point raw-url discovery at the GitHub-hosted registry,
and disable the default-registry listing until the default registry is updated.

Signed-off-by: Ayush Kumar <65535504+roguepikachu@users.noreply.github.com>

---------

Signed-off-by: Ayush Kumar <ayushshyamkumar888@gmail.com>
Signed-off-by: Ayush Kumar <65535504+roguepikachu@users.noreply.github.com>
2026-06-25 20:50:35 -07:00
Daniel HigueroandGitHub 1a001e5b29 Address GolangCI lint 1.55 errors (#6453)
Signed-off-by: Daniel Higuero <daniel@napptive.com>
2024-02-07 17:27:32 +08:00
JohnJanandGitHub d787e95a08 Feat: apply-component supports namespace (#6248) 2023-08-31 14:08:48 +08:00
qiaozpandGitHub 94cbcad471 Chore: tidy appHandler (#6300) 2023-08-28 11:01:33 +08:00
qiaozpandGitHub 5a5721048c Refactor: organize appHandler, remove unused flags (#6254) 2023-08-11 12:50:22 +08:00
qiaozpandGitHub bab5bb2caf Refactor: capabilities and workload in appfile parsing (#6250) 2023-08-10 14:41:20 +08:00
qiaozpandGitHub 307d1db36d Chore: revert "Feat: apply-component supports namespace" (#6247) 2023-08-07 15:44:20 +08:00
JohnJanandGitHub f0357fdc8f Feat: apply-component supports namespace (#6228)
* Feat: apply-component supports namespace

Signed-off-by: wuzhongjian <wuzhongjian_yewu@cmss.chinamobile.com>

* Feat: apply-component supports namespace

Signed-off-by: wuzhongjian <wuzhongjian_yewu@cmss.chinamobile.com>

---------

Signed-off-by: wuzhongjian <wuzhongjian_yewu@cmss.chinamobile.com>
2023-07-25 10:31:18 +08:00
SomefiveandGitHub da3618ad27 Chore: remove useless envbinding env (#6122)
* Chore: remove useless envbinding env

Signed-off-by: Somefive <yd219913@alibaba-inc.com>

* fix go proxy

Signed-off-by: Somefive <yd219913@alibaba-inc.com>

---------

Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2023-06-15 14:50:20 +08:00
SomefiveandGitHub f1bae16723 Chore: remove schematic kube and helm (#6099)
* Chore: remove unused code

Signed-off-by: Somefive <yd219913@alibaba-inc.com>

* Chore: remove schematic Kube & Helm

Signed-off-by: Somefive <yd219913@alibaba-inc.com>

---------

Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2023-06-12 10:41:02 +08:00
SomefiveandGitHub c255d21ad6 Chore: remove unnecessary go mod (#6093)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2023-06-08 15:32:57 +08:00
SomefiveandGitHub 8e6bed2340 Fix: application gc not blocked by apprev gc (#6074)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2023-06-05 11:04:23 +08:00
SomefiveandGitHub f15eba2c5f Chore: remove legacy rollout and scope (#6068)
* Chore: remove legacy rollout & scope

Signed-off-by: Somefive <yd219913@alibaba-inc.com>

* remove outdated params

Signed-off-by: Somefive <yd219913@alibaba-inc.com>

* fix

Signed-off-by: Somefive <yd219913@alibaba-inc.com>

---------

Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2023-06-05 10:57:38 +08:00
SomefiveandGitHub dd899c2b39 Chore: remove outdated apis(v1alppha2 ApplicationConfiguration Component, and HealthScope, Rollout) (#6041)
* remove outdated api

Signed-off-by: Somefive <yd219913@alibaba-inc.com>

* fix rt test: no component rt

Signed-off-by: Somefive <yd219913@alibaba-inc.com>

* recover context.revision to component hash

Signed-off-by: Somefive <yd219913@alibaba-inc.com>

---------

Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2023-06-01 09:32:49 +08:00
yyzxwandGitHub 99ad780261 chore: add controller ut (#6043)
Signed-off-by: yyzxw <1020938856@qq.com>
2023-05-29 11:55:06 +08:00
SomefiveandGitHub 2298dd73dc Feat: revert ci to kind (#6035)
* Feat: revert ci to kind

Signed-off-by: Somefive <yd219913@alibaba-inc.com>

* feat: use internal runner

Signed-off-by: Somefive <yd219913@alibaba-inc.com>

* fix test bug

Signed-off-by: Somefive <yd219913@alibaba-inc.com>

---------

Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2023-05-25 17:49:44 +08:00
SomefiveandGitHub ef4bb07fb3 Chore: remove dm (#6036)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2023-05-25 13:54:35 +08:00
SomefiveandGitHub 4d81ba8909 Feat: support force resource location with dispatch (#6033)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2023-05-25 10:18:50 +08:00
yyzxwandGitHub dc52498b1d refactor: enhanced code readability (#6012)
Signed-off-by: yyzxw <1020938856@qq.com>
2023-05-21 15:19:06 +08:00
Dhanu SaputraandGitHub 208a4aed2d Feat: application_controller should be responsible for deleting application revision (#5739)
* [Feature] application_controller should be responsible for deleting application revision

Signed-off-by: dhanu <andreasdhanu@gmail.com>

* test

Signed-off-by: dhanu <andreasdhanu@gmail.com>

* delete-app-revision: fix reviews, add tests

Signed-off-by: dhanu <andreasdhanu@gmail.com>

* delete-app-revision: rebase master

Signed-off-by: dhanu <andreasdhanu@gmail.com>

* delete-app-revision: make func private

Signed-off-by: dhanu <andreasdhanu@gmail.com>

* delete-app-revision clean

Signed-off-by: dhanu <andreasdhanu@gmail.com>

* delete-app-revision: fix staticcheck

Signed-off-by: dhanu <andreasdhanu@gmail.com>

* delete-app-revision: fix review

Signed-off-by: dhanu <andreasdhanu@gmail.com>

---------

Signed-off-by: dhanu <andreasdhanu@gmail.com>
2023-05-17 17:41:01 +08:00
SomefiveandGitHub da8588c887 Feat: support customizing application revision limit number in policy (#5995)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2023-05-16 16:12:37 +08:00
1af82cd282 cleanup: remove unused code and fix typo (#5986)
Signed-off-by: yyzxw <1020938856@qq.com>
Signed-off-by: xiaowu.zhu <xiaowu.zhu@daocloud.io>
Co-authored-by: xiaowu.zhu <xiaowu.zhu@daocloud.io>
2023-05-16 12:37:00 +08:00
SomefiveandGitHub d59b116d06 Feat: upgrade ginkgo to v2 (#5940)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2023-05-15 16:07:51 +08:00
SomefiveandGitHub f328308d8e Feat: remove unused crd in chart (#5899)
* Feat: remove unused crd in chart

Signed-off-by: Somefive <yd219913@alibaba-inc.com>

* fix test

Signed-off-by: Somefive <yd219913@alibaba-inc.com>

---------

Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2023-04-24 09:57:30 +08:00
SomefiveandGitHub 106b7b3670 Feat: support mark stage in gc when workflow failed (#5882)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2023-04-20 14:05:45 +08:00
SomefiveandGitHub d8af202242 Feat: upgrade k8s.io to 0.26 (#5758)
* Feat: upgrade k8s.io to 0.26

Signed-off-by: Somefive <yd219913@alibaba-inc.com>

* Feat: replace temp replace

Signed-off-by: Somefive <yd219913@alibaba-inc.com>

---------

Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2023-04-10 11:19:05 +08:00
Tianxin DongandGitHub 7ea237d580 Feat: add mode in steps for step group (#5799) 2023-04-06 10:52:48 +08:00
SomefiveandGitHub 4aa14fc337 Feat: support pause reconcile (#5732)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2023-03-24 13:19:44 +08:00
SomefiveandGitHub 50458bc455 Feat: memory optimization via enhance informer cache (#5683) 2023-03-20 10:19:21 +08:00
wyikeandGitHub a36eb4f2e2 Fix: loading definitions if lack in the revision when calculate dispatch stage of trait. (#5644)
* small fix for dispatch stage

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>

revert useless commit

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>

small fix

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>

* add test case

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>

---------

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>
2023-03-13 11:22:44 +08:00
Tianxin DongandGitHub 388056fda0 Fix: stores workflow status in revison if it is restarted (#5604)
Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>
2023-03-07 14:13:56 +08:00
SomefiveandGitHub d60bb6224d Feat: optimize empty patch request (#5600)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2023-03-07 11:11:06 +08:00
SomefiveandGitHub 76a8d13a37 Feat: remove loop reduction & filter unnecessary apprev update (#5598)
* Feat: remove loop reduction

Signed-off-by: Somefive <yd219913@alibaba-inc.com>

* Feat: filter unnecessary rev update

Signed-off-by: Somefive <yd219913@alibaba-inc.com>

* Fix: add retry for multicluster e2e test

Signed-off-by: Somefive <yd219913@alibaba-inc.com>

---------

Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2023-03-03 20:05:10 +08:00
SomefiveandGitHub 4596aac043 Feat: upgrade cluster-gateway to use v1.8.0-alpha.3 & fix time metrics bug (#5593)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2023-03-02 14:49:48 +08:00
SomefiveandGitHub 65215c00e4 Feat: refactor prometheus metrics (#5592)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2023-03-01 14:32:35 +08:00
Tianxin DongandGitHub 41844eb461 Feat: add op.#Suspend and suspending phase in step (#5567) 2023-03-01 10:59:31 +08:00
SomefiveandGitHub c0234888a6 Feat: optimize list op (#5572)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2023-02-27 19:04:57 +08:00
SomefiveandGitHub e2f95e065a Feat: update sharding using pkg (#5430)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2023-02-07 11:12:40 +08:00
SomefiveandGitHub b7e0cd86be Feat: add deploy inline policy and support loading definitions when lack in the revision (#5416)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2023-02-06 15:58:44 +08:00
Jianbo SunandGitHub 66dd2a70b7 Fix: aligin config create to be managed by apps with Dispatch function (#5384)
Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
2023-01-31 16:55:37 +08:00
SomefiveandGitHub 9efbb72850 Feat: support sharding in controller (#5360)
* Feat: bootstrap sharding

Signed-off-by: Somefive <yd219913@alibaba-inc.com>

* Chore: refactor end-e2e-core-shards script

Signed-off-by: Somefive <yd219913@alibaba-inc.com>

---------

Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2023-01-31 13:03:29 +08:00
Tianxin DongandGitHub 5158fcf6c1 Fix: optimize skip reconcile and expose error if the traits patch an invalid workload like terraform (#5334)
Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>
2023-01-13 17:04:22 +08:00
SomefiveandGitHub 5a845104fb Feat: support interactive mode to manually skip encountered errors (#5266) 2023-01-06 15:03:47 +08:00
SomefiveandGitHub 693eb3cb1d Feat: add pre-dispatch dryrun check (#5277)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>

Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2023-01-06 10:46:50 +08:00
Tianxin DongandGitHub 5f71d05db1 Fix: fix inputs conflict for workflow (#5251)
Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>
2023-01-04 10:45:51 +08:00
barnettZQGandGitHub d588def0af Feat: versioned the context backend values to the app revision (#5231)
Signed-off-by: barnettZQG <barnett.zqg@gmail.com>

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
2023-01-02 21:23:12 +08:00
SomefiveandGitHub 18f778a871 Fix: gc failure cause workflow restart not working properly (#5240)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>

Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2022-12-29 23:15:02 +08:00
my-git9andGitHub 2fb0633354 cleanup ioutil for newer go version (#5238)
Signed-off-by: xin.li <xin.li@daocloud.io>

Signed-off-by: xin.li <xin.li@daocloud.io>
2022-12-29 19:34:45 +08:00
Tianxin DongandGitHub 38aa522016 Chore: update workflow version to add restart from step and fix bugs (#5233)
Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>
2022-12-29 18:34:59 +08:00
SomefiveandGitHub 88f4c33d72 Feat: upgrade dependency (#5217) 2022-12-27 16:28:13 +08:00