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: stack nil pointer error #615

Merged
merged 1 commit into from
Nov 24, 2023
Merged

Conversation

cr7258
Copy link
Contributor

@cr7258 cr7258 commented Nov 23, 2023

What type of PR is this?

/kind bug

What this PR does / why we need it:

When I run --watch to monitor resource change, I got this error:

kusion apply --watch
 ✔︎  Generating Intent in the Stack dev...                                                                                                                                                                                           
Stack: dev  ID                                                          Action
* ├─       v1:Namespace:wordpress                                      Create
* ├─       v1:Secret:wordpress:wordpress-db-local-secret               Create
* ├─       v1:Secret:wordpress:wordpress-db                            Create
* ├─       v1:Service:wordpress:wordpress-dev-wordpress-private        Create
* ├─       v1:Service:wordpress:wordpress-db-local-service             Create
* ├─       v1:PersistentVolumeClaim:wordpress:wordpress-db-local-pvc   Create
* ├─       apps/v1:Deployment:wordpress:wordpress-dev-wordpress        Create
* └─       apps/v1:Deployment:wordpress:wordpress-db-local-deployment  Create


? Do you want to apply these diffs? yes
Start applying diffs ...
 SUCCESS  Create v1:Namespace:wordpress success                                                                                                                                                                                      
 SUCCESS  Create v1:Secret:wordpress:wordpress-db-local-secret success                                                                                                                                                               
 SUCCESS  Create v1:Secret:wordpress:wordpress-db success                                                                                                                                                                            
 SUCCESS  Create v1:Service:wordpress:wordpress-db-local-service success                                                                                                                                                             
 SUCCESS  Create v1:Service:wordpress:wordpress-dev-wordpress-private success                                                                                                                                                        
 SUCCESS  Create v1:PersistentVolumeClaim:wordpress:wordpress-db-local-pvc success                                                                                                                                                   
 SUCCESS  Create apps/v1:Deployment:wordpress:wordpress-dev-wordpress success                                                                                                                                                        
 SUCCESS  Create apps/v1:Deployment:wordpress:wordpress-db-local-deployment success                                                                                                                                                  
Create apps/v1:Deployment:wordpress:wordpress-db-local-deployment success [8/8] ███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████ 100% | 3s
Apply complete! Resources: 8 created, 0 updated, 0 deleted.

Start watching changes ...
 ❌  runtime error: invalid memory address or nil pointer dereference
exit status 1

The stack is null, resulting nil pointer error:
https://github.com/cr7258/kusion/blob/1dab8e16ae3189fa707e721f5967e68551ecf003/pkg/util/kube/config/config.go#L28

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?


Additional documentation e.g., design docs, usage docs, etc.:


Copy link

github-actions bot commented Nov 23, 2023

CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅

@cr7258
Copy link
Contributor Author

cr7258 commented Nov 23, 2023

I have read the CLA Document and I hereby sign the CLA

@adohe adohe added kind/bug Something isn't working area/cli labels Nov 24, 2023
@coveralls
Copy link

Pull Request Test Coverage Report for Build 6971201106

  • 1 of 1 (100.0%) changed or added relevant line in 1 file are covered.
  • 14 unchanged lines in 3 files lost coverage.
  • Overall coverage decreased (-0.1%) to 75.733%

Files with Coverage Reduction New Missed Lines %
pkg/engine/operation/parser/parser.go 3 79.27%
pkg/engine/operation/parser/spec_parser.go 4 56.1%
pkg/cmd/apply/options.go 7 71.83%
Totals Coverage Status
Change from base Build 6965344887: -0.1%
Covered Lines: 6978
Relevant Lines: 9214

💛 - Coveralls

@SparkYuan
Copy link
Member

@cr7258 Thanks for your contributions. Welcome!

@healthjyk
Copy link
Contributor

It seems an unexpected bug. Thanks for your contribution!

@healthjyk healthjyk merged commit ddddbac into KusionStack:main Nov 24, 2023
6 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Nov 24, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants