From 8dae6ad307a2efa50911ff55d6483f65a4b69884 Mon Sep 17 00:00:00 2001 From: Arun Kumar Mohan Date: Thu, 5 May 2022 17:19:39 +0530 Subject: [PATCH] Patching ConsolePlugin CR with Prometheus service info Signed-off-by: Arun Kumar Mohan --- controllers/managedocs_controller.go | 50 ++++++ templates/consolePlugin.go | 30 ++++ .../v1alpha1/0000_10_consoleplugin.crd.yaml | 132 ++++++++++++++ .../openshift/api/console/v1alpha1/doc.go | 6 + .../api/console/v1alpha1/register.go | 39 ++++ .../openshift/api/console/v1alpha1/types.go | 1 + .../console/v1alpha1/types_console_plugin.go | 168 ++++++++++++++++++ .../console/v1alpha1/zz_generated.deepcopy.go | 141 +++++++++++++++ .../zz_generated.swagger_doc_generated.go | 77 ++++++++ vendor/modules.txt | 1 + 10 files changed, 645 insertions(+) create mode 100644 templates/consolePlugin.go create mode 100644 vendor/github.com/openshift/api/console/v1alpha1/0000_10_consoleplugin.crd.yaml create mode 100644 vendor/github.com/openshift/api/console/v1alpha1/doc.go create mode 100644 vendor/github.com/openshift/api/console/v1alpha1/register.go create mode 100644 vendor/github.com/openshift/api/console/v1alpha1/types.go create mode 100644 vendor/github.com/openshift/api/console/v1alpha1/types_console_plugin.go create mode 100644 vendor/github.com/openshift/api/console/v1alpha1/zz_generated.deepcopy.go create mode 100644 vendor/github.com/openshift/api/console/v1alpha1/zz_generated.swagger_doc_generated.go diff --git a/controllers/managedocs_controller.go b/controllers/managedocs_controller.go index 0b86ee3f..5af9db0a 100644 --- a/controllers/managedocs_controller.go +++ b/controllers/managedocs_controller.go @@ -23,6 +23,7 @@ import ( "io/ioutil" "math" "net/url" + "reflect" "strconv" "strings" "time" @@ -50,6 +51,7 @@ import ( "sigs.k8s.io/controller-runtime/pkg/source" "github.com/go-logr/logr" + consolev1alpha1 "github.com/openshift/api/console/v1alpha1" openshiftv1 "github.com/openshift/api/network/v1" promv1 "github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1" promv1a1 "github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1alpha1" @@ -105,6 +107,7 @@ const ( convergedDeploymentType = "converged" consumerDeploymentType = "consumer" providerDeploymentType = "provider" + ocpConsolePluginName = "odf-console" ) // ManagedOCSReconciler reconciles a ManagedOCS object @@ -149,6 +152,7 @@ type ManagedOCSReconciler struct { addonParams map[string]string onboardingValidationKeySecret *corev1.Secret prometheusKubeRBACConfigMap *corev1.ConfigMap + ocpConsolePlugin *consolev1alpha1.ConsolePlugin } // Add necessary rbac permissions for managedocs finalizer in order to set blockOwnerDeletion. @@ -435,6 +439,9 @@ func (r *ManagedOCSReconciler) initReconciler(ctx context.Context, req ctrl.Requ r.prometheusKubeRBACConfigMap.Name = templates.PrometheusKubeRBACPoxyConfigMapName r.prometheusKubeRBACConfigMap.Namespace = r.namespace + r.ocpConsolePlugin = &consolev1alpha1.ConsolePlugin{} + r.ocpConsolePlugin.Name = ocpConsolePluginName + r.ocpConsolePlugin.Namespace = r.namespace } func (r *ManagedOCSReconciler) reconcilePhases() (reconcile.Result, error) { @@ -570,6 +577,9 @@ func (r *ManagedOCSReconciler) reconcilePhases() (reconcile.Result, error) { if err := r.reconcileProviderAPIServerNetworkPolicy(); err != nil { return ctrl.Result{}, err } + if err := r.reconcileConsolePlugin(); err != nil { + return ctrl.Result{}, err + } r.managedOCS.Status.ReconcileStrategy = r.reconcileStrategy @@ -1752,6 +1762,46 @@ func (r *ManagedOCSReconciler) updateMCGCSV(csv *opv1a1.ClusterServiceVersion) e return nil } +func (r *ManagedOCSReconciler) reconcileConsolePlugin() error { + r.Log.Info("Reconciling ConsolePlugin") + if err := r.get(r.ocpConsolePlugin); err != nil && !errors.IsNotFound(err) { + return err + } + if r.ocpConsolePlugin.UID == "" { + // ODF Operator has to bring this CR, + // so if OCP ConsolePlugin is not ready, we ruturn silently + return nil + } + expectedProxy := templates.ConsolePluginProxyTemplate.DeepCopy() + expectedProxy.Service.Name = prometheusServiceName + expectedProxy.Service.Namespace = r.namespace + + var matchingProxy *consolev1alpha1.ConsolePluginProxy + for i := range r.ocpConsolePlugin.Spec.Proxy { + currProxy := &r.ocpConsolePlugin.Spec.Proxy[i] + if currProxy.Service.Name == expectedProxy.Service.Name && + currProxy.Service.Namespace == expectedProxy.Service.Namespace { + // if both, expected and current, are same then return happily + if reflect.DeepEqual(*currProxy, *expectedProxy) { + return nil + } + matchingProxy = currProxy + break + } + } + // if we didn't find any matching ConsolePluginProxy, append the expected proxy + if matchingProxy == nil { + r.ocpConsolePlugin.Spec.Proxy = append(r.ocpConsolePlugin.Spec.Proxy, *expectedProxy) + } else { // else update with the expected proxy + expectedProxy.DeepCopyInto(matchingProxy) + } + // since the proxy array is changed at this point, update the console plugin + if err := r.update(r.ocpConsolePlugin); err != nil { + return fmt.Errorf("could not update OCP ConsolePlugin: %v", err) + } + return nil +} + func (r *ManagedOCSReconciler) removeOLMComponents() error { r.Log.Info("deleting deployer csv") diff --git a/templates/consolePlugin.go b/templates/consolePlugin.go new file mode 100644 index 00000000..3362f7fe --- /dev/null +++ b/templates/consolePlugin.go @@ -0,0 +1,30 @@ +/* +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package templates + +import ( + consolev1alpha1 "github.com/openshift/api/console/v1alpha1" +) + +const ( + ocpConsoleProxyAlias = "consoleproxy" +) + +var ConsolePluginProxyTemplate = consolev1alpha1.ConsolePluginProxy{ + Type: consolev1alpha1.ProxyTypeService, + Authorize: true, + Alias: ocpConsoleProxyAlias, + Service: consolev1alpha1.ConsolePluginProxyServiceConfig{ + Port: int32(KubeRBACProxyPortNumber), + }, +} diff --git a/vendor/github.com/openshift/api/console/v1alpha1/0000_10_consoleplugin.crd.yaml b/vendor/github.com/openshift/api/console/v1alpha1/0000_10_consoleplugin.crd.yaml new file mode 100644 index 00000000..08d5bc13 --- /dev/null +++ b/vendor/github.com/openshift/api/console/v1alpha1/0000_10_consoleplugin.crd.yaml @@ -0,0 +1,132 @@ +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + api-approved.openshift.io: https://github.com/openshift/api/pull/764 + description: Extension for configuring openshift web console plugins. + displayName: ConsolePlugin + include.release.openshift.io/ibm-cloud-managed: "true" + include.release.openshift.io/self-managed-high-availability: "true" + include.release.openshift.io/single-node-developer: "true" + name: consoleplugins.console.openshift.io +spec: + group: console.openshift.io + names: + kind: ConsolePlugin + listKind: ConsolePluginList + plural: consoleplugins + singular: consoleplugin + scope: Cluster + versions: + - name: v1alpha1 + schema: + openAPIV3Schema: + description: "ConsolePlugin is an extension for customizing OpenShift web console by dynamically loading code from another service running on the cluster. \n Compatibility level 4: No compatibility is provided, the API can change at any point for any reason. These capabilities should not be used by applications needing long term support." + type: object + required: + - metadata + - spec + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + type: string + kind: + description: 'Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + metadata: + type: object + spec: + description: ConsolePluginSpec is the desired plugin configuration. + type: object + required: + - service + properties: + displayName: + description: displayName is the display name of the plugin. + type: string + minLength: 1 + proxy: + description: proxy is a list of proxies that describe various service type to which the plugin needs to connect to. + type: array + items: + description: ConsolePluginProxy holds information on various service types to which console's backend will proxy the plugin's requests. + type: object + required: + - alias + - type + properties: + alias: + description: "alias is a proxy name that identifies the plugin's proxy. An alias name should be unique per plugin. The console backend exposes following proxy endpoint: \n /api/proxy///? \n Request example path: \n /api/proxy/acm/search/pods?namespace=openshift-apiserver" + type: string + maxLength: 128 + minLength: 1 + pattern: ^[A-Za-z0-9-_]+$ + authorize: + description: "authorize indicates if the proxied request should contain the logged-in user's OpenShift access token in the \"Authorization\" request header. For example: \n Authorization: Bearer sha256~kV46hPnEYhCWFnB85r5NrprAxggzgb6GOeLbgcKNsH0 \n By default the access token is not part of the proxied request." + type: boolean + default: false + caCertificate: + description: caCertificate provides the cert authority certificate contents, in case the proxied Service is using custom service CA. By default, the service CA bundle provided by the service-ca operator is used. + type: string + pattern: ^-----BEGIN CERTIFICATE-----([\s\S]*)-----END CERTIFICATE-----\s?$ + service: + description: 'service is an in-cluster Service that the plugin will connect to. The Service must use HTTPS. The console backend exposes an endpoint in order to proxy communication between the plugin and the Service. Note: service field is required for now, since currently only "Service" type is supported.' + type: object + required: + - name + - namespace + - port + properties: + name: + description: name of Service that the plugin needs to connect to. + type: string + maxLength: 128 + minLength: 1 + namespace: + description: namespace of Service that the plugin needs to connect to + type: string + maxLength: 128 + minLength: 1 + port: + description: port on which the Service that the plugin needs to connect to is listening on. + type: integer + format: int32 + maximum: 65535 + minimum: 1 + type: + description: type is the type of the console plugin's proxy. Currently only "Service" is supported. + type: string + pattern: ^(Service)$ + service: + description: service is a Kubernetes Service that exposes the plugin using a deployment with an HTTP server. The Service must use HTTPS and Service serving certificate. The console backend will proxy the plugins assets from the Service using the service CA bundle. + type: object + required: + - basePath + - name + - namespace + - port + properties: + basePath: + description: basePath is the path to the plugin's assets. The primary asset it the manifest file called `plugin-manifest.json`, which is a JSON document that contains metadata about the plugin and the extensions. + type: string + default: / + minLength: 1 + pattern: ^/ + name: + description: name of Service that is serving the plugin assets. + type: string + maxLength: 128 + minLength: 1 + namespace: + description: namespace of Service that is serving the plugin assets. + type: string + maxLength: 128 + minLength: 1 + port: + description: port on which the Service that is serving the plugin is listening to. + type: integer + format: int32 + maximum: 65535 + minimum: 1 + served: true + storage: true diff --git a/vendor/github.com/openshift/api/console/v1alpha1/doc.go b/vendor/github.com/openshift/api/console/v1alpha1/doc.go new file mode 100644 index 00000000..67ac59bc --- /dev/null +++ b/vendor/github.com/openshift/api/console/v1alpha1/doc.go @@ -0,0 +1,6 @@ +// +k8s:deepcopy-gen=package,register +// +k8s:defaulter-gen=TypeMeta +// +k8s:openapi-gen=true + +// +groupName=console.openshift.io +package v1alpha1 diff --git a/vendor/github.com/openshift/api/console/v1alpha1/register.go b/vendor/github.com/openshift/api/console/v1alpha1/register.go new file mode 100644 index 00000000..a21f0080 --- /dev/null +++ b/vendor/github.com/openshift/api/console/v1alpha1/register.go @@ -0,0 +1,39 @@ +package v1alpha1 + +import ( + corev1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/runtime/schema" +) + +var ( + GroupName = "console.openshift.io" + GroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1alpha1"} + schemeBuilder = runtime.NewSchemeBuilder(addKnownTypes, corev1.AddToScheme) + // Install is a function which adds this version to a scheme + Install = schemeBuilder.AddToScheme + + // SchemeGroupVersion generated code relies on this name + // Deprecated + SchemeGroupVersion = GroupVersion + // AddToScheme exists solely to keep the old generators creating valid code + // DEPRECATED + AddToScheme = schemeBuilder.AddToScheme +) + +// Resource generated code relies on this being here, but it logically belongs to the group +// DEPRECATED +func Resource(resource string) schema.GroupResource { + return schema.GroupResource{Group: GroupName, Resource: resource} +} + +// addKnownTypes adds types to API group +func addKnownTypes(scheme *runtime.Scheme) error { + scheme.AddKnownTypes(GroupVersion, + &ConsolePlugin{}, + &ConsolePluginList{}, + ) + metav1.AddToGroupVersion(scheme, GroupVersion) + return nil +} diff --git a/vendor/github.com/openshift/api/console/v1alpha1/types.go b/vendor/github.com/openshift/api/console/v1alpha1/types.go new file mode 100644 index 00000000..1c267880 --- /dev/null +++ b/vendor/github.com/openshift/api/console/v1alpha1/types.go @@ -0,0 +1 @@ +package v1alpha1 diff --git a/vendor/github.com/openshift/api/console/v1alpha1/types_console_plugin.go b/vendor/github.com/openshift/api/console/v1alpha1/types_console_plugin.go new file mode 100644 index 00000000..47a1a527 --- /dev/null +++ b/vendor/github.com/openshift/api/console/v1alpha1/types_console_plugin.go @@ -0,0 +1,168 @@ +package v1alpha1 + +import metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + +// +genclient +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +openshift:compatibility-gen:level=4 + +// ConsolePlugin is an extension for customizing OpenShift web console by +// dynamically loading code from another service running on the cluster. +// +// Compatibility level 4: No compatibility is provided, the API can change at any point for any reason. These capabilities should not be used by applications needing long term support. +type ConsolePlugin struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata"` + + // +kubebuilder:validation:Required + // +required + Spec ConsolePluginSpec `json:"spec"` +} + +// ConsolePluginSpec is the desired plugin configuration. +type ConsolePluginSpec struct { + // displayName is the display name of the plugin. + // +kubebuilder:validation:Required + // +kubebuilder:validation:MinLength=1 + // +optional + DisplayName string `json:"displayName,omitempty"` + // service is a Kubernetes Service that exposes the plugin using a + // deployment with an HTTP server. The Service must use HTTPS and + // Service serving certificate. The console backend will proxy the + // plugins assets from the Service using the service CA bundle. + // +kubebuilder:validation:Required + // +required + Service ConsolePluginService `json:"service"` + // proxy is a list of proxies that describe various service type + // to which the plugin needs to connect to. + // +kubebuilder:validation:Optional + // +optional + Proxy []ConsolePluginProxy `json:"proxy,omitempty"` +} + +// ConsolePluginProxy holds information on various service types +// to which console's backend will proxy the plugin's requests. +type ConsolePluginProxy struct { + // type is the type of the console plugin's proxy. Currently only "Service" is supported. + // +kubebuilder:validation:Required + // +required + Type ConsolePluginProxyType `json:"type"` + // alias is a proxy name that identifies the plugin's proxy. An alias name + // should be unique per plugin. The console backend exposes following + // proxy endpoint: + // + // /api/proxy///? + // + // Request example path: + // + // /api/proxy/acm/search/pods?namespace=openshift-apiserver + // + // +kubebuilder:validation:Required + // +kubebuilder:validation:MinLength=1 + // +kubebuilder:validation:MaxLength=128 + // +kubebuilder:validation:Pattern=`^[A-Za-z0-9-_]+$` + // +required + Alias string `json:"alias"` + // service is an in-cluster Service that the plugin will connect to. + // The Service must use HTTPS. The console backend exposes an endpoint + // in order to proxy communication between the plugin and the Service. + // Note: service field is required for now, since currently only "Service" + // type is supported. + // +kubebuilder:validation:Required + // +required + Service ConsolePluginProxyServiceConfig `json:"service,omitempty"` + // caCertificate provides the cert authority certificate contents, + // in case the proxied Service is using custom service CA. + // By default, the service CA bundle provided by the service-ca operator is used. + // +kubebuilder:validation:Pattern=`^-----BEGIN CERTIFICATE-----([\s\S]*)-----END CERTIFICATE-----\s?$` + // +kubebuilder:validation:Optional + // +optional + CACertificate string `json:"caCertificate,omitempty"` + // authorize indicates if the proxied request should contain the logged-in user's + // OpenShift access token in the "Authorization" request header. For example: + // + // Authorization: Bearer sha256~kV46hPnEYhCWFnB85r5NrprAxggzgb6GOeLbgcKNsH0 + // + // By default the access token is not part of the proxied request. + // +kubebuilder:default:=false + // +kubebuilder:validation:Optional + // +optional + Authorize bool `json:"authorize,omitempty"` +} + +// ProxyType is an enumeration of available proxy types +// +kubebuilder:validation:Pattern=`^(Service)$` +type ConsolePluginProxyType string + +const ( + // ProxyTypeService is used when proxying communication to a Service + ProxyTypeService ConsolePluginProxyType = "Service" +) + +// ProxyTypeServiceConfig holds information on Service to which +// console's backend will proxy the plugin's requests. +type ConsolePluginProxyServiceConfig struct { + // name of Service that the plugin needs to connect to. + // +kubebuilder:validation:Required + // +kubebuilder:validation:MinLength=1 + // +kubebuilder:validation:MaxLength=128 + // +required + Name string `json:"name"` + // namespace of Service that the plugin needs to connect to + // +kubebuilder:validation:Required + // +kubebuilder:validation:MinLength=1 + // +kubebuilder:validation:MaxLength=128 + // +required + Namespace string `json:"namespace"` + // port on which the Service that the plugin needs to connect to + // is listening on. + // +kubebuilder:validation:Required + // +kubebuilder:validation:Maximum:=65535 + // +kubebuilder:validation:Minimum:=1 + // +required + Port int32 `json:"port"` +} + +// ConsolePluginService holds information on Service that is serving +// console dynamic plugin assets. +type ConsolePluginService struct { + // name of Service that is serving the plugin assets. + // +kubebuilder:validation:Required + // +kubebuilder:validation:MinLength=1 + // +kubebuilder:validation:MaxLength=128 + // +required + Name string `json:"name"` + // namespace of Service that is serving the plugin assets. + // +kubebuilder:validation:Required + // +kubebuilder:validation:MinLength=1 + // +kubebuilder:validation:MaxLength=128 + // +required + Namespace string `json:"namespace"` + // port on which the Service that is serving the plugin is listening to. + // +kubebuilder:validation:Required + // +kubebuilder:validation:Maximum:=65535 + // +kubebuilder:validation:Minimum:=1 + // +required + Port int32 `json:"port"` + // basePath is the path to the plugin's assets. The primary asset it the + // manifest file called `plugin-manifest.json`, which is a JSON document + // that contains metadata about the plugin and the extensions. + // +kubebuilder:validation:Required + // +kubebuilder:validation:MinLength=1 + // +kubebuilder:validation:Pattern=`^/` + // +kubebuilder:default:="/" + // +required + BasePath string `json:"basePath"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +openshift:compatibility-gen:level=4 + +// Compatibility level 4: No compatibility is provided, the API can change at any point for any reason. These capabilities should not be used by applications needing long term support. +type ConsolePluginList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata"` + + Items []ConsolePlugin `json:"items"` +} diff --git a/vendor/github.com/openshift/api/console/v1alpha1/zz_generated.deepcopy.go b/vendor/github.com/openshift/api/console/v1alpha1/zz_generated.deepcopy.go new file mode 100644 index 00000000..87b68c6b --- /dev/null +++ b/vendor/github.com/openshift/api/console/v1alpha1/zz_generated.deepcopy.go @@ -0,0 +1,141 @@ +//go:build !ignore_autogenerated +// +build !ignore_autogenerated + +// Code generated by deepcopy-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + runtime "k8s.io/apimachinery/pkg/runtime" +) + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ConsolePlugin) DeepCopyInto(out *ConsolePlugin) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ConsolePlugin. +func (in *ConsolePlugin) DeepCopy() *ConsolePlugin { + if in == nil { + return nil + } + out := new(ConsolePlugin) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ConsolePlugin) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ConsolePluginList) DeepCopyInto(out *ConsolePluginList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]ConsolePlugin, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ConsolePluginList. +func (in *ConsolePluginList) DeepCopy() *ConsolePluginList { + if in == nil { + return nil + } + out := new(ConsolePluginList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ConsolePluginList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ConsolePluginProxy) DeepCopyInto(out *ConsolePluginProxy) { + *out = *in + out.Service = in.Service + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ConsolePluginProxy. +func (in *ConsolePluginProxy) DeepCopy() *ConsolePluginProxy { + if in == nil { + return nil + } + out := new(ConsolePluginProxy) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ConsolePluginProxyServiceConfig) DeepCopyInto(out *ConsolePluginProxyServiceConfig) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ConsolePluginProxyServiceConfig. +func (in *ConsolePluginProxyServiceConfig) DeepCopy() *ConsolePluginProxyServiceConfig { + if in == nil { + return nil + } + out := new(ConsolePluginProxyServiceConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ConsolePluginService) DeepCopyInto(out *ConsolePluginService) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ConsolePluginService. +func (in *ConsolePluginService) DeepCopy() *ConsolePluginService { + if in == nil { + return nil + } + out := new(ConsolePluginService) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ConsolePluginSpec) DeepCopyInto(out *ConsolePluginSpec) { + *out = *in + out.Service = in.Service + if in.Proxy != nil { + in, out := &in.Proxy, &out.Proxy + *out = make([]ConsolePluginProxy, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ConsolePluginSpec. +func (in *ConsolePluginSpec) DeepCopy() *ConsolePluginSpec { + if in == nil { + return nil + } + out := new(ConsolePluginSpec) + in.DeepCopyInto(out) + return out +} diff --git a/vendor/github.com/openshift/api/console/v1alpha1/zz_generated.swagger_doc_generated.go b/vendor/github.com/openshift/api/console/v1alpha1/zz_generated.swagger_doc_generated.go new file mode 100644 index 00000000..eb877077 --- /dev/null +++ b/vendor/github.com/openshift/api/console/v1alpha1/zz_generated.swagger_doc_generated.go @@ -0,0 +1,77 @@ +package v1alpha1 + +// This file contains a collection of methods that can be used from go-restful to +// generate Swagger API documentation for its models. Please read this PR for more +// information on the implementation: https://github.com/emicklei/go-restful/pull/215 +// +// TODOs are ignored from the parser (e.g. TODO(andronat):... || TODO:...) if and only if +// they are on one line! For multiple line or blocks that you want to ignore use ---. +// Any context after a --- is ignored. +// +// Those methods can be generated by using hack/update-swagger-docs.sh + +// AUTO-GENERATED FUNCTIONS START HERE +var map_ConsolePlugin = map[string]string{ + "": "ConsolePlugin is an extension for customizing OpenShift web console by dynamically loading code from another service running on the cluster.\n\nCompatibility level 4: No compatibility is provided, the API can change at any point for any reason. These capabilities should not be used by applications needing long term support.", +} + +func (ConsolePlugin) SwaggerDoc() map[string]string { + return map_ConsolePlugin +} + +var map_ConsolePluginList = map[string]string{ + "": "Compatibility level 4: No compatibility is provided, the API can change at any point for any reason. These capabilities should not be used by applications needing long term support.", +} + +func (ConsolePluginList) SwaggerDoc() map[string]string { + return map_ConsolePluginList +} + +var map_ConsolePluginProxy = map[string]string{ + "": "ConsolePluginProxy holds information on various service types to which console's backend will proxy the plugin's requests.", + "type": "type is the type of the console plugin's proxy. Currently only \"Service\" is supported.", + "alias": "alias is a proxy name that identifies the plugin's proxy. An alias name should be unique per plugin. The console backend exposes following proxy endpoint:\n\n/api/proxy///?\n\nRequest example path:\n\n/api/proxy/acm/search/pods?namespace=openshift-apiserver", + "service": "service is an in-cluster Service that the plugin will connect to. The Service must use HTTPS. The console backend exposes an endpoint in order to proxy communication between the plugin and the Service. Note: service field is required for now, since currently only \"Service\" type is supported.", + "caCertificate": "caCertificate provides the cert authority certificate contents, in case the proxied Service is using custom service CA. By default, the service CA bundle provided by the service-ca operator is used. ", + "authorize": "authorize indicates if the proxied request should contain the logged-in user's OpenShift access token in the \"Authorization\" request header. For example:\n\nAuthorization: Bearer sha256~kV46hPnEYhCWFnB85r5NrprAxggzgb6GOeLbgcKNsH0\n\nBy default the access token is not part of the proxied request.", +} + +func (ConsolePluginProxy) SwaggerDoc() map[string]string { + return map_ConsolePluginProxy +} + +var map_ConsolePluginProxyServiceConfig = map[string]string{ + "": "ProxyTypeServiceConfig holds information on Service to which console's backend will proxy the plugin's requests.", + "name": "name of Service that the plugin needs to connect to.", + "namespace": "namespace of Service that the plugin needs to connect to", + "port": "port on which the Service that the plugin needs to connect to is listening on.", +} + +func (ConsolePluginProxyServiceConfig) SwaggerDoc() map[string]string { + return map_ConsolePluginProxyServiceConfig +} + +var map_ConsolePluginService = map[string]string{ + "": "ConsolePluginService holds information on Service that is serving console dynamic plugin assets.", + "name": "name of Service that is serving the plugin assets.", + "namespace": "namespace of Service that is serving the plugin assets.", + "port": "port on which the Service that is serving the plugin is listening to.", + "basePath": "basePath is the path to the plugin's assets. The primary asset it the manifest file called `plugin-manifest.json`, which is a JSON document that contains metadata about the plugin and the extensions.", +} + +func (ConsolePluginService) SwaggerDoc() map[string]string { + return map_ConsolePluginService +} + +var map_ConsolePluginSpec = map[string]string{ + "": "ConsolePluginSpec is the desired plugin configuration.", + "displayName": "displayName is the display name of the plugin.", + "service": "service is a Kubernetes Service that exposes the plugin using a deployment with an HTTP server. The Service must use HTTPS and Service serving certificate. The console backend will proxy the plugins assets from the Service using the service CA bundle.", + "proxy": "proxy is a list of proxies that describe various service type to which the plugin needs to connect to.", +} + +func (ConsolePluginSpec) SwaggerDoc() map[string]string { + return map_ConsolePluginSpec +} + +// AUTO-GENERATED FUNCTIONS END HERE diff --git a/vendor/modules.txt b/vendor/modules.txt index 2d359cef..229dd3bd 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -168,6 +168,7 @@ github.com/onsi/gomega/matchers/support/goraph/util github.com/onsi/gomega/types # github.com/openshift/api v3.9.1-0.20190924102528-32369d4db2ad+incompatible => github.com/openshift/api v0.0.0-20220112144624-6db10b227818 ## explicit +github.com/openshift/api/console/v1alpha1 github.com/openshift/api/network/v1 github.com/openshift/api/quota/v1 github.com/openshift/api/security/v1