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

Add Minify and Flatten for In-cluster deployment with Minikube #588

Merged
merged 7 commits into from
Sep 25, 2024

Conversation

Alero-Awani
Copy link
Contributor

@Alero-Awani Alero-Awani commented Sep 12, 2024

Description

This PR introduces a central function ProcessConfig for processing kubeconfig files, encapsulating the functionality for loading, validating, and writing kubeconfig files, whether from a file location or a []byte input.

The function has been integrated into the DetectKubeConfig, addressing this issue which specifically occurs when running the command mesheryctl system start -p Kubernetes.

Fixes #11546

Signed commits

  • Yes, I signed my commits.

@leecalcote
Copy link
Member

Thanks for tackling this, @Alero-Awani

Copy link

@MUzairS15 MUzairS15 left a comment

Choose a reason for hiding this comment

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

LGTM

@MUzairS15
Copy link

MUzairS15 commented Sep 18, 2024

@Alero-Awani Can you fix these lint failures? then we are good to go.

if err != nil {
return nil, ErrValidateConfig(err)
return nil, nil, err

Choose a reason for hiding this comment

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

Please reuse/define a new meshkit error.

if err != nil {
return nil, ErrLoadConfig(err)
return nil, nil, err

Choose a reason for hiding this comment

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

Please reuse/define a new meshkit error.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Alright Noted! Thank you for the review 😃

if err != nil{
return nil, err
}
if config, err = clientcmd.RESTConfigFromKubeConfig(cfgFile); err == nil {
return config, err
Copy link

@MUzairS15 MUzairS15 Sep 23, 2024

Choose a reason for hiding this comment

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

Suggested change
return config, err
return config, err

While this is not immediately due to your changes, you can improve the logic to ensure meshkit error is returned while you are here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Alright thank you for this. I will keep in mind to prioritize returning Meshkit errors

Copy link

@MUzairS15 MUzairS15 left a comment

Choose a reason for hiding this comment

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

Thanks @Alero-Awani

@MUzairS15 MUzairS15 merged commit fe3024a into meshery:master Sep 25, 2024
3 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants