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

Remove all pending endpoints from Kubeops #5249

Merged
merged 10 commits into from
Sep 1, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions chart/kubeapps/templates/kubeappsapis/rbac.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,47 @@ subjects:
- kind: ServiceAccount
name: {{ template "kubeapps.kubeappsapis.serviceAccountName" . }}
namespace: {{ .Release.Namespace }}
{{- if $.Values.featureFlags.operators }}
---
apiVersion: {{ include "common.capabilities.rbac.apiVersion" . }}
kind: ClusterRole
metadata:
name: {{ printf "kubeapps:%s:kubeappsapis-operators" .Release.Namespace | quote }}
labels: {{- include "common.labels.standard" . | nindent 4 }}
app.kubernetes.io/component: kubeappsapis
{{- if .Values.commonLabels }}
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" . ) | nindent 4 }}
{{- end }}
{{- if .Values.commonAnnotations }}
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
{{- end }}
rules:
- apiGroups:
- packages.operators.coreos.com
resources:
- packagemanifests/icon
verbs:
- get
Comment on lines +57 to +62
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Needed for retrieving operators logos

---
apiVersion: {{ include "common.capabilities.rbac.apiVersion" . }}
kind: ClusterRoleBinding
metadata:
name: {{ printf "kubeapps:%s:kubeappsapis-operators" .Release.Namespace | quote }}
labels: {{- include "common.labels.standard" . | nindent 4 }}
app.kubernetes.io/component: kubeappsapis
{{- if .Values.commonLabels }}
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" . ) | nindent 4 }}
{{- end }}
{{- if .Values.commonAnnotations }}
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
{{- end }}
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: {{ printf "kubeapps:%s:kubeappsapis-operators" .Release.Namespace | quote }}
subjects:
- kind: ServiceAccount
name: {{ template "kubeapps.kubeappsapis.serviceAccountName" . }}
namespace: {{ .Release.Namespace }}
{{- end -}}
{{- end -}}
2 changes: 1 addition & 1 deletion cmd/kubeapps-apis/core/packages/v1alpha1/packages.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ func NewPackagesServer(pkgingPlugins []pluginsv1alpha1.PluginWithServer) (*packa
}, nil
}

// GetAvailablePackages returns the packages based on the request.
// GetAvailablePackageSummaries returns the packages based on the request.
func (s packagesServer) GetAvailablePackageSummaries(ctx context.Context, request *packages.GetAvailablePackageSummariesRequest) (*packages.GetAvailablePackageSummariesResponse, error) {
log.InfoS("+core GetAvailablePackageSummaries", "cluster", request.GetContext().GetCluster(), "namespace", request.GetContext().GetNamespace())

Expand Down
2 changes: 1 addition & 1 deletion cmd/kubeapps-apis/core/plugins/v1alpha1/plugins.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ type PluginWithServer struct {
Server interface{}
}

// coreServer implements the API defined in cmd/kubeapps-api-service/core/core.proto
// PluginsServer implements the API defined in "plugins.proto"
type PluginsServer struct {
plugins.UnimplementedPluginsServiceServer

Expand Down
75 changes: 75 additions & 0 deletions cmd/kubeapps-apis/docs/kubeapps-apis.swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -3565,6 +3565,69 @@
]
}
},
"/plugins/resources/v1alpha1/c/{context.cluster}/can-i": {
Copy link
Contributor

Choose a reason for hiding this comment

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

This API docs should also be (manually) copied to the dashboard/src/public/openapi.yaml file, but we can do it once we remove the kubeapps deployment entirely.

"post": {
"operationId": "ResourcesService_CanI",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/v1alpha1CanIResponse"
}
},
"401": {
"description": "Returned when the user does not have permission to access the resource.",
"schema": {}
},
"default": {
"description": "An unexpected error response.",
"schema": {
"$ref": "#/definitions/rpcStatus"
}
}
},
"parameters": [
{
"name": "context.cluster",
"description": "Cluster\n\nA cluster name can be provided to target a specific cluster if multiple\nclusters are configured, otherwise all clusters will be assumed.",
"in": "path",
"required": true,
"type": "string"
},
{
"name": "context.namespace",
"description": "Namespace. A namespace must be provided if the context of the operation is for a resource\nor resources in a particular namespace.\nFor requests to list items, not including a namespace here implies that the context\nfor the request is everything the requesting user can read, though the result can\nbe filtered by any filtering options of the request. Plugins may choose to return\nUnimplemented for some queries for which we do not yet have a need.",
"in": "query",
"required": false,
"type": "string"
},
{
"name": "group",
"description": "Group API Group of the Resource. \"*\" means all.\n+optional.",
"in": "query",
"required": false,
"type": "string"
},
{
"name": "resource",
"description": "Resource is one of the existing resource types. \"*\" means all.\n+optional.",
"in": "query",
"required": false,
"type": "string"
},
{
"name": "verb",
"description": "Verb is a kubernetes resource API verb, like: get, list, watch, create, update, delete, proxy. \"*\" means all.\n+optional.",
"in": "query",
"required": false,
"type": "string"
}
],
"tags": [
"ResourcesService"
]
}
},
"/plugins/resources/v1alpha1/c/{context.cluster}/ns": {
"post": {
"operationId": "ResourcesService_CreateNamespace",
Expand Down Expand Up @@ -4160,6 +4223,18 @@
"description": "An AvailablePackageSummary provides a summary of a package available for installation\nuseful when aggregating many available packages.",
"title": "AvailablePackageSummary"
},
"v1alpha1CanIResponse": {
"type": "object",
"properties": {
"allowed": {
"type": "boolean",
"description": "True if operation is allowed",
"title": "allowed"
}
},
"description": "Response for CanI operation",
"title": "CanIResponse"
},
"v1alpha1CheckNamespaceExistsResponse": {
"type": "object",
"properties": {
Expand Down
Loading