Added packages to support render/save/apply kubernetes manifests#85
Added packages to support render/save/apply kubernetes manifests#85swapnachagam wants to merge 4 commits intoAutodesk:mainfrom
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.
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.
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.
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.
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.
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>