-
Notifications
You must be signed in to change notification settings - Fork 3
Added packages to support render/save/apply kubernetes manifests #85
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
base: main
Are you sure you want to change the base?
Conversation
|
CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅ |
|
I have read the CLA Document and I hereby sign the CLA |
| func (s *SpinClient) ExecutePipeline(argsJSON string, stringify bool) (string, *http.Response, error) { | ||
|
|
||
| // Check if a valid Kubernetes context is set | ||
| cmd := exec.Command("kubectl", "config", "current-context") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of relying on running a CLI command - let's use the native k8s client to do the apply (create) - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.19.0/pkg/client#example-Client-Create
pkg/backend/kube/backend.go
Outdated
| return "", nil, nil | ||
| } | ||
|
|
||
| func (s *SpinClient) DeletePipeline(pipelineJSON string) (*http.Response, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Considering we're dropping files and applying a CR - lets also delete both, the dropped files and the CR that gets created on the cluster.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is now done. I am deleting the folder, files and also CR from the kuberntes. I have tested the same from local
|
|
||
| // GetPipeline - Dummy implementation for retrieving a pipeline. | ||
| func (s *SpinClient) GetPipeline(application string, pipelineName string) (map[string]interface{}, *http.Response, error) { | ||
| s.log.Infof("Retrieving pipeline: application=%s, pipelineName=%s", application, pipelineName) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This might be getting a specific resource from the cluster or a specific file from the filesystem.
Will need to check it's usage and how it relates to decide which it should be getting.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will work on this one later.
Overview
Github Issue: {LINK TO ISSUE}
As part of the Hackathon in Autodesk team, I have updated the existing shore render,save and exec functions to be able to generate the k8smanifests. This is a PoC only and still needs to be developed
Summary (required always)
shore render -k k
main.pipeline.jsonnetin a json format which will be again converted to yaml file**shore save -e d **
generatedin the current directory.shore exec -e d
generatedfolder as well from the kubernetes clustershore delete -e d
Tested the above scenarios from local using the unit tests which are present using a local kubernetes cluster and some sample files
Test Results
shore render

Shore save
shore exec
shore delete

Notes
Checklist
<username>/<gh-issue-#number>:<short-description>