Skip to content

Commit

Permalink
feat: deploy modules to different namespaces
Browse files Browse the repository at this point in the history
Signed-off-by: hanshal101 <[email protected]>
  • Loading branch information
hanshal101 authored and hanshal101 committed Jul 17, 2024
1 parent 5da3c78 commit 1e8804a
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions cyclops-ctrl/internal/cluster/k8sclient/modules.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,16 +56,12 @@ func (k *KubernetesClient) GetModule(name, namespace string) (*cyclopsv1alpha1.M
func (k *KubernetesClient) GetResourcesForModule(name, namespace string) ([]dto.Resource, error) {
out := make([]dto.Resource, 0, 0)

<<<<<<< HEAD
managedGVRs, err := k.getManagedGVRs(name)
=======
module, err := k.GetModule(name, namespace)
if err != nil {
return nil, err
}

managedGVRs, err := k.getManagedGVRs(module)
>>>>>>> db95630 (feat: deploy modules to different namespaces)
managedGVRs, err := k.getManagedGVRs(module.Name, namespace)
if err != nil {
return nil, err
}
Expand Down Expand Up @@ -112,8 +108,8 @@ func (k *KubernetesClient) GetResourcesForModule(name, namespace string) ([]dto.
return out, nil
}

func (k *KubernetesClient) getManagedGVRs(moduleName string) ([]schema.GroupVersionResource, error) {
module, _ := k.GetModule(moduleName)
func (k *KubernetesClient) getManagedGVRs(moduleName, namespace string) ([]schema.GroupVersionResource, error) {
module, _ := k.GetModule(moduleName, namespace)

if module != nil && len(module.Status.ManagedGVRs) != 0 {
existing := make([]schema.GroupVersionResource, 0, len(module.Status.ManagedGVRs))
Expand Down

0 comments on commit 1e8804a

Please sign in to comment.