Skip to content

Commit

Permalink
Merge pull request #551 from rancher/logging-mgmt-rbac
Browse files Browse the repository at this point in the history
Fix issues with logging
  • Loading branch information
dbason authored Sep 13, 2022
2 parents 19bfb6a + 075c6fb commit b39af38
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 4 deletions.
37 changes: 37 additions & 0 deletions pkg/resources/gateway/rbac.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,43 @@ func (r *Reconciler) rbac() ([]resources.Resource, error) {
"keyrings",
"rolebindings",
"roles",
"opniopensearches",
},
Verbs: []string{
"get",
"list",
"watch",
"create",
"update",
"patch",
"delete",
},
},
{
APIGroups: []string{
"logging.opni.io",
},
Resources: []string{
"*",
},
Verbs: []string{
"get",
"list",
"watch",
"create",
"update",
"patch",
"delete",
},
},
{
APIGroups: []string{
"logging.opni.io",
"monitoring.opni.io",
"core.opni.io",
},
Resources: []string{
"'*'",
},
Verbs: []string{
"get",
Expand Down
8 changes: 4 additions & 4 deletions plugins/logging/pkg/logging/admin.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ func (p *Plugin) GetOpensearchCluster(
}, cluster); err != nil {
if k8serrors.IsNotFound(err) {
p.logger.Info("opensearch cluster does not exist")
return nil, nil
return &loggingadmin.OpensearchCluster{}, nil
}
return nil, err
}
Expand Down Expand Up @@ -83,7 +83,7 @@ func (p *Plugin) DeleteOpensearchCluster(
Namespace: p.storageNamespace,
},
}
return nil, p.k8sClient.Delete(ctx, cluster)
return &emptypb.Empty{}, p.k8sClient.Delete(ctx, cluster)
}

func (p *Plugin) CreateOrUpdateOpensearchCluster(
Expand Down Expand Up @@ -148,7 +148,7 @@ func (p *Plugin) CreateOrUpdateOpensearchCluster(
}(),
},
}
return nil, p.k8sClient.Create(ctx, k8sOpensearchCluster)
return &emptypb.Empty{}, p.k8sClient.Create(ctx, k8sOpensearchCluster)
}

err = retry.RetryOnConflict(retry.DefaultRetry, func() error {
Expand Down Expand Up @@ -245,7 +245,7 @@ func (p *Plugin) DoUpgrade(context.Context, *emptypb.Empty) (*emptypb.Empty, err
return p.k8sClient.Update(p.ctx, k8sOpensearchCluster)
})

return nil, err
return &emptypb.Empty{}, err
}

func convertNodePoolToProtobuf(pool opsterv1.NodePool) (*loggingadmin.OpensearchNodeDetails, error) {
Expand Down

0 comments on commit b39af38

Please sign in to comment.