Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: address failure when rendering addon API schemas #4433

Merged
merged 5 commits into from
Jul 25, 2022

Conversation

charlie0129
Copy link
Member

@charlie0129 charlie0129 commented Jul 24, 2022

Signed-off-by: Charlie Chiang charlie_c_0129@outlook.com

Description of your changes

After the introduction of global addon parameters, rendering APISchemas will fail:

$ vela addon enable sample-addon
enable addon by local dir: sample-addon 
Error: fail to generate openAPIschema for addon sample-addon : capability sample-addon doesn't contain section `parameter`

This is because it is still reading the legacy paramter.cue. But we are using global parameters, so there is nothing inside the legacy parameter.

Now it will read the global parameter first.

I have:

  • Read and followed KubeVela's contribution process.
  • Related Docs updated properly. In a new feature or configuration option, an update to the documentation is necessary.
  • Run make reviewable to ensure this PR is ready for review.
  • Added backport release-x.y labels to auto-backport this PR if necessary.

How has this code been tested

Tests for the new addon structure have been added to prevent regressions.

Special notes for your reviewer

Core changes are in pkg/addon/addon.go

Signed-off-by: Charlie Chiang <charlie_c_0129@outlook.com>
@codecov
Copy link

codecov bot commented Jul 24, 2022

Codecov Report

Merging #4433 (0442f82) into master (3e57246) will increase coverage by 2.02%.
The diff coverage is 60.00%.

@@            Coverage Diff             @@
##           master    #4433      +/-   ##
==========================================
+ Coverage   59.47%   61.49%   +2.02%     
==========================================
  Files         343      348       +5     
  Lines       34247    34389     +142     
==========================================
+ Hits        20368    21149     +781     
+ Misses      11199    10502     -697     
- Partials     2680     2738      +58     
Flag Coverage Δ
apiserver-e2etests 27.78% <0.00%> (+0.09%) ⬆️
apiserver-unittests 39.97% <ø> (+0.05%) ⬆️
core-unittests 56.55% <60.00%> (+0.09%) ⬆️
e2e-multicluster-test 19.80% <0.00%> (?)
e2e-rollout-tests 22.87% <ø> (-0.02%) ⬇️
e2etests 29.01% <ø> (+0.05%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
pkg/addon/addon.go 64.36% <50.00%> (+1.01%) ⬆️
pkg/addon/render.go 76.33% <100.00%> (ø)
...tepdefinition/workflowstepdefinition_controller.go 69.14% <0.00%> (-7.45%) ⬇️
...es/policydefinition/policydefinition_controller.go 69.47% <0.00%> (-2.11%) ⬇️
...server/infrastructure/datastore/kubeapi/kubeapi.go 66.53% <0.00%> (-0.39%) ⬇️
pkg/apiserver/domain/service/addon.go 60.14% <0.00%> (ø)
pkg/cmd/builder.go 78.72% <0.00%> (ø)
pkg/cmd/completion.go 0.00% <0.00%> (ø)
pkg/cmd/utils.go 26.92% <0.00%> (ø)
pkg/cmd/factory.go 78.78% <0.00%> (ø)
... and 53 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3e57246...0442f82. Read the comment docs.

@wonderflow wonderflow added the backport release-1.5 add this label will automatically backport this PR to release-1.5 branch label Jul 24, 2022
Signed-off-by: Charlie Chiang <charlie_c_0129@outlook.com>
Signed-off-by: Charlie Chiang <charlie_c_0129@outlook.com>
Signed-off-by: Charlie Chiang <charlie_c_0129@outlook.com>
Signed-off-by: Charlie Chiang <charlie_c_0129@outlook.com>
@charlie0129 charlie0129 marked this pull request as ready for review July 24, 2022 17:25
Copy link
Collaborator

@wangyikewxgm wangyikewxgm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@github-actions
Copy link

Successfully created backport PR #4445 for release-1.5.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport release-1.5 add this label will automatically backport this PR to release-1.5 branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants