From bb4323d3ccb86cda92ce7978e1f54e11d82a006d Mon Sep 17 00:00:00 2001 From: Ondrej Pokorny Date: Mon, 17 Mar 2025 08:59:20 +0100 Subject: [PATCH 1/3] feat: introduce v1alpha2 for Insights DataGather This commit introduces the v1alpha2 version of the DataGather CRD for Insights. Signed-off-by: Ondrej Pokorny --- insights/install.go | 3 +- insights/v1alpha2/Makefile | 3 + insights/v1alpha2/doc.go | 8 + insights/v1alpha2/register.go | 38 ++ .../InsightsOnDemandDataGather.yaml | 529 ++++++++++++++++ insights/v1alpha2/types_insights.go | 353 +++++++++++ ...ts_01_datagathers-CustomNoUpgrade.crd.yaml | 529 ++++++++++++++++ ...1_datagathers-DevPreviewNoUpgrade.crd.yaml | 529 ++++++++++++++++ ..._datagathers-TechPreviewNoUpgrade.crd.yaml | 529 ++++++++++++++++ .../zz_generated.crd-manifests/doc.go | 1 + insights/v1alpha2/zz_generated.deepcopy.go | 284 +++++++++ ..._generated.featuregated-crd-manifests.yaml | 35 ++ .../InsightsOnDemandDataGather.yaml | 529 ++++++++++++++++ .../zz_generated.swagger_doc_generated.go | 147 +++++ .../generated_openapi/zz_generated.openapi.go | 569 ++++++++++++++++++ openapi/openapi.json | 329 ++++++++++ 16 files changed, 4414 insertions(+), 1 deletion(-) create mode 100644 insights/v1alpha2/Makefile create mode 100644 insights/v1alpha2/doc.go create mode 100644 insights/v1alpha2/register.go create mode 100644 insights/v1alpha2/tests/datagathers.insights.openshift.io/InsightsOnDemandDataGather.yaml create mode 100644 insights/v1alpha2/types_insights.go create mode 100644 insights/v1alpha2/zz_generated.crd-manifests/0000_10_insights_01_datagathers-CustomNoUpgrade.crd.yaml create mode 100644 insights/v1alpha2/zz_generated.crd-manifests/0000_10_insights_01_datagathers-DevPreviewNoUpgrade.crd.yaml create mode 100644 insights/v1alpha2/zz_generated.crd-manifests/0000_10_insights_01_datagathers-TechPreviewNoUpgrade.crd.yaml create mode 100644 insights/v1alpha2/zz_generated.crd-manifests/doc.go create mode 100644 insights/v1alpha2/zz_generated.deepcopy.go create mode 100644 insights/v1alpha2/zz_generated.featuregated-crd-manifests.yaml create mode 100644 insights/v1alpha2/zz_generated.featuregated-crd-manifests/datagathers.insights.openshift.io/InsightsOnDemandDataGather.yaml create mode 100644 insights/v1alpha2/zz_generated.swagger_doc_generated.go diff --git a/insights/install.go b/insights/install.go index 39286c7331b..62f3d0997aa 100644 --- a/insights/install.go +++ b/insights/install.go @@ -5,6 +5,7 @@ import ( "k8s.io/apimachinery/pkg/runtime/schema" insightsv1alpha1 "github.com/openshift/api/insights/v1alpha1" + insightsv1alpha2 "github.com/openshift/api/insights/v1alpha2" ) const ( @@ -12,7 +13,7 @@ const ( ) var ( - schemeBuilder = runtime.NewSchemeBuilder(insightsv1alpha1.Install) + schemeBuilder = runtime.NewSchemeBuilder(insightsv1alpha1.Install, insightsv1alpha2.Install) // Install is a function which adds every version of this group to a scheme Install = schemeBuilder.AddToScheme ) diff --git a/insights/v1alpha2/Makefile b/insights/v1alpha2/Makefile new file mode 100644 index 00000000000..6907cf13901 --- /dev/null +++ b/insights/v1alpha2/Makefile @@ -0,0 +1,3 @@ +.PHONY: test +test: + make -C ../../tests test GINKGO_EXTRA_ARGS=--focus="insights.openshift.io/v1alpha2" \ No newline at end of file diff --git a/insights/v1alpha2/doc.go b/insights/v1alpha2/doc.go new file mode 100644 index 00000000000..dda76abcc8a --- /dev/null +++ b/insights/v1alpha2/doc.go @@ -0,0 +1,8 @@ +// +k8s:deepcopy-gen=package,register +// +k8s:defaulter-gen=TypeMeta +// +k8s:openapi-gen=true + +// +kubebuilder:validation:Optional +// +groupName=insights.openshift.io +// Package v1alpha2 is the v1alpha2 version of the API. +package v1alpha2 diff --git a/insights/v1alpha2/register.go b/insights/v1alpha2/register.go new file mode 100644 index 00000000000..366b95e6ce8 --- /dev/null +++ b/insights/v1alpha2/register.go @@ -0,0 +1,38 @@ +package v1alpha2 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/runtime/schema" +) + +var ( + GroupName = "insights.openshift.io" + GroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1alpha2"} + schemeBuilder = runtime.NewSchemeBuilder(addKnownTypes) + // 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} +} + +// Adds the list of known types to api.Scheme. +func addKnownTypes(scheme *runtime.Scheme) error { + scheme.AddKnownTypes(GroupVersion, + &DataGather{}, + &DataGatherList{}, + ) + metav1.AddToGroupVersion(scheme, GroupVersion) + return nil +} diff --git a/insights/v1alpha2/tests/datagathers.insights.openshift.io/InsightsOnDemandDataGather.yaml b/insights/v1alpha2/tests/datagathers.insights.openshift.io/InsightsOnDemandDataGather.yaml new file mode 100644 index 00000000000..47760d64f32 --- /dev/null +++ b/insights/v1alpha2/tests/datagathers.insights.openshift.io/InsightsOnDemandDataGather.yaml @@ -0,0 +1,529 @@ +apiVersion: apiextensions.k8s.io/v1 # Hack because controller-gen complains if we don't have this +name: "[TechPreview] DataGather" +crdName: datagathers.insights.openshift.io +featureGates: + - InsightsOnDemandDataGather +tests: + onCreate: + - name: Should be able to create a minimal DataGather + initial: | + apiVersion: insights.openshift.io/v1alpha1 + kind: DataGather + spec: {} # No spec is required for a DataGather + expected: | + apiVersion: insights.openshift.io/v1alpha1 + kind: DataGather + spec: {} + - name: Should be able to create a DataGather with a storage persistentVolume + initial: | + apiVersion: insights.openshift.io/v1alpha1 + kind: DataGather + spec: + storage: + type: PersistentVolume + persistentVolume: + mountPath: /data + claim: + name: test-claim + expected: | + apiVersion: insights.openshift.io/v1alpha1 + kind: DataGather + spec: + storage: + type: PersistentVolume + persistentVolume: + mountPath: /data + claim: + name: test-claim + - name: Should be able to create a DataGather with a storage Epemeral + initial: | + apiVersion: insights.openshift.io/v1alpha1 + kind: DataGather + spec: + storage: + type: Ephemeral + expected: | + apiVersion: insights.openshift.io/v1alpha1 + kind: DataGather + spec: + storage: + type: Ephemeral + - name: When storage.type is persistentVolume then PersistentVolume must be present + initial: | + apiVersion: insights.openshift.io/v1alpha1 + kind: DataGather + spec: + storage: + type: PersistentVolume + expectedError: 'spec.storage: Invalid value: "object": persistentVolume is required when type is PersistentVolume, and forbidden otherwise' + - name: When storage.type is not persistentVolume then PersistentVolume must not be present + initial: | + apiVersion: insights.openshift.io/v1alpha1 + kind: DataGather + spec: + storage: + type: Ephemeral + persistentVolume: + claim: + name: test-claim + expectedError: 'spec.storage: Invalid value: "object": persistentVolume is required when type is PersistentVolume, and forbidden otherwise' + - name: mountPath must not contain colon + initial: | + apiVersion: insights.openshift.io/v1alpha1 + kind: DataGather + spec: + storage: + type: PersistentVolume + persistentVolume: + mountPath: /data:/data + claim: + name: test-claim + expectedError: 'spec.storage.persistentVolume.mountPath: Invalid value: "string": mountPath must not contain a colon' + - name: storage.type is required + initial: | + apiVersion: insights.openshift.io/v1alpha1 + kind: DataGather + spec: + storage: + persistentVolume: + mountPath: /data + claim: + name: test-claim + expectedError: "spec.storage.type: Required value" + - name: storage.persistentVolume.claim can not be empty + initial: | + apiVersion: insights.openshift.io/v1alpha1 + kind: DataGather + spec: + storage: + type: PersistentVolume + persistentVolume: + mountPath: /data + claim: + expectedError: "spec.storage.persistentVolume.claim: Required value" + - name: persistentVolumeClaim must follow the naming convention + initial: | + apiVersion: insights.openshift.io/v1alpha1 + kind: DataGather + spec: + storage: + type: PersistentVolume + persistentVolume: + claim: + name: INVALID_PVC_NAME + expectedError: 'Invalid value: "string": a lowercase RFC 1123 subdomain must consist of lower case alphanumeric characters, ''-'' or ''.'', and must start and end with an alphanumeric character.' + onUpdate: + - name: status is present and startTime is added + initial: | + apiVersion: insights.openshift.io/v1alpha1 + kind: DataGather + spec: {} # No spec is required for a DataGather + status: + insightsRequestID: xyz + updated: | + apiVersion: insights.openshift.io/v1alpha1 + kind: DataGather + spec: {} # No spec is required for a DataGather + status: + insightsRequestID: xyz + startTime: 2023-03-13T11:34:06Z + expected: | + apiVersion: insights.openshift.io/v1alpha1 + kind: DataGather + spec: {} # No spec is required for a DataGather + status: + insightsRequestID: xyz + startTime: 2023-03-13T11:34:06Z + - name: startTime cannot be removed from status + initial: | + apiVersion: insights.openshift.io/v1alpha1 + kind: DataGather + spec: {} # No spec is required for a DataGather + status: + insightsRequestID: xyz + startTime: 2023-03-13T11:34:06Z + updated: | + apiVersion: insights.openshift.io/v1alpha1 + kind: DataGather + spec: {} # No spec is required for a DataGather + status: + insightsRequestID: xyz + expectedStatusError: 'status: Invalid value: "object": cannot remove startTime attribute from status' + - name: startTime is immutable once set + initial: | + apiVersion: insights.openshift.io/v1alpha1 + kind: DataGather + spec: {} # No spec is required for a DataGather + status: + insightsRequestID: xyz + startTime: 2023-03-13T11:34:06Z + updated: | + apiVersion: insights.openshift.io/v1alpha1 + kind: DataGather + spec: {} # No spec is required for a DataGather + status: + insightsRequestID: xyz + startTime: 2023-03-13T12:34:06Z + expectedStatusError: 'Invalid value: "string": startTime is immutable once set' + - name: Status is present and insightsRequestID is added + initial: | + apiVersion: insights.openshift.io/v1alpha1 + kind: DataGather + spec: {} # No spec is required for a DataGather + status: + relatedObjects: + - name: periodic-job-xyz + resource: "pods" + group: "" + namespace: "openshift-insights" + updated: | + apiVersion: insights.openshift.io/v1alpha1 + kind: DataGather + spec: {} # No spec is required for a DataGather + status: + insightsRequestID: testing-xyz + relatedObjects: + - name: periodic-job-xyz + resource: "pods" + group: "" + namespace: "openshift-insights" + expected: | + apiVersion: insights.openshift.io/v1alpha1 + kind: DataGather + spec: {} # No spec is required for a DataGather + status: + insightsRequestID: testing-xyz + relatedObjects: + - name: periodic-job-xyz + group: "" + resource: "pods" + namespace: "openshift-insights" + - name: insightsRequestID cannot be removed from status + initial: | + apiVersion: insights.openshift.io/v1alpha1 + kind: DataGather + spec: {} # No spec is required for a DataGather + status: + insightsRequestID: testing-xyz + relatedObjects: + - name: periodic-job-xyz + group: "" + resource: "pods" + namespace: "openshift-insights" + updated: | + apiVersion: insights.openshift.io/v1alpha1 + kind: DataGather + spec: {} # No spec is required for a DataGather + status: + relatedObjects: + - name: periodic-job-xyz + group: "" + resource: "pods" + namespace: "openshift-insights" + expectedStatusError: 'status: Invalid value: "object": cannot remove insightsRequestID attribute from status' + - name: insightsRequestID is immutable once set + initial: | + apiVersion: insights.openshift.io/v1alpha1 + kind: DataGather + spec: {} # No spec is required for a DataGather + status: + insightsRequestID: testing-xyz + relatedObjects: + - name: periodic-job-xyz + group: "" + resource: "pods" + namespace: "openshift-insights" + updated: | + apiVersion: insights.openshift.io/v1alpha1 + kind: DataGather + spec: {} # No spec is required for a DataGather + status: + insightsRequestID: testing-xyz-updated + relatedObjects: + - name: periodic-job-xyz + group: "" + resource: "pods" + namespace: "openshift-insights" + expectedStatusError: 'Invalid value: "string": insightsRequestID is immutable once set' + - name: finishTime cannot be removed from status + initial: | + apiVersion: insights.openshift.io/v1alpha1 + kind: DataGather + spec: {} # No spec is required for a DataGather + status: + finishTime: 2023-03-13T11:34:06Z + relatedObjects: + - name: periodic-job-xyz + group: "" + resource: "pods" + namespace: "openshift-insights" + updated: | + apiVersion: insights.openshift.io/v1alpha1 + kind: DataGather + spec: {} # No spec is required for a DataGather + status: + relatedObjects: + - name: periodic-job-xyz + group: "" + resource: "pods" + namespace: "openshift-insights" + expectedStatusError: 'status: Invalid value: "object": cannot remove finishTime attribute from status' + - name: dataGatherState cannot be removed from status + initial: | + apiVersion: insights.openshift.io/v1alpha1 + kind: DataGather + spec: {} # No spec is required for a DataGather + status: + dataGatherState: Running + updated: | + apiVersion: insights.openshift.io/v1alpha1 + kind: DataGather + spec: {} # No spec is required for a DataGather + status: + relatedObjects: + - name: periodic-job-xyz + group: "" + resource: "pods" + namespace: "openshift-insights" + expectedStatusError: 'status: Invalid value: "object": cannot remove dataGatherState attribute from status' + - name: dataGatherState cannot transition from Running to Pending + initial: | + apiVersion: insights.openshift.io/v1alpha1 + kind: DataGather + spec: {} # No spec is required for a DataGather + status: + dataGatherState: Running + updated: | + apiVersion: insights.openshift.io/v1alpha1 + kind: DataGather + spec: {} # No spec is required for a DataGather + status: + dataGatherState: Pending + expectedStatusError: 'status.dataGatherState: Invalid value: "string": dataGatherState cannot transition from Running to Pending' + - name: dataGatherState cannot transition from Completed to Pending + initial: | + apiVersion: insights.openshift.io/v1alpha1 + kind: DataGather + spec: {} # No spec is required for a DataGather + status: + dataGatherState: Completed + updated: | + apiVersion: insights.openshift.io/v1alpha1 + kind: DataGather + spec: {} # No spec is required for a DataGather + status: + dataGatherState: Pending + expectedStatusError: 'status.dataGatherState: Invalid value: "string": dataGatherState cannot transition from Completed to Pending' + - name: dataGatherState cannot transition from Failed to Pending + initial: | + apiVersion: insights.openshift.io/v1alpha1 + kind: DataGather + spec: {} # No spec is required for a DataGather + status: + dataGatherState: Failed + updated: | + apiVersion: insights.openshift.io/v1alpha1 + kind: DataGather + spec: {} # No spec is required for a DataGather + status: + dataGatherState: Pending + expectedStatusError: 'status.dataGatherState: Invalid value: "string": dataGatherState cannot transition from Failed to Pending' + - name: dataGatherState cannot transition from Completed to Running + initial: | + apiVersion: insights.openshift.io/v1alpha1 + kind: DataGather + spec: {} # No spec is required for a DataGather + status: + dataGatherState: Completed + updated: | + apiVersion: insights.openshift.io/v1alpha1 + kind: DataGather + spec: {} # No spec is required for a DataGather + status: + dataGatherState: Running + expectedStatusError: 'status.dataGatherState: Invalid value: "string": dataGatherState cannot transition from Completed to Running' + - name: dataGatherState cannot transition from Failed to Running + initial: | + apiVersion: insights.openshift.io/v1alpha1 + kind: DataGather + spec: {} # No spec is required for a DataGather + status: + dataGatherState: Failed + updated: | + apiVersion: insights.openshift.io/v1alpha1 + kind: DataGather + spec: {} # No spec is required for a DataGather + status: + dataGatherState: Running + expectedStatusError: 'status.dataGatherState: Invalid value: "string": dataGatherState cannot transition from Failed to Running' + - name: lastGatherDuration can be updated with a trailing zero value + initial: | + apiVersion: insights.openshift.io/v1alpha1 + kind: DataGather + spec: {} # No spec is required for a DataGather + updated: | + apiVersion: insights.openshift.io/v1alpha1 + kind: DataGather + spec: {} # No spec is required for a DataGather + status: + gatherers: + - name: testGatherer + lastGatherDuration: 1m0s + conditions: + - type: Gathered + status: "True" + reason: OK + message: "test message" + lastTransitionTime: "2024-12-01T08:04:21Z" + expected: | + apiVersion: insights.openshift.io/v1alpha1 + kind: DataGather + spec: {} # No spec is required for a DataGather + status: + gatherers: + - name: testGatherer + lastGatherDuration: 1m0s + conditions: + - type: Gathered + status: "True" + reason: OK + message: "test message" + lastTransitionTime: "2024-12-01T08:04:21Z" + - name: lastGatherDuration can be updated with a leading zero value + initial: | + apiVersion: insights.openshift.io/v1alpha1 + kind: DataGather + spec: {} # No spec is required for a DataGather + updated: | + apiVersion: insights.openshift.io/v1alpha1 + kind: DataGather + spec: {} # No spec is required for a DataGather + status: + gatherers: + - name: testGatherer + lastGatherDuration: 0m11s + conditions: + - type: Gathered + status: "True" + reason: OK + message: "test message" + lastTransitionTime: "2024-12-01T08:04:21Z" + expected: | + apiVersion: insights.openshift.io/v1alpha1 + kind: DataGather + spec: {} # No spec is required for a DataGather + status: + gatherers: + - name: testGatherer + lastGatherDuration: 0m11s + conditions: + - type: Gathered + status: "True" + reason: OK + message: "test message" + lastTransitionTime: "2024-12-01T08:04:21Z" + - name: lastGatherDuration can be updated with a decimal number value + initial: | + apiVersion: insights.openshift.io/v1alpha1 + kind: DataGather + spec: {} # No spec is required for a DataGather + updated: | + apiVersion: insights.openshift.io/v1alpha1 + kind: DataGather + spec: {} # No spec is required for a DataGather + status: + gatherers: + - name: testGatherer + lastGatherDuration: 1m0.77s + conditions: + - type: Gathered + status: "True" + reason: OK + message: "test message" + lastTransitionTime: "2024-12-01T08:04:21Z" + expected: | + apiVersion: insights.openshift.io/v1alpha1 + kind: DataGather + spec: {} # No spec is required for a DataGather + status: + gatherers: + - name: testGatherer + lastGatherDuration: 1m0.77s + conditions: + - type: Gathered + status: "True" + reason: OK + message: "test message" + lastTransitionTime: "2024-12-01T08:04:21Z" + - name: lastGatherDuration cannot be updated with an invalid value + initial: | + apiVersion: insights.openshift.io/v1alpha1 + kind: DataGather + spec: {} # No spec is required for a DataGather + updated: | + apiVersion: insights.openshift.io/v1alpha1 + kind: DataGather + spec: {} # No spec is required for a DataGather + status: + gatherers: + - name: testGatherer + lastGatherDuration: 1d2h + conditions: + - type: Gathered + status: "True" + reason: OK + message: "test message" + lastTransitionTime: "2024-12-01T08:04:21Z" + expectedStatusError: "Invalid value: \"1d2h\": gatherers[0].lastGatherDuration in body should match '^(([0-9]+(?:\\.[0-9]+)?(ns|us|µs|μs|ms|s|m|h))+)$'" + - name: lastGatherDuration cannot be updated with a negative value + initial: | + apiVersion: insights.openshift.io/v1alpha1 + kind: DataGather + spec: {} # No spec is required for a DataGather + updated: | + apiVersion: insights.openshift.io/v1alpha1 + kind: DataGather + spec: {} # No spec is required for a DataGather + status: + gatherers: + - name: testGatherer + lastGatherDuration: -0m5s + conditions: + - type: Gathered + status: "True" + reason: OK + message: "test message" + lastTransitionTime: "2024-12-01T08:04:21Z" + expectedStatusError: "Invalid value: \"-0m5s\": gatherers[0].lastGatherDuration in body should match '^(([0-9]+(?:\\.[0-9]+)?(ns|us|µs|μs|ms|s|m|h))+)$'" + - name: should not be updated with URL that is not HTTPS + initial: | + apiVersion: insights.openshift.io/v1alpha1 + kind: DataGather + spec: {} # No spec is required for a DataGather + updated: | + apiVersion: insights.openshift.io/v1alpha1 + kind: DataGather + spec: {} # No spec is required for a DataGather + status: + insightsReport: + uri: http://example.com + expectedStatusError: 'status.insightsReport.uri: Invalid value: "string": URI must be a valid HTTPS URL (e.g., https://example.com)' + - name: should be updated with a valid HTTPS URL + initial: | + apiVersion: insights.openshift.io/v1alpha1 + kind: DataGather + spec: {} # No spec is required for a DataGather + updated: | + apiVersion: insights.openshift.io/v1alpha1 + kind: DataGather + spec: {} # No spec is required for a DataGather + status: + insightsReport: + uri: https://example.com + expected: | + apiVersion: insights.openshift.io/v1alpha1 + kind: DataGather + spec: {} # No spec is required for a DataGather + status: + insightsReport: + uri: https://example.com diff --git a/insights/v1alpha2/types_insights.go b/insights/v1alpha2/types_insights.go new file mode 100644 index 00000000000..537c73442bc --- /dev/null +++ b/insights/v1alpha2/types_insights.go @@ -0,0 +1,353 @@ +package v1alpha2 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// +genclient +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +kubebuilder:object:root=true +// +kubebuilder:resource:path=datagathers,scope=Cluster +// +kubebuilder:subresource:status +// +openshift:api-approved.openshift.io=https://github.com/openshift/api/pull/1365 +// +openshift:file-pattern=cvoRunLevel=0000_10,operatorName=insights,operatorOrdering=01 +// +openshift:enable:FeatureGate=InsightsOnDemandDataGather +// +kubebuilder:printcolumn:name=State,type=string,JSONPath=.status.dataGatherState,description=DataGather job state +// +kubebuilder:printcolumn:name=StartTime,type=date,JSONPath=.status.startTime,description=DataGather start time +// +kubebuilder:printcolumn:name=FinishTime,type=date,JSONPath=.status.finishTime,description=DataGather finish time +// +// DataGather provides data gather configuration options and status for the particular Insights data gathering. +// +// 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. +// +openshift:compatibility-gen:level=4 +type DataGather struct { + metav1.TypeMeta `json:",inline"` + // metadata is the standard object's metadata. + // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + // +optional + metav1.ObjectMeta `json:"metadata,omitempty"` + // spec holds user settable values for configuration + // +required + Spec DataGatherSpec `json:"spec"` + // status holds observed values from the cluster. They may not be overridden. + // +optional + Status DataGatherStatus `json:"status"` +} + +// DataGatherSpec contains the configuration for the DataGather. +type DataGatherSpec struct { + // dataPolicy allows user to enable additional global obfuscation of the IP addresses and base domain + // in the Insights archive data. Valid values are "ClearText" and "ObfuscateNetworking". + // When set to ClearText the data is not obfuscated. + // When set to ObfuscateNetworking the IP addresses and the cluster domain name are obfuscated. + // When omitted, this means no opinion and the platform is left to choose a reasonable default, which is subject to change over time. + // The current default is ClearText. + // +optional + DataPolicy DataPolicy `json:"dataPolicy"` + // gatherers is an optional list of gatherers configurations. + // The list must not exceed 100 items. + // The particular gatherers IDs can be found at https://github.com/openshift/insights-operator/blob/master/docs/gathered-data.md. + // Run the following command to get the names of last active gatherers: + // "oc get insightsoperators.operator.openshift.io cluster -o json | jq '.status.gatherStatus.gatherers[].name'" + // +kubebuilder:validation:MaxItems=100 + // +optional + Gatherers []GathererConfig `json:"gatherers,omitempty"` + // storage is an optional field that allows user to define persistent storage for gathering jobs to store the Insights data archive. + // If omitted, the gathering job will use ephemeral storage. + // +optional + Storage *Storage `json:"storage,omitempty"` +} + +// storage provides persistent storage configuration options for gathering jobs. +// If the type is set to PersistentVolume, then the PersistentVolume must be defined. +// If the type is set to Ephemeral, then the PersistentVolume must not be defined. +// +kubebuilder:validation:XValidation:rule="has(self.type) && self.type == 'PersistentVolume' ? has(self.persistentVolume) : !has(self.persistentVolume)",message="persistentVolume is required when type is PersistentVolume, and forbidden otherwise" +type Storage struct { + // type is a required field that specifies the type of storage that will be used to store the Insights data archive. + // Valid values are "PersistentVolume" and "Ephemeral". + // When set to Ephemeral, the Insights data archive is stored in the ephemeral storage of the gathering job. + // When set to PersistentVolume, the Insights data archive is stored in the PersistentVolume that is + // defined by the PersistentVolume field. + // +required + Type StorageType `json:"type"` + // persistentVolume is an optional field that specifies the PersistentVolume that will be used to store the Insights data archive. + // The PersistentVolume must be created in the openshift-insights namespace. + // +optional + PersistentVolume *PersistentVolumeConfig `json:"persistentVolume,omitempty"` +} + +// storageType declares valid storage types +// +kubebuilder:validation:Enum=PersistentVolume;Ephemeral +type StorageType string + +const ( + // StorageTypePersistentVolume storage type + StorageTypePersistentVolume StorageType = "PersistentVolume" + // StorageTypeEphemeral storage type + StorageTypeEphemeral StorageType = "Ephemeral" +) + +// persistentVolumeConfig provides configuration options for PersistentVolume storage. +type PersistentVolumeConfig struct { + // claim is a required field that specifies the configuration of the PersistentVolumeClaim that will be used to store the Insights data archive. + // The PersistentVolumeClaim must be created in the openshift-insights namespace. + // +required + Claim PersistentVolumeClaimReference `json:"claim"` + // mountPath is an optional field specifying the directory where the PVC will be mounted inside the Insights data gathering Pod. + // When omitted, this means no opinion and the platform is left to choose a reasonable default, which is subject to change over time. + // The current default mount path is /var/lib/insights-operator + // The path may not exceed 1024 characters and must not contain a colon. + // +kubebuilder:validation:MaxLength=1024 + // +kubebuilder:validation:XValidation:rule="!self.contains(':')",message="mountPath must not contain a colon" + // +optional + MountPath string `json:"mountPath,omitempty"` +} + +// persistentVolumeClaimReference is a reference to a PersistentVolumeClaim. +type PersistentVolumeClaimReference struct { + // name is a string that follows the DNS1123 subdomain format. + // It must be at most 253 characters in length, and must consist only of lower case alphanumeric characters, '-' and '.', and must start and end with an alphanumeric character. + // +kubebuilder:validation:XValidation:rule="!format.dns1123Subdomain().validate(self).hasValue()",message="a lowercase RFC 1123 subdomain must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character." + // +kubebuilder:validation:MaxLength:=253 + // +required + Name string `json:"name"` +} + +const ( + // No data obfuscation + NoPolicy DataPolicy = "ClearText" + // IP addresses and cluster domain name are obfuscated + ObfuscateNetworking DataPolicy = "ObfuscateNetworking" + // Data gathering is running + Running DataGatherState = "Running" + // Data gathering is completed + Completed DataGatherState = "Completed" + // Data gathering failed + Failed DataGatherState = "Failed" + // Data gathering is pending + Pending DataGatherState = "Pending" + // Gatherer state marked as disabled, which means that the gatherer will not run. + Disabled GathererState = "Disabled" + // Gatherer state marked as enabled, which means that the gatherer will run. + Enabled GathererState = "Enabled" +) + +// dataPolicy declares valid data policy types +// +kubebuilder:validation:Enum="";ClearText;ObfuscateNetworking +type DataPolicy string + +// state declares valid gatherer state types. +// +kubebuilder:validation:Enum="";Enabled;Disabled +type GathererState string + +// gathererConfig allows to configure specific gatherers +type GathererConfig struct { + // name is the required name of specific gatherer + // It must be at most 256 characters in length. + // The format for the gatherer name should be: {gatherer}/{function} where the function is optional. + // Gatherer consists of a lowercase letters only that may include underscores (_). + // Function consists of a lowercase letters only that may include underscores (_) and is separated from the gatherer by a forward slash (/). + // The particular gatherers can be found at https://github.com/openshift/insights-operator/blob/master/docs/gathered-data.md. + // +kubebuilder:validation:MaxLength=256 + // +kubebuilder:validation:XValidation:rule=`self.matches("^[a-z]+[_a-z]*[a-z]([/a-z][_a-z]*)?[a-z]$")`,message=`gatherer name must be in the format of {gatherer}/{function} where the gatherer and function are lowercase letters only that may include underscores (_) and are separated by a forward slash (/) if the function is provided` + // +required + Name string `json:"name"` + // state allows you to configure specific gatherer. Valid values are "Enabled", "Disabled" and omitted. + // When omitted, this means no opinion and the platform is left to choose a reasonable default. + // The current default is Enabled. + // +optional + State GathererState `json:"state"` +} + +// dataGatherState declares valid gathering state types +// +kubebuilder:validation:Optional +// +kubebuilder:validation:Enum=Running;Completed;Failed;Pending +// +kubebuilder:validation:XValidation:rule="!(oldSelf == 'Running' && self == 'Pending')", message="dataGatherState cannot transition from Running to Pending" +// +kubebuilder:validation:XValidation:rule="!(oldSelf == 'Completed' && self == 'Pending')", message="dataGatherState cannot transition from Completed to Pending" +// +kubebuilder:validation:XValidation:rule="!(oldSelf == 'Failed' && self == 'Pending')", message="dataGatherState cannot transition from Failed to Pending" +// +kubebuilder:validation:XValidation:rule="!(oldSelf == 'Completed' && self == 'Running')", message="dataGatherState cannot transition from Completed to Running" +// +kubebuilder:validation:XValidation:rule="!(oldSelf == 'Failed' && self == 'Running')", message="dataGatherState cannot transition from Failed to Running" +type DataGatherState string + +// DataGatherStatus contains information relating to the DataGather state. +// +kubebuilder:validation:XValidation:rule="(!has(oldSelf.insightsRequestID) || has(self.insightsRequestID))",message="cannot remove insightsRequestID attribute from status" +// +kubebuilder:validation:XValidation:rule="(!has(oldSelf.startTime) || has(self.startTime))",message="cannot remove startTime attribute from status" +// +kubebuilder:validation:XValidation:rule="(!has(oldSelf.finishTime) || has(self.finishTime))",message="cannot remove finishTime attribute from status" +// +kubebuilder:validation:XValidation:rule="(!has(oldSelf.dataGatherState) || has(self.dataGatherState))",message="cannot remove dataGatherState attribute from status" +// +kubebuilder:validation:Optional +type DataGatherStatus struct { + // conditions provide details on the status of the gatherer job. + // +listType=map + // +listMapKey=type + // +kubebuilder:validation:MaxItems=100 + // +optional + Conditions []metav1.Condition `json:"conditions,omitempty"` + // dataGatherState reflects the current state of the data gathering process. + // +optional + State DataGatherState `json:"dataGatherState,omitempty"` + // gatherers is a list of active gatherers (and their statuses) in the last gathering. + // +listType=map + // +listMapKey=name + // +kubebuilder:validation:MaxItems=100 + // +optional + Gatherers []GathererStatus `json:"gatherers,omitempty"` + // startTime is the time when Insights data gathering started. + // +kubebuilder:validation:XValidation:rule="self == oldSelf",message="startTime is immutable once set" + // +optional + StartTime metav1.Time `json:"startTime,omitempty"` + // finishTime is the time when Insights data gathering finished. + // +kubebuilder:validation:XValidation:rule="self == oldSelf",message="finishTime is immutable once set" + // +optional + FinishTime metav1.Time `json:"finishTime,omitempty"` + // relatedObjects is a list of resources which are useful when debugging or inspecting the data + // gathering Pod + // +kubebuilder:validation:MaxItems=100 + // +optional + RelatedObjects []ObjectReference `json:"relatedObjects,omitempty"` + // insightsRequestID is an Insights request ID to track the status of the + // Insights analysis (in console.redhat.com processing pipeline) for the corresponding Insights data archive. + // +kubebuilder:validation:XValidation:rule="self == oldSelf",message="insightsRequestID is immutable once set" + // +kubebuilder:validation:MaxLength=256 + // +optional + InsightsRequestID string `json:"insightsRequestID,omitempty"` + // insightsReport provides general Insights analysis results. + // When omitted, this means no data gathering has taken place yet or the + // corresponding Insights analysis (identified by "insightsRequestID") is not available. + // +optional + InsightsReport InsightsReport `json:"insightsReport,omitempty"` +} + +// gathererStatus represents information about a particular +// data gatherer. +type GathererStatus struct { + // conditions provide details on the status of each gatherer. + // +listType=map + // +listMapKey=type + // +kubebuilder:validation:MinItems=1 + // +kubebuilder:validation:MaxItems=100 + // +required + Conditions []metav1.Condition `json:"conditions"` + // name is the name of the gatherer. + // +required + // +kubebuilder:validation:MaxLength=256 + // +kubebuilder:validation:MinLength=5 + Name string `json:"name"` + // lastGatherDuration represents the time spent gathering. + // +required + // +kubebuilder:validation:Type=string + // +kubebuilder:validation:Pattern="^(([0-9]+(?:\\.[0-9]+)?(ns|us|µs|μs|ms|s|m|h))+)$" + LastGatherDuration metav1.Duration `json:"lastGatherDuration"` +} + +// insightsReport provides Insights health check report based on the most +// recently sent Insights data. +type InsightsReport struct { + // downloadedAt is the time when the last Insights report was downloaded. + // An empty value means that there has not been any Insights report downloaded yet and + // it usually appears in disconnected clusters (or clusters when the Insights data gathering is disabled). + // +optional + DownloadedAt metav1.Time `json:"downloadedAt,omitempty"` + // healthChecks provides basic information about active Insights health checks + // in a cluster. + // +listType=atomic + // +kubebuilder:validation:MaxItems=100 + // +optional + HealthChecks []HealthCheck `json:"healthChecks,omitempty"` + // uri is optional field that provides the URL link from which the report was downloaded. + // The link must be a valid HTTPS URL and the maximum length is 2048 characters. + // +kubebuilder:validation:XValidation:rule=`isURL(self) && url(self).getScheme() == "https"`,message=`URI must be a valid HTTPS URL (e.g., https://example.com)` + // +kubebuilder:validation:MaxLength=2048 + // +optional + URI string `json:"uri,omitempty"` +} + +// healthCheck represents an Insights health check attributes. +type HealthCheck struct { + // description provides basic description of the healtcheck. + // +required + // +kubebuilder:validation:MaxLength=2048 + // +kubebuilder:validation:MinLength=10 + Description string `json:"description"` + // totalRisk of the healthcheck. Indicator of the total risk posed + // by the detected issue; combination of impact and likelihood. The values can be from 1 to 4, + // and the higher the number, the more important the issue. + // +required + // +kubebuilder:validation:Minimum=1 + // +kubebuilder:validation:Maximum=4 + TotalRisk int32 `json:"totalRisk"` + // advisorURI is required field that provides the URL link to the Insights Advisor. + // The link must be a valid HTTPS URL and the maximum length is 2048 characters. + // +kubebuilder:validation:XValidation:rule=`isURL(self) && url(self).getScheme() == "https"`,message=`advisorURI must be a valid HTTPS URL (e.g., https://example.com)` + // +kubebuilder:validation:MaxLength=2048 + // +required + AdvisorURI string `json:"advisorURI"` + // state determines what the current state of the health check is. + // Health check is enabled by default and can be disabled + // by the user in the Insights advisor user interface. + // +required + State HealthCheckState `json:"state"` +} + +// healthCheckState provides information about the status of the +// health check (for example, the health check may be marked as disabled by the user). +// +kubebuilder:validation:Enum:=Enabled;Disabled +type HealthCheckState string + +const ( + // enabled marks the health check as enabled + HealthCheckEnabled HealthCheckState = "Enabled" + // disabled marks the health check as disabled + HealthCheckDisabled HealthCheckState = "Disabled" +) + +// ObjectReference contains enough information to let you inspect or modify the referred object. +type ObjectReference struct { + // group is the API Group of the Resource. + // Enter empty string for the core group. + // This value is empty or should follow the DNS1123 subdomain format and it must be at most 253 characters in length. + // Example: "", "apps", "build.openshift.io", etc. + // +kubebuilder:validation:XValidation:rule="self.size() == 0 || !format.dns1123Subdomain().validate(self).hasValue()",message="a lowercase RFC 1123 subdomain must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character." + // +kubebuilder:validation:MaxLength:=253 + // +required + Group string `json:"group"` + // resource is required field of the type that is being referenced. + // It is normally the plural form of the resource kind in lowercase. + // This value should consist of only lowercase alphanumeric characters and hyphens. + // Example: "deployments", "deploymentconfigs", "pods", etc. + // +kubebuilder:validation:XValidation:rule=`self.matches("^[a-z0-9]([-a-z0-9]*[a-z0-9])?$")`,message=`resource must consist of only lowercase alphanumeric characters and hyphens` + // +kubebuilder:validation:MaxLength=512 + // +required + Resource string `json:"resource"` + // name of the referent that follows the DNS1123 subdomain format. + // It must be at most 256 characters in length. + // +kubebuilder:validation:XValidation:rule="!format.dns1123Subdomain().validate(self).hasValue()",message="a lowercase RFC 1123 subdomain must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character." + // +kubebuilder:validation:MaxLength=256 + // +required + Name string `json:"name"` + // namespace of the referent that follows the DNS1123 subdomain format. + // It must be at most 253 characters in length. + // +kubebuilder:validation:XValidation:rule="!format.dns1123Subdomain().validate(self).hasValue()",message="a lowercase RFC 1123 subdomain must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character." + // +kubebuilder:validation:MaxLength=253 + // +optional + Namespace string `json:"namespace,omitempty"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// DataGatherList is a collection of items +// +// 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. +// +openshift:compatibility-gen:level=4 +type DataGatherList struct { + metav1.TypeMeta `json:",inline"` + // metadata is the standard list's metadata. + // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + // +optional + metav1.ListMeta `json:"metadata,omitempty"` + // items contains a list of DataGather resources. + // +listType=atomic + // +kubebuilder:validation:MaxItems=100 + // +optional + Items []DataGather `json:"items,omitempty"` +} diff --git a/insights/v1alpha2/zz_generated.crd-manifests/0000_10_insights_01_datagathers-CustomNoUpgrade.crd.yaml b/insights/v1alpha2/zz_generated.crd-manifests/0000_10_insights_01_datagathers-CustomNoUpgrade.crd.yaml new file mode 100644 index 00000000000..7a2b631373e --- /dev/null +++ b/insights/v1alpha2/zz_generated.crd-manifests/0000_10_insights_01_datagathers-CustomNoUpgrade.crd.yaml @@ -0,0 +1,529 @@ +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + api-approved.openshift.io: https://github.com/openshift/api/pull/1365 + api.openshift.io/merged-by-featuregates: "true" + include.release.openshift.io/ibm-cloud-managed: "true" + include.release.openshift.io/self-managed-high-availability: "true" + release.openshift.io/feature-set: CustomNoUpgrade + name: datagathers.insights.openshift.io +spec: + group: insights.openshift.io + names: + kind: DataGather + listKind: DataGatherList + plural: datagathers + singular: datagather + scope: Cluster + versions: + - additionalPrinterColumns: + - description: DataGather job state + jsonPath: .status.dataGatherState + name: State + type: string + - description: DataGather start time + jsonPath: .status.startTime + name: StartTime + type: date + - description: DataGather finish time + jsonPath: .status.finishTime + name: FinishTime + type: date + name: v1alpha2 + schema: + openAPIV3Schema: + description: |- + DataGather provides data gather configuration options and status for the particular Insights data gathering. + + 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. + 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: spec holds user settable values for configuration + properties: + dataPolicy: + description: |- + dataPolicy allows user to enable additional global obfuscation of the IP addresses and base domain + in the Insights archive data. Valid values are "ClearText" and "ObfuscateNetworking". + When set to ClearText the data is not obfuscated. + When set to ObfuscateNetworking the IP addresses and the cluster domain name are obfuscated. + When omitted, this means no opinion and the platform is left to choose a reasonable default, which is subject to change over time. + The current default is ClearText. + enum: + - "" + - ClearText + - ObfuscateNetworking + type: string + gatherers: + description: |- + gatherers is an optional list of gatherers configurations. + The list must not exceed 100 items. + The particular gatherers IDs can be found at https://github.com/openshift/insights-operator/blob/master/docs/gathered-data.md. + Run the following command to get the names of last active gatherers: + "oc get insightsoperators.operator.openshift.io cluster -o json | jq '.status.gatherStatus.gatherers[].name'" + items: + description: gathererConfig allows to configure specific gatherers + properties: + name: + description: |- + name is the required name of specific gatherer + It must be at most 256 characters in length. + The format for the gatherer name should be: {gatherer}/{function} where the function is optional. + Gatherer consists of a lowercase letters only that may include underscores (_). + Function consists of a lowercase letters only that may include underscores (_) and is separated from the gatherer by a forward slash (/). + The particular gatherers can be found at https://github.com/openshift/insights-operator/blob/master/docs/gathered-data.md. + maxLength: 256 + type: string + x-kubernetes-validations: + - message: gatherer name must be in the format of {gatherer}/{function} + where the gatherer and function are lowercase letters only + that may include underscores (_) and are separated by a + forward slash (/) if the function is provided + rule: self.matches("^[a-z]+[_a-z]*[a-z]([/a-z][_a-z]*)?[a-z]$") + state: + description: |- + state allows you to configure specific gatherer. Valid values are "Enabled", "Disabled" and omitted. + When omitted, this means no opinion and the platform is left to choose a reasonable default. + The current default is Enabled. + enum: + - "" + - Enabled + - Disabled + type: string + required: + - name + type: object + maxItems: 100 + type: array + storage: + description: |- + storage is an optional field that allows user to define persistent storage for gathering jobs to store the Insights data archive. + If omitted, the gathering job will use ephemeral storage. + properties: + persistentVolume: + description: |- + persistentVolume is an optional field that specifies the PersistentVolume that will be used to store the Insights data archive. + The PersistentVolume must be created in the openshift-insights namespace. + properties: + claim: + description: |- + claim is a required field that specifies the configuration of the PersistentVolumeClaim that will be used to store the Insights data archive. + The PersistentVolumeClaim must be created in the openshift-insights namespace. + properties: + name: + description: |- + name is a string that follows the DNS1123 subdomain format. + It must be at most 253 characters in length, and must consist only of lower case alphanumeric characters, '-' and '.', and must start and end with an alphanumeric character. + maxLength: 253 + type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 subdomain must consist + of lower case alphanumeric characters, '-' or '.', + and must start and end with an alphanumeric character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' + required: + - name + type: object + mountPath: + description: |- + mountPath is an optional field specifying the directory where the PVC will be mounted inside the Insights data gathering Pod. + When omitted, this means no opinion and the platform is left to choose a reasonable default, which is subject to change over time. + The current default mount path is /var/lib/insights-operator + The path may not exceed 1024 characters and must not contain a colon. + maxLength: 1024 + type: string + x-kubernetes-validations: + - message: mountPath must not contain a colon + rule: '!self.contains('':'')' + required: + - claim + type: object + type: + description: |- + type is a required field that specifies the type of storage that will be used to store the Insights data archive. + Valid values are "PersistentVolume" and "Ephemeral". + When set to Ephemeral, the Insights data archive is stored in the ephemeral storage of the gathering job. + When set to PersistentVolume, the Insights data archive is stored in the PersistentVolume that is + defined by the PersistentVolume field. + enum: + - PersistentVolume + - Ephemeral + type: string + required: + - type + type: object + x-kubernetes-validations: + - message: persistentVolume is required when type is PersistentVolume, + and forbidden otherwise + rule: 'has(self.type) && self.type == ''PersistentVolume'' ? has(self.persistentVolume) + : !has(self.persistentVolume)' + type: object + status: + description: status holds observed values from the cluster. They may not + be overridden. + properties: + conditions: + description: conditions provide details on the status of the gatherer + job. + items: + description: Condition contains details for one aspect of the current + state of this API Resource. + properties: + lastTransitionTime: + description: |- + lastTransitionTime is the last time the condition transitioned from one status to another. + This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable. + format: date-time + type: string + message: + description: |- + message is a human readable message indicating details about the transition. + This may be an empty string. + maxLength: 32768 + type: string + observedGeneration: + description: |- + observedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + format: int64 + minimum: 0 + type: integer + reason: + description: |- + reason contains a programmatic identifier indicating the reason for the condition's last transition. + Producers of specific condition types may define expected values and meanings for this field, + and whether the values are considered a guaranteed API. + The value should be a CamelCase string. + This field may not be empty. + maxLength: 1024 + minLength: 1 + pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$ + type: string + status: + description: status of the condition, one of True, False, Unknown. + enum: + - "True" + - "False" + - Unknown + type: string + type: + description: type of condition in CamelCase or in foo.example.com/CamelCase. + maxLength: 316 + pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$ + type: string + required: + - lastTransitionTime + - message + - reason + - status + - type + type: object + maxItems: 100 + type: array + x-kubernetes-list-map-keys: + - type + x-kubernetes-list-type: map + dataGatherState: + description: dataGatherState reflects the current state of the data + gathering process. + enum: + - Running + - Completed + - Failed + - Pending + type: string + x-kubernetes-validations: + - message: dataGatherState cannot transition from Running to Pending + rule: '!(oldSelf == ''Running'' && self == ''Pending'')' + - message: dataGatherState cannot transition from Completed to Pending + rule: '!(oldSelf == ''Completed'' && self == ''Pending'')' + - message: dataGatherState cannot transition from Failed to Pending + rule: '!(oldSelf == ''Failed'' && self == ''Pending'')' + - message: dataGatherState cannot transition from Completed to Running + rule: '!(oldSelf == ''Completed'' && self == ''Running'')' + - message: dataGatherState cannot transition from Failed to Running + rule: '!(oldSelf == ''Failed'' && self == ''Running'')' + finishTime: + description: finishTime is the time when Insights data gathering finished. + format: date-time + type: string + x-kubernetes-validations: + - message: finishTime is immutable once set + rule: self == oldSelf + gatherers: + description: gatherers is a list of active gatherers (and their statuses) + in the last gathering. + items: + description: |- + gathererStatus represents information about a particular + data gatherer. + properties: + conditions: + description: conditions provide details on the status of each + gatherer. + items: + description: Condition contains details for one aspect of + the current state of this API Resource. + properties: + lastTransitionTime: + description: |- + lastTransitionTime is the last time the condition transitioned from one status to another. + This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable. + format: date-time + type: string + message: + description: |- + message is a human readable message indicating details about the transition. + This may be an empty string. + maxLength: 32768 + type: string + observedGeneration: + description: |- + observedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + format: int64 + minimum: 0 + type: integer + reason: + description: |- + reason contains a programmatic identifier indicating the reason for the condition's last transition. + Producers of specific condition types may define expected values and meanings for this field, + and whether the values are considered a guaranteed API. + The value should be a CamelCase string. + This field may not be empty. + maxLength: 1024 + minLength: 1 + pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$ + type: string + status: + description: status of the condition, one of True, False, + Unknown. + enum: + - "True" + - "False" + - Unknown + type: string + type: + description: type of condition in CamelCase or in foo.example.com/CamelCase. + maxLength: 316 + pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$ + type: string + required: + - lastTransitionTime + - message + - reason + - status + - type + type: object + maxItems: 100 + minItems: 1 + type: array + x-kubernetes-list-map-keys: + - type + x-kubernetes-list-type: map + lastGatherDuration: + description: lastGatherDuration represents the time spent gathering. + pattern: ^(([0-9]+(?:\.[0-9]+)?(ns|us|µs|μs|ms|s|m|h))+)$ + type: string + name: + description: name is the name of the gatherer. + maxLength: 256 + minLength: 5 + type: string + required: + - conditions + - lastGatherDuration + - name + type: object + maxItems: 100 + type: array + x-kubernetes-list-map-keys: + - name + x-kubernetes-list-type: map + insightsReport: + description: |- + insightsReport provides general Insights analysis results. + When omitted, this means no data gathering has taken place yet or the + corresponding Insights analysis (identified by "insightsRequestID") is not available. + properties: + downloadedAt: + description: |- + downloadedAt is the time when the last Insights report was downloaded. + An empty value means that there has not been any Insights report downloaded yet and + it usually appears in disconnected clusters (or clusters when the Insights data gathering is disabled). + format: date-time + type: string + healthChecks: + description: |- + healthChecks provides basic information about active Insights health checks + in a cluster. + items: + description: healthCheck represents an Insights health check + attributes. + properties: + advisorURI: + description: |- + advisorURI is required field that provides the URL link to the Insights Advisor. + The link must be a valid HTTPS URL and the maximum length is 2048 characters. + maxLength: 2048 + type: string + x-kubernetes-validations: + - message: advisorURI must be a valid HTTPS URL (e.g., https://example.com) + rule: isURL(self) && url(self).getScheme() == "https" + description: + description: description provides basic description of the + healtcheck. + maxLength: 2048 + minLength: 10 + type: string + state: + description: |- + state determines what the current state of the health check is. + Health check is enabled by default and can be disabled + by the user in the Insights advisor user interface. + enum: + - Enabled + - Disabled + type: string + totalRisk: + description: |- + totalRisk of the healthcheck. Indicator of the total risk posed + by the detected issue; combination of impact and likelihood. The values can be from 1 to 4, + and the higher the number, the more important the issue. + format: int32 + maximum: 4 + minimum: 1 + type: integer + required: + - advisorURI + - description + - state + - totalRisk + type: object + maxItems: 100 + type: array + x-kubernetes-list-type: atomic + uri: + description: |- + uri is optional field that provides the URL link from which the report was downloaded. + The link must be a valid HTTPS URL and the maximum length is 2048 characters. + maxLength: 2048 + type: string + x-kubernetes-validations: + - message: URI must be a valid HTTPS URL (e.g., https://example.com) + rule: isURL(self) && url(self).getScheme() == "https" + type: object + insightsRequestID: + description: |- + insightsRequestID is an Insights request ID to track the status of the + Insights analysis (in console.redhat.com processing pipeline) for the corresponding Insights data archive. + maxLength: 256 + type: string + x-kubernetes-validations: + - message: insightsRequestID is immutable once set + rule: self == oldSelf + relatedObjects: + description: |- + relatedObjects is a list of resources which are useful when debugging or inspecting the data + gathering Pod + items: + description: ObjectReference contains enough information to let + you inspect or modify the referred object. + properties: + group: + description: |- + group is the API Group of the Resource. + Enter empty string for the core group. + This value is empty or should follow the DNS1123 subdomain format and it must be at most 253 characters in length. + Example: "", "apps", "build.openshift.io", etc. + maxLength: 253 + type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 subdomain must consist of lower + case alphanumeric characters, '-' or '.', and must start + and end with an alphanumeric character. + rule: self.size() == 0 || !format.dns1123Subdomain().validate(self).hasValue() + name: + description: |- + name of the referent that follows the DNS1123 subdomain format. + It must be at most 256 characters in length. + maxLength: 256 + type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 subdomain must consist of lower + case alphanumeric characters, '-' or '.', and must start + and end with an alphanumeric character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' + namespace: + description: |- + namespace of the referent that follows the DNS1123 subdomain format. + It must be at most 253 characters in length. + maxLength: 253 + type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 subdomain must consist of lower + case alphanumeric characters, '-' or '.', and must start + and end with an alphanumeric character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' + resource: + description: |- + resource is required field of the type that is being referenced. + It is normally the plural form of the resource kind in lowercase. + This value should consist of only lowercase alphanumeric characters and hyphens. + Example: "deployments", "deploymentconfigs", "pods", etc. + maxLength: 512 + type: string + x-kubernetes-validations: + - message: resource must consist of only lowercase alphanumeric + characters and hyphens + rule: self.matches("^[a-z0-9]([-a-z0-9]*[a-z0-9])?$") + required: + - group + - name + - resource + type: object + maxItems: 100 + type: array + startTime: + description: startTime is the time when Insights data gathering started. + format: date-time + type: string + x-kubernetes-validations: + - message: startTime is immutable once set + rule: self == oldSelf + type: object + x-kubernetes-validations: + - message: cannot remove insightsRequestID attribute from status + rule: (!has(oldSelf.insightsRequestID) || has(self.insightsRequestID)) + - message: cannot remove startTime attribute from status + rule: (!has(oldSelf.startTime) || has(self.startTime)) + - message: cannot remove finishTime attribute from status + rule: (!has(oldSelf.finishTime) || has(self.finishTime)) + - message: cannot remove dataGatherState attribute from status + rule: (!has(oldSelf.dataGatherState) || has(self.dataGatherState)) + required: + - spec + type: object + served: true + storage: true + subresources: + status: {} diff --git a/insights/v1alpha2/zz_generated.crd-manifests/0000_10_insights_01_datagathers-DevPreviewNoUpgrade.crd.yaml b/insights/v1alpha2/zz_generated.crd-manifests/0000_10_insights_01_datagathers-DevPreviewNoUpgrade.crd.yaml new file mode 100644 index 00000000000..30ab634cc14 --- /dev/null +++ b/insights/v1alpha2/zz_generated.crd-manifests/0000_10_insights_01_datagathers-DevPreviewNoUpgrade.crd.yaml @@ -0,0 +1,529 @@ +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + api-approved.openshift.io: https://github.com/openshift/api/pull/1365 + api.openshift.io/merged-by-featuregates: "true" + include.release.openshift.io/ibm-cloud-managed: "true" + include.release.openshift.io/self-managed-high-availability: "true" + release.openshift.io/feature-set: DevPreviewNoUpgrade + name: datagathers.insights.openshift.io +spec: + group: insights.openshift.io + names: + kind: DataGather + listKind: DataGatherList + plural: datagathers + singular: datagather + scope: Cluster + versions: + - additionalPrinterColumns: + - description: DataGather job state + jsonPath: .status.dataGatherState + name: State + type: string + - description: DataGather start time + jsonPath: .status.startTime + name: StartTime + type: date + - description: DataGather finish time + jsonPath: .status.finishTime + name: FinishTime + type: date + name: v1alpha2 + schema: + openAPIV3Schema: + description: |- + DataGather provides data gather configuration options and status for the particular Insights data gathering. + + 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. + 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: spec holds user settable values for configuration + properties: + dataPolicy: + description: |- + dataPolicy allows user to enable additional global obfuscation of the IP addresses and base domain + in the Insights archive data. Valid values are "ClearText" and "ObfuscateNetworking". + When set to ClearText the data is not obfuscated. + When set to ObfuscateNetworking the IP addresses and the cluster domain name are obfuscated. + When omitted, this means no opinion and the platform is left to choose a reasonable default, which is subject to change over time. + The current default is ClearText. + enum: + - "" + - ClearText + - ObfuscateNetworking + type: string + gatherers: + description: |- + gatherers is an optional list of gatherers configurations. + The list must not exceed 100 items. + The particular gatherers IDs can be found at https://github.com/openshift/insights-operator/blob/master/docs/gathered-data.md. + Run the following command to get the names of last active gatherers: + "oc get insightsoperators.operator.openshift.io cluster -o json | jq '.status.gatherStatus.gatherers[].name'" + items: + description: gathererConfig allows to configure specific gatherers + properties: + name: + description: |- + name is the required name of specific gatherer + It must be at most 256 characters in length. + The format for the gatherer name should be: {gatherer}/{function} where the function is optional. + Gatherer consists of a lowercase letters only that may include underscores (_). + Function consists of a lowercase letters only that may include underscores (_) and is separated from the gatherer by a forward slash (/). + The particular gatherers can be found at https://github.com/openshift/insights-operator/blob/master/docs/gathered-data.md. + maxLength: 256 + type: string + x-kubernetes-validations: + - message: gatherer name must be in the format of {gatherer}/{function} + where the gatherer and function are lowercase letters only + that may include underscores (_) and are separated by a + forward slash (/) if the function is provided + rule: self.matches("^[a-z]+[_a-z]*[a-z]([/a-z][_a-z]*)?[a-z]$") + state: + description: |- + state allows you to configure specific gatherer. Valid values are "Enabled", "Disabled" and omitted. + When omitted, this means no opinion and the platform is left to choose a reasonable default. + The current default is Enabled. + enum: + - "" + - Enabled + - Disabled + type: string + required: + - name + type: object + maxItems: 100 + type: array + storage: + description: |- + storage is an optional field that allows user to define persistent storage for gathering jobs to store the Insights data archive. + If omitted, the gathering job will use ephemeral storage. + properties: + persistentVolume: + description: |- + persistentVolume is an optional field that specifies the PersistentVolume that will be used to store the Insights data archive. + The PersistentVolume must be created in the openshift-insights namespace. + properties: + claim: + description: |- + claim is a required field that specifies the configuration of the PersistentVolumeClaim that will be used to store the Insights data archive. + The PersistentVolumeClaim must be created in the openshift-insights namespace. + properties: + name: + description: |- + name is a string that follows the DNS1123 subdomain format. + It must be at most 253 characters in length, and must consist only of lower case alphanumeric characters, '-' and '.', and must start and end with an alphanumeric character. + maxLength: 253 + type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 subdomain must consist + of lower case alphanumeric characters, '-' or '.', + and must start and end with an alphanumeric character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' + required: + - name + type: object + mountPath: + description: |- + mountPath is an optional field specifying the directory where the PVC will be mounted inside the Insights data gathering Pod. + When omitted, this means no opinion and the platform is left to choose a reasonable default, which is subject to change over time. + The current default mount path is /var/lib/insights-operator + The path may not exceed 1024 characters and must not contain a colon. + maxLength: 1024 + type: string + x-kubernetes-validations: + - message: mountPath must not contain a colon + rule: '!self.contains('':'')' + required: + - claim + type: object + type: + description: |- + type is a required field that specifies the type of storage that will be used to store the Insights data archive. + Valid values are "PersistentVolume" and "Ephemeral". + When set to Ephemeral, the Insights data archive is stored in the ephemeral storage of the gathering job. + When set to PersistentVolume, the Insights data archive is stored in the PersistentVolume that is + defined by the PersistentVolume field. + enum: + - PersistentVolume + - Ephemeral + type: string + required: + - type + type: object + x-kubernetes-validations: + - message: persistentVolume is required when type is PersistentVolume, + and forbidden otherwise + rule: 'has(self.type) && self.type == ''PersistentVolume'' ? has(self.persistentVolume) + : !has(self.persistentVolume)' + type: object + status: + description: status holds observed values from the cluster. They may not + be overridden. + properties: + conditions: + description: conditions provide details on the status of the gatherer + job. + items: + description: Condition contains details for one aspect of the current + state of this API Resource. + properties: + lastTransitionTime: + description: |- + lastTransitionTime is the last time the condition transitioned from one status to another. + This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable. + format: date-time + type: string + message: + description: |- + message is a human readable message indicating details about the transition. + This may be an empty string. + maxLength: 32768 + type: string + observedGeneration: + description: |- + observedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + format: int64 + minimum: 0 + type: integer + reason: + description: |- + reason contains a programmatic identifier indicating the reason for the condition's last transition. + Producers of specific condition types may define expected values and meanings for this field, + and whether the values are considered a guaranteed API. + The value should be a CamelCase string. + This field may not be empty. + maxLength: 1024 + minLength: 1 + pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$ + type: string + status: + description: status of the condition, one of True, False, Unknown. + enum: + - "True" + - "False" + - Unknown + type: string + type: + description: type of condition in CamelCase or in foo.example.com/CamelCase. + maxLength: 316 + pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$ + type: string + required: + - lastTransitionTime + - message + - reason + - status + - type + type: object + maxItems: 100 + type: array + x-kubernetes-list-map-keys: + - type + x-kubernetes-list-type: map + dataGatherState: + description: dataGatherState reflects the current state of the data + gathering process. + enum: + - Running + - Completed + - Failed + - Pending + type: string + x-kubernetes-validations: + - message: dataGatherState cannot transition from Running to Pending + rule: '!(oldSelf == ''Running'' && self == ''Pending'')' + - message: dataGatherState cannot transition from Completed to Pending + rule: '!(oldSelf == ''Completed'' && self == ''Pending'')' + - message: dataGatherState cannot transition from Failed to Pending + rule: '!(oldSelf == ''Failed'' && self == ''Pending'')' + - message: dataGatherState cannot transition from Completed to Running + rule: '!(oldSelf == ''Completed'' && self == ''Running'')' + - message: dataGatherState cannot transition from Failed to Running + rule: '!(oldSelf == ''Failed'' && self == ''Running'')' + finishTime: + description: finishTime is the time when Insights data gathering finished. + format: date-time + type: string + x-kubernetes-validations: + - message: finishTime is immutable once set + rule: self == oldSelf + gatherers: + description: gatherers is a list of active gatherers (and their statuses) + in the last gathering. + items: + description: |- + gathererStatus represents information about a particular + data gatherer. + properties: + conditions: + description: conditions provide details on the status of each + gatherer. + items: + description: Condition contains details for one aspect of + the current state of this API Resource. + properties: + lastTransitionTime: + description: |- + lastTransitionTime is the last time the condition transitioned from one status to another. + This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable. + format: date-time + type: string + message: + description: |- + message is a human readable message indicating details about the transition. + This may be an empty string. + maxLength: 32768 + type: string + observedGeneration: + description: |- + observedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + format: int64 + minimum: 0 + type: integer + reason: + description: |- + reason contains a programmatic identifier indicating the reason for the condition's last transition. + Producers of specific condition types may define expected values and meanings for this field, + and whether the values are considered a guaranteed API. + The value should be a CamelCase string. + This field may not be empty. + maxLength: 1024 + minLength: 1 + pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$ + type: string + status: + description: status of the condition, one of True, False, + Unknown. + enum: + - "True" + - "False" + - Unknown + type: string + type: + description: type of condition in CamelCase or in foo.example.com/CamelCase. + maxLength: 316 + pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$ + type: string + required: + - lastTransitionTime + - message + - reason + - status + - type + type: object + maxItems: 100 + minItems: 1 + type: array + x-kubernetes-list-map-keys: + - type + x-kubernetes-list-type: map + lastGatherDuration: + description: lastGatherDuration represents the time spent gathering. + pattern: ^(([0-9]+(?:\.[0-9]+)?(ns|us|µs|μs|ms|s|m|h))+)$ + type: string + name: + description: name is the name of the gatherer. + maxLength: 256 + minLength: 5 + type: string + required: + - conditions + - lastGatherDuration + - name + type: object + maxItems: 100 + type: array + x-kubernetes-list-map-keys: + - name + x-kubernetes-list-type: map + insightsReport: + description: |- + insightsReport provides general Insights analysis results. + When omitted, this means no data gathering has taken place yet or the + corresponding Insights analysis (identified by "insightsRequestID") is not available. + properties: + downloadedAt: + description: |- + downloadedAt is the time when the last Insights report was downloaded. + An empty value means that there has not been any Insights report downloaded yet and + it usually appears in disconnected clusters (or clusters when the Insights data gathering is disabled). + format: date-time + type: string + healthChecks: + description: |- + healthChecks provides basic information about active Insights health checks + in a cluster. + items: + description: healthCheck represents an Insights health check + attributes. + properties: + advisorURI: + description: |- + advisorURI is required field that provides the URL link to the Insights Advisor. + The link must be a valid HTTPS URL and the maximum length is 2048 characters. + maxLength: 2048 + type: string + x-kubernetes-validations: + - message: advisorURI must be a valid HTTPS URL (e.g., https://example.com) + rule: isURL(self) && url(self).getScheme() == "https" + description: + description: description provides basic description of the + healtcheck. + maxLength: 2048 + minLength: 10 + type: string + state: + description: |- + state determines what the current state of the health check is. + Health check is enabled by default and can be disabled + by the user in the Insights advisor user interface. + enum: + - Enabled + - Disabled + type: string + totalRisk: + description: |- + totalRisk of the healthcheck. Indicator of the total risk posed + by the detected issue; combination of impact and likelihood. The values can be from 1 to 4, + and the higher the number, the more important the issue. + format: int32 + maximum: 4 + minimum: 1 + type: integer + required: + - advisorURI + - description + - state + - totalRisk + type: object + maxItems: 100 + type: array + x-kubernetes-list-type: atomic + uri: + description: |- + uri is optional field that provides the URL link from which the report was downloaded. + The link must be a valid HTTPS URL and the maximum length is 2048 characters. + maxLength: 2048 + type: string + x-kubernetes-validations: + - message: URI must be a valid HTTPS URL (e.g., https://example.com) + rule: isURL(self) && url(self).getScheme() == "https" + type: object + insightsRequestID: + description: |- + insightsRequestID is an Insights request ID to track the status of the + Insights analysis (in console.redhat.com processing pipeline) for the corresponding Insights data archive. + maxLength: 256 + type: string + x-kubernetes-validations: + - message: insightsRequestID is immutable once set + rule: self == oldSelf + relatedObjects: + description: |- + relatedObjects is a list of resources which are useful when debugging or inspecting the data + gathering Pod + items: + description: ObjectReference contains enough information to let + you inspect or modify the referred object. + properties: + group: + description: |- + group is the API Group of the Resource. + Enter empty string for the core group. + This value is empty or should follow the DNS1123 subdomain format and it must be at most 253 characters in length. + Example: "", "apps", "build.openshift.io", etc. + maxLength: 253 + type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 subdomain must consist of lower + case alphanumeric characters, '-' or '.', and must start + and end with an alphanumeric character. + rule: self.size() == 0 || !format.dns1123Subdomain().validate(self).hasValue() + name: + description: |- + name of the referent that follows the DNS1123 subdomain format. + It must be at most 256 characters in length. + maxLength: 256 + type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 subdomain must consist of lower + case alphanumeric characters, '-' or '.', and must start + and end with an alphanumeric character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' + namespace: + description: |- + namespace of the referent that follows the DNS1123 subdomain format. + It must be at most 253 characters in length. + maxLength: 253 + type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 subdomain must consist of lower + case alphanumeric characters, '-' or '.', and must start + and end with an alphanumeric character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' + resource: + description: |- + resource is required field of the type that is being referenced. + It is normally the plural form of the resource kind in lowercase. + This value should consist of only lowercase alphanumeric characters and hyphens. + Example: "deployments", "deploymentconfigs", "pods", etc. + maxLength: 512 + type: string + x-kubernetes-validations: + - message: resource must consist of only lowercase alphanumeric + characters and hyphens + rule: self.matches("^[a-z0-9]([-a-z0-9]*[a-z0-9])?$") + required: + - group + - name + - resource + type: object + maxItems: 100 + type: array + startTime: + description: startTime is the time when Insights data gathering started. + format: date-time + type: string + x-kubernetes-validations: + - message: startTime is immutable once set + rule: self == oldSelf + type: object + x-kubernetes-validations: + - message: cannot remove insightsRequestID attribute from status + rule: (!has(oldSelf.insightsRequestID) || has(self.insightsRequestID)) + - message: cannot remove startTime attribute from status + rule: (!has(oldSelf.startTime) || has(self.startTime)) + - message: cannot remove finishTime attribute from status + rule: (!has(oldSelf.finishTime) || has(self.finishTime)) + - message: cannot remove dataGatherState attribute from status + rule: (!has(oldSelf.dataGatherState) || has(self.dataGatherState)) + required: + - spec + type: object + served: true + storage: true + subresources: + status: {} diff --git a/insights/v1alpha2/zz_generated.crd-manifests/0000_10_insights_01_datagathers-TechPreviewNoUpgrade.crd.yaml b/insights/v1alpha2/zz_generated.crd-manifests/0000_10_insights_01_datagathers-TechPreviewNoUpgrade.crd.yaml new file mode 100644 index 00000000000..8bd1cf034cd --- /dev/null +++ b/insights/v1alpha2/zz_generated.crd-manifests/0000_10_insights_01_datagathers-TechPreviewNoUpgrade.crd.yaml @@ -0,0 +1,529 @@ +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + api-approved.openshift.io: https://github.com/openshift/api/pull/1365 + api.openshift.io/merged-by-featuregates: "true" + include.release.openshift.io/ibm-cloud-managed: "true" + include.release.openshift.io/self-managed-high-availability: "true" + release.openshift.io/feature-set: TechPreviewNoUpgrade + name: datagathers.insights.openshift.io +spec: + group: insights.openshift.io + names: + kind: DataGather + listKind: DataGatherList + plural: datagathers + singular: datagather + scope: Cluster + versions: + - additionalPrinterColumns: + - description: DataGather job state + jsonPath: .status.dataGatherState + name: State + type: string + - description: DataGather start time + jsonPath: .status.startTime + name: StartTime + type: date + - description: DataGather finish time + jsonPath: .status.finishTime + name: FinishTime + type: date + name: v1alpha2 + schema: + openAPIV3Schema: + description: |- + DataGather provides data gather configuration options and status for the particular Insights data gathering. + + 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. + 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: spec holds user settable values for configuration + properties: + dataPolicy: + description: |- + dataPolicy allows user to enable additional global obfuscation of the IP addresses and base domain + in the Insights archive data. Valid values are "ClearText" and "ObfuscateNetworking". + When set to ClearText the data is not obfuscated. + When set to ObfuscateNetworking the IP addresses and the cluster domain name are obfuscated. + When omitted, this means no opinion and the platform is left to choose a reasonable default, which is subject to change over time. + The current default is ClearText. + enum: + - "" + - ClearText + - ObfuscateNetworking + type: string + gatherers: + description: |- + gatherers is an optional list of gatherers configurations. + The list must not exceed 100 items. + The particular gatherers IDs can be found at https://github.com/openshift/insights-operator/blob/master/docs/gathered-data.md. + Run the following command to get the names of last active gatherers: + "oc get insightsoperators.operator.openshift.io cluster -o json | jq '.status.gatherStatus.gatherers[].name'" + items: + description: gathererConfig allows to configure specific gatherers + properties: + name: + description: |- + name is the required name of specific gatherer + It must be at most 256 characters in length. + The format for the gatherer name should be: {gatherer}/{function} where the function is optional. + Gatherer consists of a lowercase letters only that may include underscores (_). + Function consists of a lowercase letters only that may include underscores (_) and is separated from the gatherer by a forward slash (/). + The particular gatherers can be found at https://github.com/openshift/insights-operator/blob/master/docs/gathered-data.md. + maxLength: 256 + type: string + x-kubernetes-validations: + - message: gatherer name must be in the format of {gatherer}/{function} + where the gatherer and function are lowercase letters only + that may include underscores (_) and are separated by a + forward slash (/) if the function is provided + rule: self.matches("^[a-z]+[_a-z]*[a-z]([/a-z][_a-z]*)?[a-z]$") + state: + description: |- + state allows you to configure specific gatherer. Valid values are "Enabled", "Disabled" and omitted. + When omitted, this means no opinion and the platform is left to choose a reasonable default. + The current default is Enabled. + enum: + - "" + - Enabled + - Disabled + type: string + required: + - name + type: object + maxItems: 100 + type: array + storage: + description: |- + storage is an optional field that allows user to define persistent storage for gathering jobs to store the Insights data archive. + If omitted, the gathering job will use ephemeral storage. + properties: + persistentVolume: + description: |- + persistentVolume is an optional field that specifies the PersistentVolume that will be used to store the Insights data archive. + The PersistentVolume must be created in the openshift-insights namespace. + properties: + claim: + description: |- + claim is a required field that specifies the configuration of the PersistentVolumeClaim that will be used to store the Insights data archive. + The PersistentVolumeClaim must be created in the openshift-insights namespace. + properties: + name: + description: |- + name is a string that follows the DNS1123 subdomain format. + It must be at most 253 characters in length, and must consist only of lower case alphanumeric characters, '-' and '.', and must start and end with an alphanumeric character. + maxLength: 253 + type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 subdomain must consist + of lower case alphanumeric characters, '-' or '.', + and must start and end with an alphanumeric character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' + required: + - name + type: object + mountPath: + description: |- + mountPath is an optional field specifying the directory where the PVC will be mounted inside the Insights data gathering Pod. + When omitted, this means no opinion and the platform is left to choose a reasonable default, which is subject to change over time. + The current default mount path is /var/lib/insights-operator + The path may not exceed 1024 characters and must not contain a colon. + maxLength: 1024 + type: string + x-kubernetes-validations: + - message: mountPath must not contain a colon + rule: '!self.contains('':'')' + required: + - claim + type: object + type: + description: |- + type is a required field that specifies the type of storage that will be used to store the Insights data archive. + Valid values are "PersistentVolume" and "Ephemeral". + When set to Ephemeral, the Insights data archive is stored in the ephemeral storage of the gathering job. + When set to PersistentVolume, the Insights data archive is stored in the PersistentVolume that is + defined by the PersistentVolume field. + enum: + - PersistentVolume + - Ephemeral + type: string + required: + - type + type: object + x-kubernetes-validations: + - message: persistentVolume is required when type is PersistentVolume, + and forbidden otherwise + rule: 'has(self.type) && self.type == ''PersistentVolume'' ? has(self.persistentVolume) + : !has(self.persistentVolume)' + type: object + status: + description: status holds observed values from the cluster. They may not + be overridden. + properties: + conditions: + description: conditions provide details on the status of the gatherer + job. + items: + description: Condition contains details for one aspect of the current + state of this API Resource. + properties: + lastTransitionTime: + description: |- + lastTransitionTime is the last time the condition transitioned from one status to another. + This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable. + format: date-time + type: string + message: + description: |- + message is a human readable message indicating details about the transition. + This may be an empty string. + maxLength: 32768 + type: string + observedGeneration: + description: |- + observedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + format: int64 + minimum: 0 + type: integer + reason: + description: |- + reason contains a programmatic identifier indicating the reason for the condition's last transition. + Producers of specific condition types may define expected values and meanings for this field, + and whether the values are considered a guaranteed API. + The value should be a CamelCase string. + This field may not be empty. + maxLength: 1024 + minLength: 1 + pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$ + type: string + status: + description: status of the condition, one of True, False, Unknown. + enum: + - "True" + - "False" + - Unknown + type: string + type: + description: type of condition in CamelCase or in foo.example.com/CamelCase. + maxLength: 316 + pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$ + type: string + required: + - lastTransitionTime + - message + - reason + - status + - type + type: object + maxItems: 100 + type: array + x-kubernetes-list-map-keys: + - type + x-kubernetes-list-type: map + dataGatherState: + description: dataGatherState reflects the current state of the data + gathering process. + enum: + - Running + - Completed + - Failed + - Pending + type: string + x-kubernetes-validations: + - message: dataGatherState cannot transition from Running to Pending + rule: '!(oldSelf == ''Running'' && self == ''Pending'')' + - message: dataGatherState cannot transition from Completed to Pending + rule: '!(oldSelf == ''Completed'' && self == ''Pending'')' + - message: dataGatherState cannot transition from Failed to Pending + rule: '!(oldSelf == ''Failed'' && self == ''Pending'')' + - message: dataGatherState cannot transition from Completed to Running + rule: '!(oldSelf == ''Completed'' && self == ''Running'')' + - message: dataGatherState cannot transition from Failed to Running + rule: '!(oldSelf == ''Failed'' && self == ''Running'')' + finishTime: + description: finishTime is the time when Insights data gathering finished. + format: date-time + type: string + x-kubernetes-validations: + - message: finishTime is immutable once set + rule: self == oldSelf + gatherers: + description: gatherers is a list of active gatherers (and their statuses) + in the last gathering. + items: + description: |- + gathererStatus represents information about a particular + data gatherer. + properties: + conditions: + description: conditions provide details on the status of each + gatherer. + items: + description: Condition contains details for one aspect of + the current state of this API Resource. + properties: + lastTransitionTime: + description: |- + lastTransitionTime is the last time the condition transitioned from one status to another. + This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable. + format: date-time + type: string + message: + description: |- + message is a human readable message indicating details about the transition. + This may be an empty string. + maxLength: 32768 + type: string + observedGeneration: + description: |- + observedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + format: int64 + minimum: 0 + type: integer + reason: + description: |- + reason contains a programmatic identifier indicating the reason for the condition's last transition. + Producers of specific condition types may define expected values and meanings for this field, + and whether the values are considered a guaranteed API. + The value should be a CamelCase string. + This field may not be empty. + maxLength: 1024 + minLength: 1 + pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$ + type: string + status: + description: status of the condition, one of True, False, + Unknown. + enum: + - "True" + - "False" + - Unknown + type: string + type: + description: type of condition in CamelCase or in foo.example.com/CamelCase. + maxLength: 316 + pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$ + type: string + required: + - lastTransitionTime + - message + - reason + - status + - type + type: object + maxItems: 100 + minItems: 1 + type: array + x-kubernetes-list-map-keys: + - type + x-kubernetes-list-type: map + lastGatherDuration: + description: lastGatherDuration represents the time spent gathering. + pattern: ^(([0-9]+(?:\.[0-9]+)?(ns|us|µs|μs|ms|s|m|h))+)$ + type: string + name: + description: name is the name of the gatherer. + maxLength: 256 + minLength: 5 + type: string + required: + - conditions + - lastGatherDuration + - name + type: object + maxItems: 100 + type: array + x-kubernetes-list-map-keys: + - name + x-kubernetes-list-type: map + insightsReport: + description: |- + insightsReport provides general Insights analysis results. + When omitted, this means no data gathering has taken place yet or the + corresponding Insights analysis (identified by "insightsRequestID") is not available. + properties: + downloadedAt: + description: |- + downloadedAt is the time when the last Insights report was downloaded. + An empty value means that there has not been any Insights report downloaded yet and + it usually appears in disconnected clusters (or clusters when the Insights data gathering is disabled). + format: date-time + type: string + healthChecks: + description: |- + healthChecks provides basic information about active Insights health checks + in a cluster. + items: + description: healthCheck represents an Insights health check + attributes. + properties: + advisorURI: + description: |- + advisorURI is required field that provides the URL link to the Insights Advisor. + The link must be a valid HTTPS URL and the maximum length is 2048 characters. + maxLength: 2048 + type: string + x-kubernetes-validations: + - message: advisorURI must be a valid HTTPS URL (e.g., https://example.com) + rule: isURL(self) && url(self).getScheme() == "https" + description: + description: description provides basic description of the + healtcheck. + maxLength: 2048 + minLength: 10 + type: string + state: + description: |- + state determines what the current state of the health check is. + Health check is enabled by default and can be disabled + by the user in the Insights advisor user interface. + enum: + - Enabled + - Disabled + type: string + totalRisk: + description: |- + totalRisk of the healthcheck. Indicator of the total risk posed + by the detected issue; combination of impact and likelihood. The values can be from 1 to 4, + and the higher the number, the more important the issue. + format: int32 + maximum: 4 + minimum: 1 + type: integer + required: + - advisorURI + - description + - state + - totalRisk + type: object + maxItems: 100 + type: array + x-kubernetes-list-type: atomic + uri: + description: |- + uri is optional field that provides the URL link from which the report was downloaded. + The link must be a valid HTTPS URL and the maximum length is 2048 characters. + maxLength: 2048 + type: string + x-kubernetes-validations: + - message: URI must be a valid HTTPS URL (e.g., https://example.com) + rule: isURL(self) && url(self).getScheme() == "https" + type: object + insightsRequestID: + description: |- + insightsRequestID is an Insights request ID to track the status of the + Insights analysis (in console.redhat.com processing pipeline) for the corresponding Insights data archive. + maxLength: 256 + type: string + x-kubernetes-validations: + - message: insightsRequestID is immutable once set + rule: self == oldSelf + relatedObjects: + description: |- + relatedObjects is a list of resources which are useful when debugging or inspecting the data + gathering Pod + items: + description: ObjectReference contains enough information to let + you inspect or modify the referred object. + properties: + group: + description: |- + group is the API Group of the Resource. + Enter empty string for the core group. + This value is empty or should follow the DNS1123 subdomain format and it must be at most 253 characters in length. + Example: "", "apps", "build.openshift.io", etc. + maxLength: 253 + type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 subdomain must consist of lower + case alphanumeric characters, '-' or '.', and must start + and end with an alphanumeric character. + rule: self.size() == 0 || !format.dns1123Subdomain().validate(self).hasValue() + name: + description: |- + name of the referent that follows the DNS1123 subdomain format. + It must be at most 256 characters in length. + maxLength: 256 + type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 subdomain must consist of lower + case alphanumeric characters, '-' or '.', and must start + and end with an alphanumeric character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' + namespace: + description: |- + namespace of the referent that follows the DNS1123 subdomain format. + It must be at most 253 characters in length. + maxLength: 253 + type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 subdomain must consist of lower + case alphanumeric characters, '-' or '.', and must start + and end with an alphanumeric character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' + resource: + description: |- + resource is required field of the type that is being referenced. + It is normally the plural form of the resource kind in lowercase. + This value should consist of only lowercase alphanumeric characters and hyphens. + Example: "deployments", "deploymentconfigs", "pods", etc. + maxLength: 512 + type: string + x-kubernetes-validations: + - message: resource must consist of only lowercase alphanumeric + characters and hyphens + rule: self.matches("^[a-z0-9]([-a-z0-9]*[a-z0-9])?$") + required: + - group + - name + - resource + type: object + maxItems: 100 + type: array + startTime: + description: startTime is the time when Insights data gathering started. + format: date-time + type: string + x-kubernetes-validations: + - message: startTime is immutable once set + rule: self == oldSelf + type: object + x-kubernetes-validations: + - message: cannot remove insightsRequestID attribute from status + rule: (!has(oldSelf.insightsRequestID) || has(self.insightsRequestID)) + - message: cannot remove startTime attribute from status + rule: (!has(oldSelf.startTime) || has(self.startTime)) + - message: cannot remove finishTime attribute from status + rule: (!has(oldSelf.finishTime) || has(self.finishTime)) + - message: cannot remove dataGatherState attribute from status + rule: (!has(oldSelf.dataGatherState) || has(self.dataGatherState)) + required: + - spec + type: object + served: true + storage: true + subresources: + status: {} diff --git a/insights/v1alpha2/zz_generated.crd-manifests/doc.go b/insights/v1alpha2/zz_generated.crd-manifests/doc.go new file mode 100644 index 00000000000..3d88d40e4d5 --- /dev/null +++ b/insights/v1alpha2/zz_generated.crd-manifests/doc.go @@ -0,0 +1 @@ +package insights_v1alpha2_crdmanifests diff --git a/insights/v1alpha2/zz_generated.deepcopy.go b/insights/v1alpha2/zz_generated.deepcopy.go new file mode 100644 index 00000000000..b14c60b61e1 --- /dev/null +++ b/insights/v1alpha2/zz_generated.deepcopy.go @@ -0,0 +1,284 @@ +//go:build !ignore_autogenerated +// +build !ignore_autogenerated + +// Code generated by codegen. DO NOT EDIT. + +package v1alpha2 + +import ( + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + 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 *DataGather) DeepCopyInto(out *DataGather) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + in.Status.DeepCopyInto(&out.Status) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DataGather. +func (in *DataGather) DeepCopy() *DataGather { + if in == nil { + return nil + } + out := new(DataGather) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *DataGather) 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 *DataGatherList) DeepCopyInto(out *DataGatherList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]DataGather, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DataGatherList. +func (in *DataGatherList) DeepCopy() *DataGatherList { + if in == nil { + return nil + } + out := new(DataGatherList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *DataGatherList) 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 *DataGatherSpec) DeepCopyInto(out *DataGatherSpec) { + *out = *in + if in.Gatherers != nil { + in, out := &in.Gatherers, &out.Gatherers + *out = make([]GathererConfig, len(*in)) + copy(*out, *in) + } + if in.Storage != nil { + in, out := &in.Storage, &out.Storage + *out = new(Storage) + (*in).DeepCopyInto(*out) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DataGatherSpec. +func (in *DataGatherSpec) DeepCopy() *DataGatherSpec { + if in == nil { + return nil + } + out := new(DataGatherSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DataGatherStatus) DeepCopyInto(out *DataGatherStatus) { + *out = *in + if in.Conditions != nil { + in, out := &in.Conditions, &out.Conditions + *out = make([]v1.Condition, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.Gatherers != nil { + in, out := &in.Gatherers, &out.Gatherers + *out = make([]GathererStatus, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + in.StartTime.DeepCopyInto(&out.StartTime) + in.FinishTime.DeepCopyInto(&out.FinishTime) + if in.RelatedObjects != nil { + in, out := &in.RelatedObjects, &out.RelatedObjects + *out = make([]ObjectReference, len(*in)) + copy(*out, *in) + } + in.InsightsReport.DeepCopyInto(&out.InsightsReport) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DataGatherStatus. +func (in *DataGatherStatus) DeepCopy() *DataGatherStatus { + if in == nil { + return nil + } + out := new(DataGatherStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GathererConfig) DeepCopyInto(out *GathererConfig) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GathererConfig. +func (in *GathererConfig) DeepCopy() *GathererConfig { + if in == nil { + return nil + } + out := new(GathererConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GathererStatus) DeepCopyInto(out *GathererStatus) { + *out = *in + if in.Conditions != nil { + in, out := &in.Conditions, &out.Conditions + *out = make([]v1.Condition, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + out.LastGatherDuration = in.LastGatherDuration + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GathererStatus. +func (in *GathererStatus) DeepCopy() *GathererStatus { + if in == nil { + return nil + } + out := new(GathererStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *HealthCheck) DeepCopyInto(out *HealthCheck) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HealthCheck. +func (in *HealthCheck) DeepCopy() *HealthCheck { + if in == nil { + return nil + } + out := new(HealthCheck) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *InsightsReport) DeepCopyInto(out *InsightsReport) { + *out = *in + in.DownloadedAt.DeepCopyInto(&out.DownloadedAt) + if in.HealthChecks != nil { + in, out := &in.HealthChecks, &out.HealthChecks + *out = make([]HealthCheck, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new InsightsReport. +func (in *InsightsReport) DeepCopy() *InsightsReport { + if in == nil { + return nil + } + out := new(InsightsReport) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ObjectReference) DeepCopyInto(out *ObjectReference) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ObjectReference. +func (in *ObjectReference) DeepCopy() *ObjectReference { + if in == nil { + return nil + } + out := new(ObjectReference) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PersistentVolumeClaimReference) DeepCopyInto(out *PersistentVolumeClaimReference) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PersistentVolumeClaimReference. +func (in *PersistentVolumeClaimReference) DeepCopy() *PersistentVolumeClaimReference { + if in == nil { + return nil + } + out := new(PersistentVolumeClaimReference) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PersistentVolumeConfig) DeepCopyInto(out *PersistentVolumeConfig) { + *out = *in + out.Claim = in.Claim + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PersistentVolumeConfig. +func (in *PersistentVolumeConfig) DeepCopy() *PersistentVolumeConfig { + if in == nil { + return nil + } + out := new(PersistentVolumeConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Storage) DeepCopyInto(out *Storage) { + *out = *in + if in.PersistentVolume != nil { + in, out := &in.PersistentVolume, &out.PersistentVolume + *out = new(PersistentVolumeConfig) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Storage. +func (in *Storage) DeepCopy() *Storage { + if in == nil { + return nil + } + out := new(Storage) + in.DeepCopyInto(out) + return out +} diff --git a/insights/v1alpha2/zz_generated.featuregated-crd-manifests.yaml b/insights/v1alpha2/zz_generated.featuregated-crd-manifests.yaml new file mode 100644 index 00000000000..1f98d0fcf28 --- /dev/null +++ b/insights/v1alpha2/zz_generated.featuregated-crd-manifests.yaml @@ -0,0 +1,35 @@ +datagathers.insights.openshift.io: + Annotations: {} + ApprovedPRNumber: https://github.com/openshift/api/pull/1365 + CRDName: datagathers.insights.openshift.io + Capability: "" + Category: "" + FeatureGates: + - InsightsOnDemandDataGather + FilenameOperatorName: insights + FilenameOperatorOrdering: "01" + FilenameRunLevel: "0000_10" + GroupName: insights.openshift.io + HasStatus: true + KindName: DataGather + Labels: {} + PluralName: datagathers + PrinterColumns: + - description: DataGather job state + jsonPath: .status.dataGatherState + name: State + type: string + - description: DataGather start time + jsonPath: .status.startTime + name: StartTime + type: date + - description: DataGather finish time + jsonPath: .status.finishTime + name: FinishTime + type: date + Scope: Cluster + ShortNames: null + TopLevelFeatureGates: + - InsightsOnDemandDataGather + Version: v1alpha2 + diff --git a/insights/v1alpha2/zz_generated.featuregated-crd-manifests/datagathers.insights.openshift.io/InsightsOnDemandDataGather.yaml b/insights/v1alpha2/zz_generated.featuregated-crd-manifests/datagathers.insights.openshift.io/InsightsOnDemandDataGather.yaml new file mode 100644 index 00000000000..f315c4fe297 --- /dev/null +++ b/insights/v1alpha2/zz_generated.featuregated-crd-manifests/datagathers.insights.openshift.io/InsightsOnDemandDataGather.yaml @@ -0,0 +1,529 @@ +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + api-approved.openshift.io: https://github.com/openshift/api/pull/1365 + api.openshift.io/filename-cvo-runlevel: "0000_10" + api.openshift.io/filename-operator: insights + api.openshift.io/filename-ordering: "01" + feature-gate.release.openshift.io/InsightsOnDemandDataGather: "true" + name: datagathers.insights.openshift.io +spec: + group: insights.openshift.io + names: + kind: DataGather + listKind: DataGatherList + plural: datagathers + singular: datagather + scope: Cluster + versions: + - additionalPrinterColumns: + - description: DataGather job state + jsonPath: .status.dataGatherState + name: State + type: string + - description: DataGather start time + jsonPath: .status.startTime + name: StartTime + type: date + - description: DataGather finish time + jsonPath: .status.finishTime + name: FinishTime + type: date + name: v1alpha2 + schema: + openAPIV3Schema: + description: |- + DataGather provides data gather configuration options and status for the particular Insights data gathering. + + 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. + 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: spec holds user settable values for configuration + properties: + dataPolicy: + description: |- + dataPolicy allows user to enable additional global obfuscation of the IP addresses and base domain + in the Insights archive data. Valid values are "ClearText" and "ObfuscateNetworking". + When set to ClearText the data is not obfuscated. + When set to ObfuscateNetworking the IP addresses and the cluster domain name are obfuscated. + When omitted, this means no opinion and the platform is left to choose a reasonable default, which is subject to change over time. + The current default is ClearText. + enum: + - "" + - ClearText + - ObfuscateNetworking + type: string + gatherers: + description: |- + gatherers is an optional list of gatherers configurations. + The list must not exceed 100 items. + The particular gatherers IDs can be found at https://github.com/openshift/insights-operator/blob/master/docs/gathered-data.md. + Run the following command to get the names of last active gatherers: + "oc get insightsoperators.operator.openshift.io cluster -o json | jq '.status.gatherStatus.gatherers[].name'" + items: + description: gathererConfig allows to configure specific gatherers + properties: + name: + description: |- + name is the required name of specific gatherer + It must be at most 256 characters in length. + The format for the gatherer name should be: {gatherer}/{function} where the function is optional. + Gatherer consists of a lowercase letters only that may include underscores (_). + Function consists of a lowercase letters only that may include underscores (_) and is separated from the gatherer by a forward slash (/). + The particular gatherers can be found at https://github.com/openshift/insights-operator/blob/master/docs/gathered-data.md. + maxLength: 256 + type: string + x-kubernetes-validations: + - message: gatherer name must be in the format of {gatherer}/{function} + where the gatherer and function are lowercase letters only + that may include underscores (_) and are separated by a + forward slash (/) if the function is provided + rule: self.matches("^[a-z]+[_a-z]*[a-z]([/a-z][_a-z]*)?[a-z]$") + state: + description: |- + state allows you to configure specific gatherer. Valid values are "Enabled", "Disabled" and omitted. + When omitted, this means no opinion and the platform is left to choose a reasonable default. + The current default is Enabled. + enum: + - "" + - Enabled + - Disabled + type: string + required: + - name + type: object + maxItems: 100 + type: array + storage: + description: |- + storage is an optional field that allows user to define persistent storage for gathering jobs to store the Insights data archive. + If omitted, the gathering job will use ephemeral storage. + properties: + persistentVolume: + description: |- + persistentVolume is an optional field that specifies the PersistentVolume that will be used to store the Insights data archive. + The PersistentVolume must be created in the openshift-insights namespace. + properties: + claim: + description: |- + claim is a required field that specifies the configuration of the PersistentVolumeClaim that will be used to store the Insights data archive. + The PersistentVolumeClaim must be created in the openshift-insights namespace. + properties: + name: + description: |- + name is a string that follows the DNS1123 subdomain format. + It must be at most 253 characters in length, and must consist only of lower case alphanumeric characters, '-' and '.', and must start and end with an alphanumeric character. + maxLength: 253 + type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 subdomain must consist + of lower case alphanumeric characters, '-' or '.', + and must start and end with an alphanumeric character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' + required: + - name + type: object + mountPath: + description: |- + mountPath is an optional field specifying the directory where the PVC will be mounted inside the Insights data gathering Pod. + When omitted, this means no opinion and the platform is left to choose a reasonable default, which is subject to change over time. + The current default mount path is /var/lib/insights-operator + The path may not exceed 1024 characters and must not contain a colon. + maxLength: 1024 + type: string + x-kubernetes-validations: + - message: mountPath must not contain a colon + rule: '!self.contains('':'')' + required: + - claim + type: object + type: + description: |- + type is a required field that specifies the type of storage that will be used to store the Insights data archive. + Valid values are "PersistentVolume" and "Ephemeral". + When set to Ephemeral, the Insights data archive is stored in the ephemeral storage of the gathering job. + When set to PersistentVolume, the Insights data archive is stored in the PersistentVolume that is + defined by the PersistentVolume field. + enum: + - PersistentVolume + - Ephemeral + type: string + required: + - type + type: object + x-kubernetes-validations: + - message: persistentVolume is required when type is PersistentVolume, + and forbidden otherwise + rule: 'has(self.type) && self.type == ''PersistentVolume'' ? has(self.persistentVolume) + : !has(self.persistentVolume)' + type: object + status: + description: status holds observed values from the cluster. They may not + be overridden. + properties: + conditions: + description: conditions provide details on the status of the gatherer + job. + items: + description: Condition contains details for one aspect of the current + state of this API Resource. + properties: + lastTransitionTime: + description: |- + lastTransitionTime is the last time the condition transitioned from one status to another. + This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable. + format: date-time + type: string + message: + description: |- + message is a human readable message indicating details about the transition. + This may be an empty string. + maxLength: 32768 + type: string + observedGeneration: + description: |- + observedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + format: int64 + minimum: 0 + type: integer + reason: + description: |- + reason contains a programmatic identifier indicating the reason for the condition's last transition. + Producers of specific condition types may define expected values and meanings for this field, + and whether the values are considered a guaranteed API. + The value should be a CamelCase string. + This field may not be empty. + maxLength: 1024 + minLength: 1 + pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$ + type: string + status: + description: status of the condition, one of True, False, Unknown. + enum: + - "True" + - "False" + - Unknown + type: string + type: + description: type of condition in CamelCase or in foo.example.com/CamelCase. + maxLength: 316 + pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$ + type: string + required: + - lastTransitionTime + - message + - reason + - status + - type + type: object + maxItems: 100 + type: array + x-kubernetes-list-map-keys: + - type + x-kubernetes-list-type: map + dataGatherState: + description: dataGatherState reflects the current state of the data + gathering process. + enum: + - Running + - Completed + - Failed + - Pending + type: string + x-kubernetes-validations: + - message: dataGatherState cannot transition from Running to Pending + rule: '!(oldSelf == ''Running'' && self == ''Pending'')' + - message: dataGatherState cannot transition from Completed to Pending + rule: '!(oldSelf == ''Completed'' && self == ''Pending'')' + - message: dataGatherState cannot transition from Failed to Pending + rule: '!(oldSelf == ''Failed'' && self == ''Pending'')' + - message: dataGatherState cannot transition from Completed to Running + rule: '!(oldSelf == ''Completed'' && self == ''Running'')' + - message: dataGatherState cannot transition from Failed to Running + rule: '!(oldSelf == ''Failed'' && self == ''Running'')' + finishTime: + description: finishTime is the time when Insights data gathering finished. + format: date-time + type: string + x-kubernetes-validations: + - message: finishTime is immutable once set + rule: self == oldSelf + gatherers: + description: gatherers is a list of active gatherers (and their statuses) + in the last gathering. + items: + description: |- + gathererStatus represents information about a particular + data gatherer. + properties: + conditions: + description: conditions provide details on the status of each + gatherer. + items: + description: Condition contains details for one aspect of + the current state of this API Resource. + properties: + lastTransitionTime: + description: |- + lastTransitionTime is the last time the condition transitioned from one status to another. + This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable. + format: date-time + type: string + message: + description: |- + message is a human readable message indicating details about the transition. + This may be an empty string. + maxLength: 32768 + type: string + observedGeneration: + description: |- + observedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + format: int64 + minimum: 0 + type: integer + reason: + description: |- + reason contains a programmatic identifier indicating the reason for the condition's last transition. + Producers of specific condition types may define expected values and meanings for this field, + and whether the values are considered a guaranteed API. + The value should be a CamelCase string. + This field may not be empty. + maxLength: 1024 + minLength: 1 + pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$ + type: string + status: + description: status of the condition, one of True, False, + Unknown. + enum: + - "True" + - "False" + - Unknown + type: string + type: + description: type of condition in CamelCase or in foo.example.com/CamelCase. + maxLength: 316 + pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$ + type: string + required: + - lastTransitionTime + - message + - reason + - status + - type + type: object + maxItems: 100 + minItems: 1 + type: array + x-kubernetes-list-map-keys: + - type + x-kubernetes-list-type: map + lastGatherDuration: + description: lastGatherDuration represents the time spent gathering. + pattern: ^(([0-9]+(?:\.[0-9]+)?(ns|us|µs|μs|ms|s|m|h))+)$ + type: string + name: + description: name is the name of the gatherer. + maxLength: 256 + minLength: 5 + type: string + required: + - conditions + - lastGatherDuration + - name + type: object + maxItems: 100 + type: array + x-kubernetes-list-map-keys: + - name + x-kubernetes-list-type: map + insightsReport: + description: |- + insightsReport provides general Insights analysis results. + When omitted, this means no data gathering has taken place yet or the + corresponding Insights analysis (identified by "insightsRequestID") is not available. + properties: + downloadedAt: + description: |- + downloadedAt is the time when the last Insights report was downloaded. + An empty value means that there has not been any Insights report downloaded yet and + it usually appears in disconnected clusters (or clusters when the Insights data gathering is disabled). + format: date-time + type: string + healthChecks: + description: |- + healthChecks provides basic information about active Insights health checks + in a cluster. + items: + description: healthCheck represents an Insights health check + attributes. + properties: + advisorURI: + description: |- + advisorURI is required field that provides the URL link to the Insights Advisor. + The link must be a valid HTTPS URL and the maximum length is 2048 characters. + maxLength: 2048 + type: string + x-kubernetes-validations: + - message: advisorURI must be a valid HTTPS URL (e.g., https://example.com) + rule: isURL(self) && url(self).getScheme() == "https" + description: + description: description provides basic description of the + healtcheck. + maxLength: 2048 + minLength: 10 + type: string + state: + description: |- + state determines what the current state of the health check is. + Health check is enabled by default and can be disabled + by the user in the Insights advisor user interface. + enum: + - Enabled + - Disabled + type: string + totalRisk: + description: |- + totalRisk of the healthcheck. Indicator of the total risk posed + by the detected issue; combination of impact and likelihood. The values can be from 1 to 4, + and the higher the number, the more important the issue. + format: int32 + maximum: 4 + minimum: 1 + type: integer + required: + - advisorURI + - description + - state + - totalRisk + type: object + maxItems: 100 + type: array + x-kubernetes-list-type: atomic + uri: + description: |- + uri is optional field that provides the URL link from which the report was downloaded. + The link must be a valid HTTPS URL and the maximum length is 2048 characters. + maxLength: 2048 + type: string + x-kubernetes-validations: + - message: URI must be a valid HTTPS URL (e.g., https://example.com) + rule: isURL(self) && url(self).getScheme() == "https" + type: object + insightsRequestID: + description: |- + insightsRequestID is an Insights request ID to track the status of the + Insights analysis (in console.redhat.com processing pipeline) for the corresponding Insights data archive. + maxLength: 256 + type: string + x-kubernetes-validations: + - message: insightsRequestID is immutable once set + rule: self == oldSelf + relatedObjects: + description: |- + relatedObjects is a list of resources which are useful when debugging or inspecting the data + gathering Pod + items: + description: ObjectReference contains enough information to let + you inspect or modify the referred object. + properties: + group: + description: |- + group is the API Group of the Resource. + Enter empty string for the core group. + This value is empty or should follow the DNS1123 subdomain format and it must be at most 253 characters in length. + Example: "", "apps", "build.openshift.io", etc. + maxLength: 253 + type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 subdomain must consist of lower + case alphanumeric characters, '-' or '.', and must start + and end with an alphanumeric character. + rule: self.size() == 0 || !format.dns1123Subdomain().validate(self).hasValue() + name: + description: |- + name of the referent that follows the DNS1123 subdomain format. + It must be at most 256 characters in length. + maxLength: 256 + type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 subdomain must consist of lower + case alphanumeric characters, '-' or '.', and must start + and end with an alphanumeric character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' + namespace: + description: |- + namespace of the referent that follows the DNS1123 subdomain format. + It must be at most 253 characters in length. + maxLength: 253 + type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 subdomain must consist of lower + case alphanumeric characters, '-' or '.', and must start + and end with an alphanumeric character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' + resource: + description: |- + resource is required field of the type that is being referenced. + It is normally the plural form of the resource kind in lowercase. + This value should consist of only lowercase alphanumeric characters and hyphens. + Example: "deployments", "deploymentconfigs", "pods", etc. + maxLength: 512 + type: string + x-kubernetes-validations: + - message: resource must consist of only lowercase alphanumeric + characters and hyphens + rule: self.matches("^[a-z0-9]([-a-z0-9]*[a-z0-9])?$") + required: + - group + - name + - resource + type: object + maxItems: 100 + type: array + startTime: + description: startTime is the time when Insights data gathering started. + format: date-time + type: string + x-kubernetes-validations: + - message: startTime is immutable once set + rule: self == oldSelf + type: object + x-kubernetes-validations: + - message: cannot remove insightsRequestID attribute from status + rule: (!has(oldSelf.insightsRequestID) || has(self.insightsRequestID)) + - message: cannot remove startTime attribute from status + rule: (!has(oldSelf.startTime) || has(self.startTime)) + - message: cannot remove finishTime attribute from status + rule: (!has(oldSelf.finishTime) || has(self.finishTime)) + - message: cannot remove dataGatherState attribute from status + rule: (!has(oldSelf.dataGatherState) || has(self.dataGatherState)) + required: + - spec + type: object + served: true + storage: true + subresources: + status: {} diff --git a/insights/v1alpha2/zz_generated.swagger_doc_generated.go b/insights/v1alpha2/zz_generated.swagger_doc_generated.go new file mode 100644 index 00000000000..f45576a0ff4 --- /dev/null +++ b/insights/v1alpha2/zz_generated.swagger_doc_generated.go @@ -0,0 +1,147 @@ +package v1alpha2 + +// 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_DataGather = map[string]string{ + "": "\n\nDataGather provides data gather configuration options and status for the particular Insights data gathering.\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.", + "metadata": "metadata is the standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", + "spec": "spec holds user settable values for configuration", + "status": "status holds observed values from the cluster. They may not be overridden.", +} + +func (DataGather) SwaggerDoc() map[string]string { + return map_DataGather +} + +var map_DataGatherList = map[string]string{ + "": "DataGatherList is a collection of items\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.", + "metadata": "metadata is the standard list's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", + "items": "items contains a list of DataGather resources.", +} + +func (DataGatherList) SwaggerDoc() map[string]string { + return map_DataGatherList +} + +var map_DataGatherSpec = map[string]string{ + "": "DataGatherSpec contains the configuration for the DataGather.", + "dataPolicy": "dataPolicy allows user to enable additional global obfuscation of the IP addresses and base domain in the Insights archive data. Valid values are \"ClearText\" and \"ObfuscateNetworking\". When set to ClearText the data is not obfuscated. When set to ObfuscateNetworking the IP addresses and the cluster domain name are obfuscated. When omitted, this means no opinion and the platform is left to choose a reasonable default, which is subject to change over time. The current default is ClearText.", + "gatherers": "gatherers is an optional list of gatherers configurations. The list must not exceed 100 items. The particular gatherers IDs can be found at https://github.com/openshift/insights-operator/blob/master/docs/gathered-data.md. Run the following command to get the names of last active gatherers: \"oc get insightsoperators.operator.openshift.io cluster -o json | jq '.status.gatherStatus.gatherers[].name'\"", + "storage": "storage is an optional field that allows user to define persistent storage for gathering jobs to store the Insights data archive. If omitted, the gathering job will use ephemeral storage.", +} + +func (DataGatherSpec) SwaggerDoc() map[string]string { + return map_DataGatherSpec +} + +var map_DataGatherStatus = map[string]string{ + "": "DataGatherStatus contains information relating to the DataGather state.", + "conditions": "conditions provide details on the status of the gatherer job.", + "dataGatherState": "dataGatherState reflects the current state of the data gathering process.", + "gatherers": "gatherers is a list of active gatherers (and their statuses) in the last gathering.", + "startTime": "startTime is the time when Insights data gathering started.", + "finishTime": "finishTime is the time when Insights data gathering finished.", + "relatedObjects": "relatedObjects is a list of resources which are useful when debugging or inspecting the data gathering Pod", + "insightsRequestID": "insightsRequestID is an Insights request ID to track the status of the Insights analysis (in console.redhat.com processing pipeline) for the corresponding Insights data archive.", + "insightsReport": "insightsReport provides general Insights analysis results. When omitted, this means no data gathering has taken place yet or the corresponding Insights analysis (identified by \"insightsRequestID\") is not available.", +} + +func (DataGatherStatus) SwaggerDoc() map[string]string { + return map_DataGatherStatus +} + +var map_GathererConfig = map[string]string{ + "": "gathererConfig allows to configure specific gatherers", + "name": "name is the required name of specific gatherer It must be at most 256 characters in length. The format for the gatherer name should be: {gatherer}/{function} where the function is optional. Gatherer consists of a lowercase letters only that may include underscores (_). Function consists of a lowercase letters only that may include underscores (_) and is separated from the gatherer by a forward slash (/). The particular gatherers can be found at https://github.com/openshift/insights-operator/blob/master/docs/gathered-data.md.", + "state": "state allows you to configure specific gatherer. Valid values are \"Enabled\", \"Disabled\" and omitted. When omitted, this means no opinion and the platform is left to choose a reasonable default. The current default is Enabled.", +} + +func (GathererConfig) SwaggerDoc() map[string]string { + return map_GathererConfig +} + +var map_GathererStatus = map[string]string{ + "": "gathererStatus represents information about a particular data gatherer.", + "conditions": "conditions provide details on the status of each gatherer.", + "name": "name is the name of the gatherer.", + "lastGatherDuration": "lastGatherDuration represents the time spent gathering.", +} + +func (GathererStatus) SwaggerDoc() map[string]string { + return map_GathererStatus +} + +var map_HealthCheck = map[string]string{ + "": "healthCheck represents an Insights health check attributes.", + "description": "description provides basic description of the healtcheck.", + "totalRisk": "totalRisk of the healthcheck. Indicator of the total risk posed by the detected issue; combination of impact and likelihood. The values can be from 1 to 4, and the higher the number, the more important the issue.", + "advisorURI": "advisorURI is required field that provides the URL link to the Insights Advisor. The link must be a valid HTTPS URL and the maximum length is 2048 characters.", + "state": "state determines what the current state of the health check is. Health check is enabled by default and can be disabled by the user in the Insights advisor user interface.", +} + +func (HealthCheck) SwaggerDoc() map[string]string { + return map_HealthCheck +} + +var map_InsightsReport = map[string]string{ + "": "insightsReport provides Insights health check report based on the most recently sent Insights data.", + "downloadedAt": "downloadedAt is the time when the last Insights report was downloaded. An empty value means that there has not been any Insights report downloaded yet and it usually appears in disconnected clusters (or clusters when the Insights data gathering is disabled).", + "healthChecks": "healthChecks provides basic information about active Insights health checks in a cluster.", + "uri": "uri is optional field that provides the URL link from which the report was downloaded. The link must be a valid HTTPS URL and the maximum length is 2048 characters.", +} + +func (InsightsReport) SwaggerDoc() map[string]string { + return map_InsightsReport +} + +var map_ObjectReference = map[string]string{ + "": "ObjectReference contains enough information to let you inspect or modify the referred object.", + "group": "group is the API Group of the Resource. Enter empty string for the core group. This value is empty or should follow the DNS1123 subdomain format and it must be at most 253 characters in length. Example: \"\", \"apps\", \"build.openshift.io\", etc.", + "resource": "resource is required field of the type that is being referenced. It is normally the plural form of the resource kind in lowercase. This value should consist of only lowercase alphanumeric characters and hyphens. Example: \"deployments\", \"deploymentconfigs\", \"pods\", etc.", + "name": "name of the referent that follows the DNS1123 subdomain format. It must be at most 256 characters in length.", + "namespace": "namespace of the referent that follows the DNS1123 subdomain format. It must be at most 253 characters in length.", +} + +func (ObjectReference) SwaggerDoc() map[string]string { + return map_ObjectReference +} + +var map_PersistentVolumeClaimReference = map[string]string{ + "": "persistentVolumeClaimReference is a reference to a PersistentVolumeClaim.", + "name": "name is a string that follows the DNS1123 subdomain format. It must be at most 253 characters in length, and must consist only of lower case alphanumeric characters, '-' and '.', and must start and end with an alphanumeric character.", +} + +func (PersistentVolumeClaimReference) SwaggerDoc() map[string]string { + return map_PersistentVolumeClaimReference +} + +var map_PersistentVolumeConfig = map[string]string{ + "": "persistentVolumeConfig provides configuration options for PersistentVolume storage.", + "claim": "claim is a required field that specifies the configuration of the PersistentVolumeClaim that will be used to store the Insights data archive. The PersistentVolumeClaim must be created in the openshift-insights namespace.", + "mountPath": "mountPath is an optional field specifying the directory where the PVC will be mounted inside the Insights data gathering Pod. When omitted, this means no opinion and the platform is left to choose a reasonable default, which is subject to change over time. The current default mount path is /var/lib/insights-operator The path may not exceed 1024 characters and must not contain a colon.", +} + +func (PersistentVolumeConfig) SwaggerDoc() map[string]string { + return map_PersistentVolumeConfig +} + +var map_Storage = map[string]string{ + "": "storage provides persistent storage configuration options for gathering jobs. If the type is set to PersistentVolume, then the PersistentVolume must be defined. If the type is set to Ephemeral, then the PersistentVolume must not be defined.", + "type": "type is a required field that specifies the type of storage that will be used to store the Insights data archive. Valid values are \"PersistentVolume\" and \"Ephemeral\". When set to Ephemeral, the Insights data archive is stored in the ephemeral storage of the gathering job. When set to PersistentVolume, the Insights data archive is stored in the PersistentVolume that is defined by the PersistentVolume field.", + "persistentVolume": "persistentVolume is an optional field that specifies the PersistentVolume that will be used to store the Insights data archive. The PersistentVolume must be created in the openshift-insights namespace.", +} + +func (Storage) SwaggerDoc() map[string]string { + return map_Storage +} + +// AUTO-GENERATED FUNCTIONS END HERE diff --git a/openapi/generated_openapi/zz_generated.openapi.go b/openapi/generated_openapi/zz_generated.openapi.go index 51099694646..69354d54d91 100644 --- a/openapi/generated_openapi/zz_generated.openapi.go +++ b/openapi/generated_openapi/zz_generated.openapi.go @@ -566,6 +566,18 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA "github.com/openshift/api/insights/v1alpha1.PersistentVolumeClaimReference": schema_openshift_api_insights_v1alpha1_PersistentVolumeClaimReference(ref), "github.com/openshift/api/insights/v1alpha1.PersistentVolumeConfig": schema_openshift_api_insights_v1alpha1_PersistentVolumeConfig(ref), "github.com/openshift/api/insights/v1alpha1.Storage": schema_openshift_api_insights_v1alpha1_Storage(ref), + "github.com/openshift/api/insights/v1alpha2.DataGather": schema_openshift_api_insights_v1alpha2_DataGather(ref), + "github.com/openshift/api/insights/v1alpha2.DataGatherList": schema_openshift_api_insights_v1alpha2_DataGatherList(ref), + "github.com/openshift/api/insights/v1alpha2.DataGatherSpec": schema_openshift_api_insights_v1alpha2_DataGatherSpec(ref), + "github.com/openshift/api/insights/v1alpha2.DataGatherStatus": schema_openshift_api_insights_v1alpha2_DataGatherStatus(ref), + "github.com/openshift/api/insights/v1alpha2.GathererConfig": schema_openshift_api_insights_v1alpha2_GathererConfig(ref), + "github.com/openshift/api/insights/v1alpha2.GathererStatus": schema_openshift_api_insights_v1alpha2_GathererStatus(ref), + "github.com/openshift/api/insights/v1alpha2.HealthCheck": schema_openshift_api_insights_v1alpha2_HealthCheck(ref), + "github.com/openshift/api/insights/v1alpha2.InsightsReport": schema_openshift_api_insights_v1alpha2_InsightsReport(ref), + "github.com/openshift/api/insights/v1alpha2.ObjectReference": schema_openshift_api_insights_v1alpha2_ObjectReference(ref), + "github.com/openshift/api/insights/v1alpha2.PersistentVolumeClaimReference": schema_openshift_api_insights_v1alpha2_PersistentVolumeClaimReference(ref), + "github.com/openshift/api/insights/v1alpha2.PersistentVolumeConfig": schema_openshift_api_insights_v1alpha2_PersistentVolumeConfig(ref), + "github.com/openshift/api/insights/v1alpha2.Storage": schema_openshift_api_insights_v1alpha2_Storage(ref), "github.com/openshift/api/kubecontrolplane/v1.AggregatorConfig": schema_openshift_api_kubecontrolplane_v1_AggregatorConfig(ref), "github.com/openshift/api/kubecontrolplane/v1.KubeAPIServerConfig": schema_openshift_api_kubecontrolplane_v1_KubeAPIServerConfig(ref), "github.com/openshift/api/kubecontrolplane/v1.KubeAPIServerImagePolicyConfig": schema_openshift_api_kubecontrolplane_v1_KubeAPIServerImagePolicyConfig(ref), @@ -27586,6 +27598,563 @@ func schema_openshift_api_insights_v1alpha1_Storage(ref common.ReferenceCallback } } +func schema_openshift_api_insights_v1alpha2_DataGather(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "DataGather provides data gather configuration options and status for the particular Insights data gathering.\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.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "kind": { + SchemaProps: spec.SchemaProps{ + 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{"string"}, + Format: "", + }, + }, + "apiVersion": { + SchemaProps: spec.SchemaProps{ + 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{"string"}, + Format: "", + }, + }, + "metadata": { + SchemaProps: spec.SchemaProps{ + Description: "metadata is the standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", + Default: map[string]interface{}{}, + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"), + }, + }, + "spec": { + SchemaProps: spec.SchemaProps{ + Description: "spec holds user settable values for configuration", + Default: map[string]interface{}{}, + Ref: ref("github.com/openshift/api/insights/v1alpha2.DataGatherSpec"), + }, + }, + "status": { + SchemaProps: spec.SchemaProps{ + Description: "status holds observed values from the cluster. They may not be overridden.", + Default: map[string]interface{}{}, + Ref: ref("github.com/openshift/api/insights/v1alpha2.DataGatherStatus"), + }, + }, + }, + Required: []string{"spec"}, + }, + }, + Dependencies: []string{ + "github.com/openshift/api/insights/v1alpha2.DataGatherSpec", "github.com/openshift/api/insights/v1alpha2.DataGatherStatus", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"}, + } +} + +func schema_openshift_api_insights_v1alpha2_DataGatherList(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "DataGatherList is a collection of items\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.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "kind": { + SchemaProps: spec.SchemaProps{ + 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{"string"}, + Format: "", + }, + }, + "apiVersion": { + SchemaProps: spec.SchemaProps{ + 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{"string"}, + Format: "", + }, + }, + "metadata": { + SchemaProps: spec.SchemaProps{ + Description: "metadata is the standard list's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", + Default: map[string]interface{}{}, + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"), + }, + }, + "items": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "items contains a list of DataGather resources.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/openshift/api/insights/v1alpha2.DataGather"), + }, + }, + }, + }, + }, + }, + }, + }, + Dependencies: []string{ + "github.com/openshift/api/insights/v1alpha2.DataGather", "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"}, + } +} + +func schema_openshift_api_insights_v1alpha2_DataGatherSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "DataGatherSpec contains the configuration for the DataGather.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "dataPolicy": { + SchemaProps: spec.SchemaProps{ + Description: "dataPolicy allows user to enable additional global obfuscation of the IP addresses and base domain in the Insights archive data. Valid values are \"ClearText\" and \"ObfuscateNetworking\". When set to ClearText the data is not obfuscated. When set to ObfuscateNetworking the IP addresses and the cluster domain name are obfuscated. When omitted, this means no opinion and the platform is left to choose a reasonable default, which is subject to change over time. The current default is ClearText.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "gatherers": { + SchemaProps: spec.SchemaProps{ + Description: "gatherers is an optional list of gatherers configurations. The list must not exceed 100 items. The particular gatherers IDs can be found at https://github.com/openshift/insights-operator/blob/master/docs/gathered-data.md. Run the following command to get the names of last active gatherers: \"oc get insightsoperators.operator.openshift.io cluster -o json | jq '.status.gatherStatus.gatherers[].name'\"", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/openshift/api/insights/v1alpha2.GathererConfig"), + }, + }, + }, + }, + }, + "storage": { + SchemaProps: spec.SchemaProps{ + Description: "storage is an optional field that allows user to define persistent storage for gathering jobs to store the Insights data archive. If omitted, the gathering job will use ephemeral storage.", + Ref: ref("github.com/openshift/api/insights/v1alpha2.Storage"), + }, + }, + }, + }, + }, + Dependencies: []string{ + "github.com/openshift/api/insights/v1alpha2.GathererConfig", "github.com/openshift/api/insights/v1alpha2.Storage"}, + } +} + +func schema_openshift_api_insights_v1alpha2_DataGatherStatus(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "DataGatherStatus contains information relating to the DataGather state.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "conditions": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-map-keys": []interface{}{ + "type", + }, + "x-kubernetes-list-type": "map", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "conditions provide details on the status of the gatherer job.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Condition"), + }, + }, + }, + }, + }, + "dataGatherState": { + SchemaProps: spec.SchemaProps{ + Description: "dataGatherState reflects the current state of the data gathering process.", + Type: []string{"string"}, + Format: "", + }, + }, + "gatherers": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-map-keys": []interface{}{ + "name", + }, + "x-kubernetes-list-type": "map", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "gatherers is a list of active gatherers (and their statuses) in the last gathering.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/openshift/api/insights/v1alpha2.GathererStatus"), + }, + }, + }, + }, + }, + "startTime": { + SchemaProps: spec.SchemaProps{ + Description: "startTime is the time when Insights data gathering started.", + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Time"), + }, + }, + "finishTime": { + SchemaProps: spec.SchemaProps{ + Description: "finishTime is the time when Insights data gathering finished.", + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Time"), + }, + }, + "relatedObjects": { + SchemaProps: spec.SchemaProps{ + Description: "relatedObjects is a list of resources which are useful when debugging or inspecting the data gathering Pod", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/openshift/api/insights/v1alpha2.ObjectReference"), + }, + }, + }, + }, + }, + "insightsRequestID": { + SchemaProps: spec.SchemaProps{ + Description: "insightsRequestID is an Insights request ID to track the status of the Insights analysis (in console.redhat.com processing pipeline) for the corresponding Insights data archive.", + Type: []string{"string"}, + Format: "", + }, + }, + "insightsReport": { + SchemaProps: spec.SchemaProps{ + Description: "insightsReport provides general Insights analysis results. When omitted, this means no data gathering has taken place yet or the corresponding Insights analysis (identified by \"insightsRequestID\") is not available.", + Default: map[string]interface{}{}, + Ref: ref("github.com/openshift/api/insights/v1alpha2.InsightsReport"), + }, + }, + }, + }, + }, + Dependencies: []string{ + "github.com/openshift/api/insights/v1alpha2.GathererStatus", "github.com/openshift/api/insights/v1alpha2.InsightsReport", "github.com/openshift/api/insights/v1alpha2.ObjectReference", "k8s.io/apimachinery/pkg/apis/meta/v1.Condition", "k8s.io/apimachinery/pkg/apis/meta/v1.Time"}, + } +} + +func schema_openshift_api_insights_v1alpha2_GathererConfig(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "gathererConfig allows to configure specific gatherers", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "name": { + SchemaProps: spec.SchemaProps{ + Description: "name is the required name of specific gatherer It must be at most 256 characters in length. The format for the gatherer name should be: {gatherer}/{function} where the function is optional. Gatherer consists of a lowercase letters only that may include underscores (_). Function consists of a lowercase letters only that may include underscores (_) and is separated from the gatherer by a forward slash (/). The particular gatherers can be found at https://github.com/openshift/insights-operator/blob/master/docs/gathered-data.md.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "state": { + SchemaProps: spec.SchemaProps{ + Description: "state allows you to configure specific gatherer. Valid values are \"Enabled\", \"Disabled\" and omitted. When omitted, this means no opinion and the platform is left to choose a reasonable default. The current default is Enabled.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + Required: []string{"name"}, + }, + }, + } +} + +func schema_openshift_api_insights_v1alpha2_GathererStatus(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "gathererStatus represents information about a particular data gatherer.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "conditions": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-map-keys": []interface{}{ + "type", + }, + "x-kubernetes-list-type": "map", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "conditions provide details on the status of each gatherer.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Condition"), + }, + }, + }, + }, + }, + "name": { + SchemaProps: spec.SchemaProps{ + Description: "name is the name of the gatherer.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "lastGatherDuration": { + SchemaProps: spec.SchemaProps{ + Description: "lastGatherDuration represents the time spent gathering.", + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Duration"), + }, + }, + }, + Required: []string{"conditions", "name", "lastGatherDuration"}, + }, + }, + Dependencies: []string{ + "k8s.io/apimachinery/pkg/apis/meta/v1.Condition", "k8s.io/apimachinery/pkg/apis/meta/v1.Duration"}, + } +} + +func schema_openshift_api_insights_v1alpha2_HealthCheck(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "healthCheck represents an Insights health check attributes.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "description": { + SchemaProps: spec.SchemaProps{ + Description: "description provides basic description of the healtcheck.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "totalRisk": { + SchemaProps: spec.SchemaProps{ + Description: "totalRisk of the healthcheck. Indicator of the total risk posed by the detected issue; combination of impact and likelihood. The values can be from 1 to 4, and the higher the number, the more important the issue.", + Default: 0, + Type: []string{"integer"}, + Format: "int32", + }, + }, + "advisorURI": { + SchemaProps: spec.SchemaProps{ + Description: "advisorURI is required field that provides the URL link to the Insights Advisor. The link must be a valid HTTPS URL and the maximum length is 2048 characters.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "state": { + SchemaProps: spec.SchemaProps{ + Description: "state determines what the current state of the health check is. Health check is enabled by default and can be disabled by the user in the Insights advisor user interface.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + Required: []string{"description", "totalRisk", "advisorURI", "state"}, + }, + }, + } +} + +func schema_openshift_api_insights_v1alpha2_InsightsReport(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "insightsReport provides Insights health check report based on the most recently sent Insights data.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "downloadedAt": { + SchemaProps: spec.SchemaProps{ + Description: "downloadedAt is the time when the last Insights report was downloaded. An empty value means that there has not been any Insights report downloaded yet and it usually appears in disconnected clusters (or clusters when the Insights data gathering is disabled).", + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Time"), + }, + }, + "healthChecks": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "healthChecks provides basic information about active Insights health checks in a cluster.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/openshift/api/insights/v1alpha2.HealthCheck"), + }, + }, + }, + }, + }, + "uri": { + SchemaProps: spec.SchemaProps{ + Description: "uri is optional field that provides the URL link from which the report was downloaded. The link must be a valid HTTPS URL and the maximum length is 2048 characters.", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + Dependencies: []string{ + "github.com/openshift/api/insights/v1alpha2.HealthCheck", "k8s.io/apimachinery/pkg/apis/meta/v1.Time"}, + } +} + +func schema_openshift_api_insights_v1alpha2_ObjectReference(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "ObjectReference contains enough information to let you inspect or modify the referred object.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "group": { + SchemaProps: spec.SchemaProps{ + Description: "group is the API Group of the Resource. Enter empty string for the core group. This value is empty or should follow the DNS1123 subdomain format and it must be at most 253 characters in length. Example: \"\", \"apps\", \"build.openshift.io\", etc.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "resource": { + SchemaProps: spec.SchemaProps{ + Description: "resource is required field of the type that is being referenced. It is normally the plural form of the resource kind in lowercase. This value should consist of only lowercase alphanumeric characters and hyphens. Example: \"deployments\", \"deploymentconfigs\", \"pods\", etc.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "name": { + SchemaProps: spec.SchemaProps{ + Description: "name of the referent that follows the DNS1123 subdomain format. It must be at most 256 characters in length.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "namespace": { + SchemaProps: spec.SchemaProps{ + Description: "namespace of the referent that follows the DNS1123 subdomain format. It must be at most 253 characters in length.", + Type: []string{"string"}, + Format: "", + }, + }, + }, + Required: []string{"group", "resource", "name"}, + }, + }, + } +} + +func schema_openshift_api_insights_v1alpha2_PersistentVolumeClaimReference(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "persistentVolumeClaimReference is a reference to a PersistentVolumeClaim.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "name": { + SchemaProps: spec.SchemaProps{ + Description: "name is a string that follows the DNS1123 subdomain format. It must be at most 253 characters in length, and must consist only of lower case alphanumeric characters, '-' and '.', and must start and end with an alphanumeric character.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + Required: []string{"name"}, + }, + }, + } +} + +func schema_openshift_api_insights_v1alpha2_PersistentVolumeConfig(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "persistentVolumeConfig provides configuration options for PersistentVolume storage.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "claim": { + SchemaProps: spec.SchemaProps{ + Description: "claim is a required field that specifies the configuration of the PersistentVolumeClaim that will be used to store the Insights data archive. The PersistentVolumeClaim must be created in the openshift-insights namespace.", + Default: map[string]interface{}{}, + Ref: ref("github.com/openshift/api/insights/v1alpha2.PersistentVolumeClaimReference"), + }, + }, + "mountPath": { + SchemaProps: spec.SchemaProps{ + Description: "mountPath is an optional field specifying the directory where the PVC will be mounted inside the Insights data gathering Pod. When omitted, this means no opinion and the platform is left to choose a reasonable default, which is subject to change over time. The current default mount path is /var/lib/insights-operator The path may not exceed 1024 characters and must not contain a colon.", + Type: []string{"string"}, + Format: "", + }, + }, + }, + Required: []string{"claim"}, + }, + }, + Dependencies: []string{ + "github.com/openshift/api/insights/v1alpha2.PersistentVolumeClaimReference"}, + } +} + +func schema_openshift_api_insights_v1alpha2_Storage(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "storage provides persistent storage configuration options for gathering jobs. If the type is set to PersistentVolume, then the PersistentVolume must be defined. If the type is set to Ephemeral, then the PersistentVolume must not be defined.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "type": { + SchemaProps: spec.SchemaProps{ + Description: "type is a required field that specifies the type of storage that will be used to store the Insights data archive. Valid values are \"PersistentVolume\" and \"Ephemeral\". When set to Ephemeral, the Insights data archive is stored in the ephemeral storage of the gathering job. When set to PersistentVolume, the Insights data archive is stored in the PersistentVolume that is defined by the PersistentVolume field.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "persistentVolume": { + SchemaProps: spec.SchemaProps{ + Description: "persistentVolume is an optional field that specifies the PersistentVolume that will be used to store the Insights data archive. The PersistentVolume must be created in the openshift-insights namespace.", + Ref: ref("github.com/openshift/api/insights/v1alpha2.PersistentVolumeConfig"), + }, + }, + }, + Required: []string{"type"}, + }, + }, + Dependencies: []string{ + "github.com/openshift/api/insights/v1alpha2.PersistentVolumeConfig"}, + } +} + func schema_openshift_api_kubecontrolplane_v1_AggregatorConfig(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ diff --git a/openapi/openapi.json b/openapi/openapi.json index 4ffea45c1e4..a09ecf747d2 100644 --- a/openapi/openapi.json +++ b/openapi/openapi.json @@ -15432,6 +15432,335 @@ } } }, + "com.github.openshift.api.insights.v1alpha2.DataGather": { + "description": "DataGather provides data gather configuration options and status for the particular Insights data gathering.\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.", + "type": "object", + "required": [ + "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": { + "description": "metadata is the standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", + "default": {}, + "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta" + }, + "spec": { + "description": "spec holds user settable values for configuration", + "default": {}, + "$ref": "#/definitions/com.github.openshift.api.insights.v1alpha2.DataGatherSpec" + }, + "status": { + "description": "status holds observed values from the cluster. They may not be overridden.", + "default": {}, + "$ref": "#/definitions/com.github.openshift.api.insights.v1alpha2.DataGatherStatus" + } + } + }, + "com.github.openshift.api.insights.v1alpha2.DataGatherList": { + "description": "DataGatherList is a collection of items\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.", + "type": "object", + "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" + }, + "items": { + "description": "items contains a list of DataGather resources.", + "type": "array", + "items": { + "default": {}, + "$ref": "#/definitions/com.github.openshift.api.insights.v1alpha2.DataGather" + }, + "x-kubernetes-list-type": "atomic" + }, + "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": { + "description": "metadata is the standard list's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", + "default": {}, + "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.ListMeta" + } + } + }, + "com.github.openshift.api.insights.v1alpha2.DataGatherSpec": { + "description": "DataGatherSpec contains the configuration for the DataGather.", + "type": "object", + "properties": { + "dataPolicy": { + "description": "dataPolicy allows user to enable additional global obfuscation of the IP addresses and base domain in the Insights archive data. Valid values are \"ClearText\" and \"ObfuscateNetworking\". When set to ClearText the data is not obfuscated. When set to ObfuscateNetworking the IP addresses and the cluster domain name are obfuscated. When omitted, this means no opinion and the platform is left to choose a reasonable default, which is subject to change over time. The current default is ClearText.", + "type": "string", + "default": "" + }, + "gatherers": { + "description": "gatherers is an optional list of gatherers configurations. The list must not exceed 100 items. The particular gatherers IDs can be found at https://github.com/openshift/insights-operator/blob/master/docs/gathered-data.md. Run the following command to get the names of last active gatherers: \"oc get insightsoperators.operator.openshift.io cluster -o json | jq '.status.gatherStatus.gatherers[].name'\"", + "type": "array", + "items": { + "default": {}, + "$ref": "#/definitions/com.github.openshift.api.insights.v1alpha2.GathererConfig" + } + }, + "storage": { + "description": "storage is an optional field that allows user to define persistent storage for gathering jobs to store the Insights data archive. If omitted, the gathering job will use ephemeral storage.", + "$ref": "#/definitions/com.github.openshift.api.insights.v1alpha2.Storage" + } + } + }, + "com.github.openshift.api.insights.v1alpha2.DataGatherStatus": { + "description": "DataGatherStatus contains information relating to the DataGather state.", + "type": "object", + "properties": { + "conditions": { + "description": "conditions provide details on the status of the gatherer job.", + "type": "array", + "items": { + "default": {}, + "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.Condition" + }, + "x-kubernetes-list-map-keys": [ + "type" + ], + "x-kubernetes-list-type": "map" + }, + "dataGatherState": { + "description": "dataGatherState reflects the current state of the data gathering process.", + "type": "string" + }, + "finishTime": { + "description": "finishTime is the time when Insights data gathering finished.", + "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.Time" + }, + "gatherers": { + "description": "gatherers is a list of active gatherers (and their statuses) in the last gathering.", + "type": "array", + "items": { + "default": {}, + "$ref": "#/definitions/com.github.openshift.api.insights.v1alpha2.GathererStatus" + }, + "x-kubernetes-list-map-keys": [ + "name" + ], + "x-kubernetes-list-type": "map" + }, + "insightsReport": { + "description": "insightsReport provides general Insights analysis results. When omitted, this means no data gathering has taken place yet or the corresponding Insights analysis (identified by \"insightsRequestID\") is not available.", + "default": {}, + "$ref": "#/definitions/com.github.openshift.api.insights.v1alpha2.InsightsReport" + }, + "insightsRequestID": { + "description": "insightsRequestID is an Insights request ID to track the status of the Insights analysis (in console.redhat.com processing pipeline) for the corresponding Insights data archive.", + "type": "string" + }, + "relatedObjects": { + "description": "relatedObjects is a list of resources which are useful when debugging or inspecting the data gathering Pod", + "type": "array", + "items": { + "default": {}, + "$ref": "#/definitions/com.github.openshift.api.insights.v1alpha2.ObjectReference" + } + }, + "startTime": { + "description": "startTime is the time when Insights data gathering started.", + "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.Time" + } + } + }, + "com.github.openshift.api.insights.v1alpha2.GathererConfig": { + "description": "gathererConfig allows to configure specific gatherers", + "type": "object", + "required": [ + "name" + ], + "properties": { + "name": { + "description": "name is the required name of specific gatherer It must be at most 256 characters in length. The format for the gatherer name should be: {gatherer}/{function} where the function is optional. Gatherer consists of a lowercase letters only that may include underscores (_). Function consists of a lowercase letters only that may include underscores (_) and is separated from the gatherer by a forward slash (/). The particular gatherers can be found at https://github.com/openshift/insights-operator/blob/master/docs/gathered-data.md.", + "type": "string", + "default": "" + }, + "state": { + "description": "state allows you to configure specific gatherer. Valid values are \"Enabled\", \"Disabled\" and omitted. When omitted, this means no opinion and the platform is left to choose a reasonable default. The current default is Enabled.", + "type": "string", + "default": "" + } + } + }, + "com.github.openshift.api.insights.v1alpha2.GathererStatus": { + "description": "gathererStatus represents information about a particular data gatherer.", + "type": "object", + "required": [ + "conditions", + "name", + "lastGatherDuration" + ], + "properties": { + "conditions": { + "description": "conditions provide details on the status of each gatherer.", + "type": "array", + "items": { + "default": {}, + "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.Condition" + }, + "x-kubernetes-list-map-keys": [ + "type" + ], + "x-kubernetes-list-type": "map" + }, + "lastGatherDuration": { + "description": "lastGatherDuration represents the time spent gathering.", + "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.Duration" + }, + "name": { + "description": "name is the name of the gatherer.", + "type": "string", + "default": "" + } + } + }, + "com.github.openshift.api.insights.v1alpha2.HealthCheck": { + "description": "healthCheck represents an Insights health check attributes.", + "type": "object", + "required": [ + "description", + "totalRisk", + "advisorURI", + "state" + ], + "properties": { + "advisorURI": { + "description": "advisorURI is required field that provides the URL link to the Insights Advisor. The link must be a valid HTTPS URL and the maximum length is 2048 characters.", + "type": "string", + "default": "" + }, + "description": { + "description": "description provides basic description of the healtcheck.", + "type": "string", + "default": "" + }, + "state": { + "description": "state determines what the current state of the health check is. Health check is enabled by default and can be disabled by the user in the Insights advisor user interface.", + "type": "string", + "default": "" + }, + "totalRisk": { + "description": "totalRisk of the healthcheck. Indicator of the total risk posed by the detected issue; combination of impact and likelihood. The values can be from 1 to 4, and the higher the number, the more important the issue.", + "type": "integer", + "format": "int32", + "default": 0 + } + } + }, + "com.github.openshift.api.insights.v1alpha2.InsightsReport": { + "description": "insightsReport provides Insights health check report based on the most recently sent Insights data.", + "type": "object", + "properties": { + "downloadedAt": { + "description": "downloadedAt is the time when the last Insights report was downloaded. An empty value means that there has not been any Insights report downloaded yet and it usually appears in disconnected clusters (or clusters when the Insights data gathering is disabled).", + "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.Time" + }, + "healthChecks": { + "description": "healthChecks provides basic information about active Insights health checks in a cluster.", + "type": "array", + "items": { + "default": {}, + "$ref": "#/definitions/com.github.openshift.api.insights.v1alpha2.HealthCheck" + }, + "x-kubernetes-list-type": "atomic" + }, + "uri": { + "description": "uri is optional field that provides the URL link from which the report was downloaded. The link must be a valid HTTPS URL and the maximum length is 2048 characters.", + "type": "string" + } + } + }, + "com.github.openshift.api.insights.v1alpha2.ObjectReference": { + "description": "ObjectReference contains enough information to let you inspect or modify the referred object.", + "type": "object", + "required": [ + "group", + "resource", + "name" + ], + "properties": { + "group": { + "description": "group is the API Group of the Resource. Enter empty string for the core group. This value is empty or should follow the DNS1123 subdomain format and it must be at most 253 characters in length. Example: \"\", \"apps\", \"build.openshift.io\", etc.", + "type": "string", + "default": "" + }, + "name": { + "description": "name of the referent that follows the DNS1123 subdomain format. It must be at most 256 characters in length.", + "type": "string", + "default": "" + }, + "namespace": { + "description": "namespace of the referent that follows the DNS1123 subdomain format. It must be at most 253 characters in length.", + "type": "string" + }, + "resource": { + "description": "resource is required field of the type that is being referenced. It is normally the plural form of the resource kind in lowercase. This value should consist of only lowercase alphanumeric characters and hyphens. Example: \"deployments\", \"deploymentconfigs\", \"pods\", etc.", + "type": "string", + "default": "" + } + } + }, + "com.github.openshift.api.insights.v1alpha2.PersistentVolumeClaimReference": { + "description": "persistentVolumeClaimReference is a reference to a PersistentVolumeClaim.", + "type": "object", + "required": [ + "name" + ], + "properties": { + "name": { + "description": "name is a string that follows the DNS1123 subdomain format. It must be at most 253 characters in length, and must consist only of lower case alphanumeric characters, '-' and '.', and must start and end with an alphanumeric character.", + "type": "string", + "default": "" + } + } + }, + "com.github.openshift.api.insights.v1alpha2.PersistentVolumeConfig": { + "description": "persistentVolumeConfig provides configuration options for PersistentVolume storage.", + "type": "object", + "required": [ + "claim" + ], + "properties": { + "claim": { + "description": "claim is a required field that specifies the configuration of the PersistentVolumeClaim that will be used to store the Insights data archive. The PersistentVolumeClaim must be created in the openshift-insights namespace.", + "default": {}, + "$ref": "#/definitions/com.github.openshift.api.insights.v1alpha2.PersistentVolumeClaimReference" + }, + "mountPath": { + "description": "mountPath is an optional field specifying the directory where the PVC will be mounted inside the Insights data gathering Pod. When omitted, this means no opinion and the platform is left to choose a reasonable default, which is subject to change over time. The current default mount path is /var/lib/insights-operator The path may not exceed 1024 characters and must not contain a colon.", + "type": "string" + } + } + }, + "com.github.openshift.api.insights.v1alpha2.Storage": { + "description": "storage provides persistent storage configuration options for gathering jobs. If the type is set to PersistentVolume, then the PersistentVolume must be defined. If the type is set to Ephemeral, then the PersistentVolume must not be defined.", + "type": "object", + "required": [ + "type" + ], + "properties": { + "persistentVolume": { + "description": "persistentVolume is an optional field that specifies the PersistentVolume that will be used to store the Insights data archive. The PersistentVolume must be created in the openshift-insights namespace.", + "$ref": "#/definitions/com.github.openshift.api.insights.v1alpha2.PersistentVolumeConfig" + }, + "type": { + "description": "type is a required field that specifies the type of storage that will be used to store the Insights data archive. Valid values are \"PersistentVolume\" and \"Ephemeral\". When set to Ephemeral, the Insights data archive is stored in the ephemeral storage of the gathering job. When set to PersistentVolume, the Insights data archive is stored in the PersistentVolume that is defined by the PersistentVolume field.", + "type": "string", + "default": "" + } + } + }, "com.github.openshift.api.kubecontrolplane.v1.AggregatorConfig": { "description": "AggregatorConfig holds information required to make the aggregator function.", "type": "object", From 4bada1bb685b8d29a8b0ebb4b5c59984c7c9ea4a Mon Sep 17 00:00:00 2001 From: Ondrej Pokorny Date: Wed, 26 Mar 2025 11:02:01 +0100 Subject: [PATCH 2/3] feat: align DataGather with InsightsDataGather This commit aligns the configuration options of the DataGather CRD with those of InsightsDataGather, making it easier to use both CRDs. Signed-off-by: Ondrej Pokorny --- .../InsightsOnDemandDataGather.yaml | 208 +++++++++++++----- insights/v1alpha2/types_insights.go | 144 ++++++++---- ...ts_01_datagathers-CustomNoUpgrade.crd.yaml | 148 ++++++++----- ...1_datagathers-DevPreviewNoUpgrade.crd.yaml | 148 ++++++++----- ..._datagathers-TechPreviewNoUpgrade.crd.yaml | 148 ++++++++----- insights/v1alpha2/zz_generated.deepcopy.go | 49 ++++- ..._generated.featuregated-crd-manifests.yaml | 2 +- .../InsightsOnDemandDataGather.yaml | 148 ++++++++----- .../zz_generated.swagger_doc_generated.go | 27 ++- .../generated_openapi/zz_generated.openapi.go | 110 +++++++-- openapi/openapi.json | 69 ++++-- 11 files changed, 854 insertions(+), 347 deletions(-) diff --git a/insights/v1alpha2/tests/datagathers.insights.openshift.io/InsightsOnDemandDataGather.yaml b/insights/v1alpha2/tests/datagathers.insights.openshift.io/InsightsOnDemandDataGather.yaml index 47760d64f32..9eee96dc022 100644 --- a/insights/v1alpha2/tests/datagathers.insights.openshift.io/InsightsOnDemandDataGather.yaml +++ b/insights/v1alpha2/tests/datagathers.insights.openshift.io/InsightsOnDemandDataGather.yaml @@ -7,18 +7,22 @@ tests: onCreate: - name: Should be able to create a minimal DataGather initial: | - apiVersion: insights.openshift.io/v1alpha1 + apiVersion: insights.openshift.io/v1alpha2 kind: DataGather spec: {} # No spec is required for a DataGather expected: | - apiVersion: insights.openshift.io/v1alpha1 + apiVersion: insights.openshift.io/v1alpha2 kind: DataGather spec: {} - - name: Should be able to create a DataGather with a storage persistentVolume + - name: Should be able to create a DataGather with a storage persistentVolume, dataPolicy and gatherers initial: | - apiVersion: insights.openshift.io/v1alpha1 + apiVersion: insights.openshift.io/v1alpha2 kind: DataGather spec: + dataPolicy: + - WorkloadNames + gatherers: + mode: All storage: type: PersistentVolume persistentVolume: @@ -26,31 +30,98 @@ tests: claim: name: test-claim expected: | - apiVersion: insights.openshift.io/v1alpha1 + apiVersion: insights.openshift.io/v1alpha2 kind: DataGather spec: + dataPolicy: + - WorkloadNames + gatherers: + mode: All storage: type: PersistentVolume persistentVolume: mountPath: /data claim: name: test-claim - - name: Should be able to create a DataGather with a storage Epemeral + - name: Should be able to create a DataGather with a storage Epemeral, multitple DataPolicy options and gatherers initial: | - apiVersion: insights.openshift.io/v1alpha1 + apiVersion: insights.openshift.io/v1alpha2 kind: DataGather spec: + dataPolicy: + - ObfuscateNetworking + - WorkloadNames + gatherers: + mode: None storage: type: Ephemeral expected: | - apiVersion: insights.openshift.io/v1alpha1 + apiVersion: insights.openshift.io/v1alpha2 kind: DataGather spec: + dataPolicy: + - ObfuscateNetworking + - WorkloadNames + gatherers: + mode: None storage: type: Ephemeral + - name: Should be able to create DataGather with valid custom config + initial: | + apiVersion: insights.openshift.io/v1alpha2 + kind: DataGather + spec: + gatherers: + mode: Custom + custom: + configs: + - name: gatherer + state: Disabled + expected: | + apiVersion: insights.openshift.io/v1alpha2 + kind: DataGather + spec: + gatherers: + mode: Custom + custom: + configs: + - name: gatherer + state: Disabled + - name: When gatherers.mode is Custom then Custom must be present + initial: | + apiVersion: insights.openshift.io/v1alpha2 + kind: DataGather + spec: + gatherers: + mode: Custom + expectedError: 'Invalid value: "object": custom is required when mode is Custom, and forbidden otherwise' + - name: State must contain only valid values + initial: | + apiVersion: insights.openshift.io/v1alpha2 + kind: DataGather + spec: + gatherers: + mode: Custom + custom: + configs: + - name: gatherer + state: InvalidState + expectedError: 'spec.gatherers.custom.configs[0].state: Unsupported value: "InvalidState": supported values: "Enabled", "Disabled", ' + - name: Name must be in a described format + initial: | + apiVersion: insights.openshift.io/v1alpha2 + kind: DataGather + spec: + gatherers: + mode: Custom + custom: + configs: + - name: gatherer_1 + state: Enabled + expectedError: 'spec.gatherers.custom.configs[0].name: Invalid value: "string": gatherer name must be in the format of {gatherer}/{function} where the gatherer and function are lowercase letters only that may include underscores (_) and are separated by a forward slash (/) if the function is provided' - name: When storage.type is persistentVolume then PersistentVolume must be present initial: | - apiVersion: insights.openshift.io/v1alpha1 + apiVersion: insights.openshift.io/v1alpha2 kind: DataGather spec: storage: @@ -58,7 +129,7 @@ tests: expectedError: 'spec.storage: Invalid value: "object": persistentVolume is required when type is PersistentVolume, and forbidden otherwise' - name: When storage.type is not persistentVolume then PersistentVolume must not be present initial: | - apiVersion: insights.openshift.io/v1alpha1 + apiVersion: insights.openshift.io/v1alpha2 kind: DataGather spec: storage: @@ -69,7 +140,7 @@ tests: expectedError: 'spec.storage: Invalid value: "object": persistentVolume is required when type is PersistentVolume, and forbidden otherwise' - name: mountPath must not contain colon initial: | - apiVersion: insights.openshift.io/v1alpha1 + apiVersion: insights.openshift.io/v1alpha2 kind: DataGather spec: storage: @@ -81,7 +152,7 @@ tests: expectedError: 'spec.storage.persistentVolume.mountPath: Invalid value: "string": mountPath must not contain a colon' - name: storage.type is required initial: | - apiVersion: insights.openshift.io/v1alpha1 + apiVersion: insights.openshift.io/v1alpha2 kind: DataGather spec: storage: @@ -92,7 +163,7 @@ tests: expectedError: "spec.storage.type: Required value" - name: storage.persistentVolume.claim can not be empty initial: | - apiVersion: insights.openshift.io/v1alpha1 + apiVersion: insights.openshift.io/v1alpha2 kind: DataGather spec: storage: @@ -103,7 +174,7 @@ tests: expectedError: "spec.storage.persistentVolume.claim: Required value" - name: persistentVolumeClaim must follow the naming convention initial: | - apiVersion: insights.openshift.io/v1alpha1 + apiVersion: insights.openshift.io/v1alpha2 kind: DataGather spec: storage: @@ -112,23 +183,40 @@ tests: claim: name: INVALID_PVC_NAME expectedError: 'Invalid value: "string": a lowercase RFC 1123 subdomain must consist of lower case alphanumeric characters, ''-'' or ''.'', and must start and end with an alphanumeric character.' + - name: dataPolicy must be one of a valid values + initial: | + apiVersion: insights.openshift.io/v1alpha2 + kind: DataGather + spec: + dataPolicy: + - InvalidValue + expectedError: 'spec.dataPolicy[0]: Unsupported value: "InvalidValue": supported values: "ObfuscateNetworking", "WorkloadNames", ' + - name: dataPolicy must not contain duplicates + initial: | + apiVersion: insights.openshift.io/v1alpha2 + kind: DataGather + spec: + dataPolicy: + - WorkloadNames + - WorkloadNames + expectedError: 'invalid: spec.dataPolicy: Invalid value: "array": dataPolicy items must be unique' onUpdate: - name: status is present and startTime is added initial: | - apiVersion: insights.openshift.io/v1alpha1 + apiVersion: insights.openshift.io/v1alpha2 kind: DataGather spec: {} # No spec is required for a DataGather status: insightsRequestID: xyz updated: | - apiVersion: insights.openshift.io/v1alpha1 + apiVersion: insights.openshift.io/v1alpha2 kind: DataGather spec: {} # No spec is required for a DataGather status: insightsRequestID: xyz startTime: 2023-03-13T11:34:06Z expected: | - apiVersion: insights.openshift.io/v1alpha1 + apiVersion: insights.openshift.io/v1alpha2 kind: DataGather spec: {} # No spec is required for a DataGather status: @@ -136,14 +224,14 @@ tests: startTime: 2023-03-13T11:34:06Z - name: startTime cannot be removed from status initial: | - apiVersion: insights.openshift.io/v1alpha1 + apiVersion: insights.openshift.io/v1alpha2 kind: DataGather spec: {} # No spec is required for a DataGather status: insightsRequestID: xyz startTime: 2023-03-13T11:34:06Z updated: | - apiVersion: insights.openshift.io/v1alpha1 + apiVersion: insights.openshift.io/v1alpha2 kind: DataGather spec: {} # No spec is required for a DataGather status: @@ -151,14 +239,14 @@ tests: expectedStatusError: 'status: Invalid value: "object": cannot remove startTime attribute from status' - name: startTime is immutable once set initial: | - apiVersion: insights.openshift.io/v1alpha1 + apiVersion: insights.openshift.io/v1alpha2 kind: DataGather spec: {} # No spec is required for a DataGather status: insightsRequestID: xyz startTime: 2023-03-13T11:34:06Z updated: | - apiVersion: insights.openshift.io/v1alpha1 + apiVersion: insights.openshift.io/v1alpha2 kind: DataGather spec: {} # No spec is required for a DataGather status: @@ -167,7 +255,7 @@ tests: expectedStatusError: 'Invalid value: "string": startTime is immutable once set' - name: Status is present and insightsRequestID is added initial: | - apiVersion: insights.openshift.io/v1alpha1 + apiVersion: insights.openshift.io/v1alpha2 kind: DataGather spec: {} # No spec is required for a DataGather status: @@ -177,7 +265,7 @@ tests: group: "" namespace: "openshift-insights" updated: | - apiVersion: insights.openshift.io/v1alpha1 + apiVersion: insights.openshift.io/v1alpha2 kind: DataGather spec: {} # No spec is required for a DataGather status: @@ -188,7 +276,7 @@ tests: group: "" namespace: "openshift-insights" expected: | - apiVersion: insights.openshift.io/v1alpha1 + apiVersion: insights.openshift.io/v1alpha2 kind: DataGather spec: {} # No spec is required for a DataGather status: @@ -200,7 +288,7 @@ tests: namespace: "openshift-insights" - name: insightsRequestID cannot be removed from status initial: | - apiVersion: insights.openshift.io/v1alpha1 + apiVersion: insights.openshift.io/v1alpha2 kind: DataGather spec: {} # No spec is required for a DataGather status: @@ -211,7 +299,7 @@ tests: resource: "pods" namespace: "openshift-insights" updated: | - apiVersion: insights.openshift.io/v1alpha1 + apiVersion: insights.openshift.io/v1alpha2 kind: DataGather spec: {} # No spec is required for a DataGather status: @@ -223,7 +311,7 @@ tests: expectedStatusError: 'status: Invalid value: "object": cannot remove insightsRequestID attribute from status' - name: insightsRequestID is immutable once set initial: | - apiVersion: insights.openshift.io/v1alpha1 + apiVersion: insights.openshift.io/v1alpha2 kind: DataGather spec: {} # No spec is required for a DataGather status: @@ -234,7 +322,7 @@ tests: resource: "pods" namespace: "openshift-insights" updated: | - apiVersion: insights.openshift.io/v1alpha1 + apiVersion: insights.openshift.io/v1alpha2 kind: DataGather spec: {} # No spec is required for a DataGather status: @@ -247,7 +335,7 @@ tests: expectedStatusError: 'Invalid value: "string": insightsRequestID is immutable once set' - name: finishTime cannot be removed from status initial: | - apiVersion: insights.openshift.io/v1alpha1 + apiVersion: insights.openshift.io/v1alpha2 kind: DataGather spec: {} # No spec is required for a DataGather status: @@ -258,7 +346,7 @@ tests: resource: "pods" namespace: "openshift-insights" updated: | - apiVersion: insights.openshift.io/v1alpha1 + apiVersion: insights.openshift.io/v1alpha2 kind: DataGather spec: {} # No spec is required for a DataGather status: @@ -270,13 +358,13 @@ tests: expectedStatusError: 'status: Invalid value: "object": cannot remove finishTime attribute from status' - name: dataGatherState cannot be removed from status initial: | - apiVersion: insights.openshift.io/v1alpha1 + apiVersion: insights.openshift.io/v1alpha2 kind: DataGather spec: {} # No spec is required for a DataGather status: dataGatherState: Running updated: | - apiVersion: insights.openshift.io/v1alpha1 + apiVersion: insights.openshift.io/v1alpha2 kind: DataGather spec: {} # No spec is required for a DataGather status: @@ -288,13 +376,13 @@ tests: expectedStatusError: 'status: Invalid value: "object": cannot remove dataGatherState attribute from status' - name: dataGatherState cannot transition from Running to Pending initial: | - apiVersion: insights.openshift.io/v1alpha1 + apiVersion: insights.openshift.io/v1alpha2 kind: DataGather spec: {} # No spec is required for a DataGather status: dataGatherState: Running updated: | - apiVersion: insights.openshift.io/v1alpha1 + apiVersion: insights.openshift.io/v1alpha2 kind: DataGather spec: {} # No spec is required for a DataGather status: @@ -302,13 +390,13 @@ tests: expectedStatusError: 'status.dataGatherState: Invalid value: "string": dataGatherState cannot transition from Running to Pending' - name: dataGatherState cannot transition from Completed to Pending initial: | - apiVersion: insights.openshift.io/v1alpha1 + apiVersion: insights.openshift.io/v1alpha2 kind: DataGather spec: {} # No spec is required for a DataGather status: dataGatherState: Completed updated: | - apiVersion: insights.openshift.io/v1alpha1 + apiVersion: insights.openshift.io/v1alpha2 kind: DataGather spec: {} # No spec is required for a DataGather status: @@ -316,13 +404,13 @@ tests: expectedStatusError: 'status.dataGatherState: Invalid value: "string": dataGatherState cannot transition from Completed to Pending' - name: dataGatherState cannot transition from Failed to Pending initial: | - apiVersion: insights.openshift.io/v1alpha1 + apiVersion: insights.openshift.io/v1alpha2 kind: DataGather spec: {} # No spec is required for a DataGather status: dataGatherState: Failed updated: | - apiVersion: insights.openshift.io/v1alpha1 + apiVersion: insights.openshift.io/v1alpha2 kind: DataGather spec: {} # No spec is required for a DataGather status: @@ -330,13 +418,13 @@ tests: expectedStatusError: 'status.dataGatherState: Invalid value: "string": dataGatherState cannot transition from Failed to Pending' - name: dataGatherState cannot transition from Completed to Running initial: | - apiVersion: insights.openshift.io/v1alpha1 + apiVersion: insights.openshift.io/v1alpha2 kind: DataGather spec: {} # No spec is required for a DataGather status: dataGatherState: Completed updated: | - apiVersion: insights.openshift.io/v1alpha1 + apiVersion: insights.openshift.io/v1alpha2 kind: DataGather spec: {} # No spec is required for a DataGather status: @@ -344,13 +432,13 @@ tests: expectedStatusError: 'status.dataGatherState: Invalid value: "string": dataGatherState cannot transition from Completed to Running' - name: dataGatherState cannot transition from Failed to Running initial: | - apiVersion: insights.openshift.io/v1alpha1 + apiVersion: insights.openshift.io/v1alpha2 kind: DataGather spec: {} # No spec is required for a DataGather status: dataGatherState: Failed updated: | - apiVersion: insights.openshift.io/v1alpha1 + apiVersion: insights.openshift.io/v1alpha2 kind: DataGather spec: {} # No spec is required for a DataGather status: @@ -358,11 +446,11 @@ tests: expectedStatusError: 'status.dataGatherState: Invalid value: "string": dataGatherState cannot transition from Failed to Running' - name: lastGatherDuration can be updated with a trailing zero value initial: | - apiVersion: insights.openshift.io/v1alpha1 + apiVersion: insights.openshift.io/v1alpha2 kind: DataGather spec: {} # No spec is required for a DataGather updated: | - apiVersion: insights.openshift.io/v1alpha1 + apiVersion: insights.openshift.io/v1alpha2 kind: DataGather spec: {} # No spec is required for a DataGather status: @@ -376,7 +464,7 @@ tests: message: "test message" lastTransitionTime: "2024-12-01T08:04:21Z" expected: | - apiVersion: insights.openshift.io/v1alpha1 + apiVersion: insights.openshift.io/v1alpha2 kind: DataGather spec: {} # No spec is required for a DataGather status: @@ -391,11 +479,11 @@ tests: lastTransitionTime: "2024-12-01T08:04:21Z" - name: lastGatherDuration can be updated with a leading zero value initial: | - apiVersion: insights.openshift.io/v1alpha1 + apiVersion: insights.openshift.io/v1alpha2 kind: DataGather spec: {} # No spec is required for a DataGather updated: | - apiVersion: insights.openshift.io/v1alpha1 + apiVersion: insights.openshift.io/v1alpha2 kind: DataGather spec: {} # No spec is required for a DataGather status: @@ -409,7 +497,7 @@ tests: message: "test message" lastTransitionTime: "2024-12-01T08:04:21Z" expected: | - apiVersion: insights.openshift.io/v1alpha1 + apiVersion: insights.openshift.io/v1alpha2 kind: DataGather spec: {} # No spec is required for a DataGather status: @@ -424,11 +512,11 @@ tests: lastTransitionTime: "2024-12-01T08:04:21Z" - name: lastGatherDuration can be updated with a decimal number value initial: | - apiVersion: insights.openshift.io/v1alpha1 + apiVersion: insights.openshift.io/v1alpha2 kind: DataGather spec: {} # No spec is required for a DataGather updated: | - apiVersion: insights.openshift.io/v1alpha1 + apiVersion: insights.openshift.io/v1alpha2 kind: DataGather spec: {} # No spec is required for a DataGather status: @@ -442,7 +530,7 @@ tests: message: "test message" lastTransitionTime: "2024-12-01T08:04:21Z" expected: | - apiVersion: insights.openshift.io/v1alpha1 + apiVersion: insights.openshift.io/v1alpha2 kind: DataGather spec: {} # No spec is required for a DataGather status: @@ -457,11 +545,11 @@ tests: lastTransitionTime: "2024-12-01T08:04:21Z" - name: lastGatherDuration cannot be updated with an invalid value initial: | - apiVersion: insights.openshift.io/v1alpha1 + apiVersion: insights.openshift.io/v1alpha2 kind: DataGather spec: {} # No spec is required for a DataGather updated: | - apiVersion: insights.openshift.io/v1alpha1 + apiVersion: insights.openshift.io/v1alpha2 kind: DataGather spec: {} # No spec is required for a DataGather status: @@ -477,11 +565,11 @@ tests: expectedStatusError: "Invalid value: \"1d2h\": gatherers[0].lastGatherDuration in body should match '^(([0-9]+(?:\\.[0-9]+)?(ns|us|µs|μs|ms|s|m|h))+)$'" - name: lastGatherDuration cannot be updated with a negative value initial: | - apiVersion: insights.openshift.io/v1alpha1 + apiVersion: insights.openshift.io/v1alpha2 kind: DataGather spec: {} # No spec is required for a DataGather updated: | - apiVersion: insights.openshift.io/v1alpha1 + apiVersion: insights.openshift.io/v1alpha2 kind: DataGather spec: {} # No spec is required for a DataGather status: @@ -497,11 +585,11 @@ tests: expectedStatusError: "Invalid value: \"-0m5s\": gatherers[0].lastGatherDuration in body should match '^(([0-9]+(?:\\.[0-9]+)?(ns|us|µs|μs|ms|s|m|h))+)$'" - name: should not be updated with URL that is not HTTPS initial: | - apiVersion: insights.openshift.io/v1alpha1 + apiVersion: insights.openshift.io/v1alpha2 kind: DataGather spec: {} # No spec is required for a DataGather updated: | - apiVersion: insights.openshift.io/v1alpha1 + apiVersion: insights.openshift.io/v1alpha2 kind: DataGather spec: {} # No spec is required for a DataGather status: @@ -510,18 +598,18 @@ tests: expectedStatusError: 'status.insightsReport.uri: Invalid value: "string": URI must be a valid HTTPS URL (e.g., https://example.com)' - name: should be updated with a valid HTTPS URL initial: | - apiVersion: insights.openshift.io/v1alpha1 + apiVersion: insights.openshift.io/v1alpha2 kind: DataGather spec: {} # No spec is required for a DataGather updated: | - apiVersion: insights.openshift.io/v1alpha1 + apiVersion: insights.openshift.io/v1alpha2 kind: DataGather spec: {} # No spec is required for a DataGather status: insightsReport: uri: https://example.com expected: | - apiVersion: insights.openshift.io/v1alpha1 + apiVersion: insights.openshift.io/v1alpha2 kind: DataGather spec: {} # No spec is required for a DataGather status: diff --git a/insights/v1alpha2/types_insights.go b/insights/v1alpha2/types_insights.go index 537c73442bc..176785304ef 100644 --- a/insights/v1alpha2/types_insights.go +++ b/insights/v1alpha2/types_insights.go @@ -10,7 +10,7 @@ import ( // +kubebuilder:object:root=true // +kubebuilder:resource:path=datagathers,scope=Cluster // +kubebuilder:subresource:status -// +openshift:api-approved.openshift.io=https://github.com/openshift/api/pull/1365 +// +openshift:api-approved.openshift.io=https://github.com/openshift/api/pull/2248 // +openshift:file-pattern=cvoRunLevel=0000_10,operatorName=insights,operatorOrdering=01 // +openshift:enable:FeatureGate=InsightsOnDemandDataGather // +kubebuilder:printcolumn:name=State,type=string,JSONPath=.status.dataGatherState,description=DataGather job state @@ -37,28 +37,71 @@ type DataGather struct { // DataGatherSpec contains the configuration for the DataGather. type DataGatherSpec struct { - // dataPolicy allows user to enable additional global obfuscation of the IP addresses and base domain - // in the Insights archive data. Valid values are "ClearText" and "ObfuscateNetworking". - // When set to ClearText the data is not obfuscated. + // dataPolicy is an optional list of DataPolicyOptions that allows user to enable additional obfuscation of the Insights archive data. + // It may not exceed 2 items and must not contain duplicates. + // Valid values are ObfuscateNetworking and WorkloadNames. // When set to ObfuscateNetworking the IP addresses and the cluster domain name are obfuscated. - // When omitted, this means no opinion and the platform is left to choose a reasonable default, which is subject to change over time. - // The current default is ClearText. + // When set to WorkloadNames, the gathered data about cluster resources will not contain the workload names for your deployments. Resources UIDs will be used instead. + // When omitted no obfuscation is applied. + // +kubebuilder:validation:MaxItems=2 + // +kubebuilder:validation:XValidation:rule="self.all(x, self.exists_one(y, x == y))",message="dataPolicy items must be unique" + // +listType=atomic // +optional - DataPolicy DataPolicy `json:"dataPolicy"` - // gatherers is an optional list of gatherers configurations. - // The list must not exceed 100 items. - // The particular gatherers IDs can be found at https://github.com/openshift/insights-operator/blob/master/docs/gathered-data.md. - // Run the following command to get the names of last active gatherers: - // "oc get insightsoperators.operator.openshift.io cluster -o json | jq '.status.gatherStatus.gatherers[].name'" - // +kubebuilder:validation:MaxItems=100 + DataPolicy []DataPolicyOption `json:"dataPolicy"` + // gatherers is an optional field that specifies the configuration of the gatherers. // +optional - Gatherers []GathererConfig `json:"gatherers,omitempty"` + Gatherers Gatherers `json:"gatherers,omitempty"` // storage is an optional field that allows user to define persistent storage for gathering jobs to store the Insights data archive. // If omitted, the gathering job will use ephemeral storage. // +optional Storage *Storage `json:"storage,omitempty"` } +// Gathereres specifies the configuration of the gatherers +// +kubebuilder:validation:XValidation:rule="has(self.mode) && self.mode == 'Custom' ? has(self.custom) : !has(self.custom)",message="custom is required when mode is Custom, and forbidden otherwise" +type Gatherers struct { + // mode is a required field that specifies the mode for gatherers. Allowed values are All, None, and Custom. + // When set to All, all gatherers wil run and gather data. + // When set to None, all gatherers will be disabled and no data will be gathered. + // When set to Custom, the custom configuration from the custom field will be applied. + // +required + Mode GatheringMode `json:"mode"` + // custom provides gathering configuration. + // It is required when mode is Custom, and forbidden otherwise. + // Custom configuration allows user to disable only a subset of gatherers. + // Gatherers that are not explicitly disabled in custom configuration will run. + // +optional + Custom *Custom `json:"custom,omitempty"` +} + +// custom provides the custom configuration of gatherers +type Custom struct { + // configs is a required list of gatherers configurations that can be used to enable or disable specific gatherers. + // It may not exceed 100 items and each gatherer can be present only once. + // It is possible to disable an entire set of gatherers while allowing a specific function within that set. + // The particular gatherers IDs can be found at https://github.com/openshift/insights-operator/blob/master/docs/gathered-data.md. + // Run the following command to get the names of last active gatherers: + // "oc get insightsoperators.operator.openshift.io cluster -o json | jq '.status.gatherStatus.gatherers[].name'" + // +kubebuilder:validation:MaxItems=100 + // +listType=map + // +listMapKey=name + // +required + Configs []GathererConfig `json:"configs"` +} + +// gatheringMode defines the valid gathering modes. +// +kubebuilder:validation:Enum=All;None;Custom +type GatheringMode string + +const ( + // Enabled enables all gatherers + GatheringModeAll GatheringMode = "All" + // Disabled disables all gatherers + GatheringModeNone GatheringMode = "None" + // Custom applies the configuration from GatheringConfig. + GatheringModeCustom GatheringMode = "Custom" +) + // storage provides persistent storage configuration options for gathering jobs. // If the type is set to PersistentVolume, then the PersistentVolume must be defined. // If the type is set to Ephemeral, then the PersistentVolume must not be defined. @@ -114,52 +157,49 @@ type PersistentVolumeClaimReference struct { Name string `json:"name"` } +// dataPolicyOption declares valid data policy types +// +kubebuilder:validation:Enum=ObfuscateNetworking;WorkloadNames +type DataPolicyOption string + const ( - // No data obfuscation - NoPolicy DataPolicy = "ClearText" // IP addresses and cluster domain name are obfuscated - ObfuscateNetworking DataPolicy = "ObfuscateNetworking" - // Data gathering is running - Running DataGatherState = "Running" - // Data gathering is completed - Completed DataGatherState = "Completed" - // Data gathering failed - Failed DataGatherState = "Failed" - // Data gathering is pending - Pending DataGatherState = "Pending" - // Gatherer state marked as disabled, which means that the gatherer will not run. - Disabled GathererState = "Disabled" - // Gatherer state marked as enabled, which means that the gatherer will run. - Enabled GathererState = "Enabled" + DataPolicyOptionObfuscateNetworking DataPolicyOption = "ObfuscateNetworking" + // Data from Deployment Validation Operator are obfuscated + DataPolicyOptionObfuscateWorkloadNames DataPolicyOption = "WorkloadNames" ) -// dataPolicy declares valid data policy types -// +kubebuilder:validation:Enum="";ClearText;ObfuscateNetworking -type DataPolicy string - -// state declares valid gatherer state types. -// +kubebuilder:validation:Enum="";Enabled;Disabled -type GathererState string - // gathererConfig allows to configure specific gatherers type GathererConfig struct { - // name is the required name of specific gatherer - // It must be at most 256 characters in length. - // The format for the gatherer name should be: {gatherer}/{function} where the function is optional. + // name is the required name of a specific gatherer + // It may not exceed 256 characters. + // The format for a gatherer name is: {gatherer}/{function} where the function is optional. // Gatherer consists of a lowercase letters only that may include underscores (_). // Function consists of a lowercase letters only that may include underscores (_) and is separated from the gatherer by a forward slash (/). // The particular gatherers can be found at https://github.com/openshift/insights-operator/blob/master/docs/gathered-data.md. + // Run the following command to get the names of last active gatherers: + // "oc get insightsoperators.operator.openshift.io cluster -o json | jq '.status.gatherStatus.gatherers[].name'" // +kubebuilder:validation:MaxLength=256 // +kubebuilder:validation:XValidation:rule=`self.matches("^[a-z]+[_a-z]*[a-z]([/a-z][_a-z]*)?[a-z]$")`,message=`gatherer name must be in the format of {gatherer}/{function} where the gatherer and function are lowercase letters only that may include underscores (_) and are separated by a forward slash (/) if the function is provided` // +required Name string `json:"name"` - // state allows you to configure specific gatherer. Valid values are "Enabled", "Disabled" and omitted. - // When omitted, this means no opinion and the platform is left to choose a reasonable default. - // The current default is Enabled. - // +optional + // state is a required field that allows you to configure specific gatherer. Valid values are "Enabled" and "Disabled". + // When set to Enabled the gatherer will run. + // When set to Disabled the gatherer will not run. + // +required State GathererState `json:"state"` } +// state declares valid gatherer state types. +// +kubebuilder:validation:Enum=Enabled;Disabled +type GathererState string + +const ( + // GathererStateEnabled gatherer state, which means that the gatherer will run. + GathererStateEnabled GathererState = "Enabled" + // GathererStateDisabled gatherer state, which means that the gatherer will not run. + GathererStateDisabled GathererState = "Disabled" +) + // dataGatherState declares valid gathering state types // +kubebuilder:validation:Optional // +kubebuilder:validation:Enum=Running;Completed;Failed;Pending @@ -170,6 +210,17 @@ type GathererConfig struct { // +kubebuilder:validation:XValidation:rule="!(oldSelf == 'Failed' && self == 'Running')", message="dataGatherState cannot transition from Failed to Running" type DataGatherState string +const ( + // Data gathering is running + DataGatherStateRunning DataGatherState = "Running" + // Data gathering is completed + DataGatherStateCompleted DataGatherState = "Completed" + // Data gathering failed + DataGatherStateFailed DataGatherState = "Failed" + // Data gathering is pending + DataGatherStatePending DataGatherState = "Pending" +) + // DataGatherStatus contains information relating to the DataGather state. // +kubebuilder:validation:XValidation:rule="(!has(oldSelf.insightsRequestID) || has(self.insightsRequestID))",message="cannot remove insightsRequestID attribute from status" // +kubebuilder:validation:XValidation:rule="(!has(oldSelf.startTime) || has(self.startTime))",message="cannot remove startTime attribute from status" @@ -202,6 +253,7 @@ type DataGatherStatus struct { FinishTime metav1.Time `json:"finishTime,omitempty"` // relatedObjects is a list of resources which are useful when debugging or inspecting the data // gathering Pod + // +listType=atomic // +kubebuilder:validation:MaxItems=100 // +optional RelatedObjects []ObjectReference `json:"relatedObjects,omitempty"` @@ -226,8 +278,8 @@ type GathererStatus struct { // +listMapKey=type // +kubebuilder:validation:MinItems=1 // +kubebuilder:validation:MaxItems=100 - // +required - Conditions []metav1.Condition `json:"conditions"` + // +optional + Conditions []metav1.Condition `json:"conditions,omitempty"` // name is the name of the gatherer. // +required // +kubebuilder:validation:MaxLength=256 diff --git a/insights/v1alpha2/zz_generated.crd-manifests/0000_10_insights_01_datagathers-CustomNoUpgrade.crd.yaml b/insights/v1alpha2/zz_generated.crd-manifests/0000_10_insights_01_datagathers-CustomNoUpgrade.crd.yaml index 7a2b631373e..81f2ca9e4e3 100644 --- a/insights/v1alpha2/zz_generated.crd-manifests/0000_10_insights_01_datagathers-CustomNoUpgrade.crd.yaml +++ b/insights/v1alpha2/zz_generated.crd-manifests/0000_10_insights_01_datagathers-CustomNoUpgrade.crd.yaml @@ -2,7 +2,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - api-approved.openshift.io: https://github.com/openshift/api/pull/1365 + api-approved.openshift.io: https://github.com/openshift/api/pull/2248 api.openshift.io/merged-by-featuregates: "true" include.release.openshift.io/ibm-cloud-managed: "true" include.release.openshift.io/self-managed-high-availability: "true" @@ -60,58 +60,104 @@ spec: properties: dataPolicy: description: |- - dataPolicy allows user to enable additional global obfuscation of the IP addresses and base domain - in the Insights archive data. Valid values are "ClearText" and "ObfuscateNetworking". - When set to ClearText the data is not obfuscated. + dataPolicy is an optional list of DataPolicyOptions that allows user to enable additional obfuscation of the Insights archive data. + It may not exceed 2 items and must not contain duplicates. + Valid values are ObfuscateNetworking and WorkloadNames. When set to ObfuscateNetworking the IP addresses and the cluster domain name are obfuscated. - When omitted, this means no opinion and the platform is left to choose a reasonable default, which is subject to change over time. - The current default is ClearText. - enum: - - "" - - ClearText - - ObfuscateNetworking - type: string - gatherers: - description: |- - gatherers is an optional list of gatherers configurations. - The list must not exceed 100 items. - The particular gatherers IDs can be found at https://github.com/openshift/insights-operator/blob/master/docs/gathered-data.md. - Run the following command to get the names of last active gatherers: - "oc get insightsoperators.operator.openshift.io cluster -o json | jq '.status.gatherStatus.gatherers[].name'" + When set to WorkloadNames, the gathered data about cluster resources will not contain the workload names for your deployments. Resources UIDs will be used instead. + When omitted no obfuscation is applied. items: - description: gathererConfig allows to configure specific gatherers - properties: - name: - description: |- - name is the required name of specific gatherer - It must be at most 256 characters in length. - The format for the gatherer name should be: {gatherer}/{function} where the function is optional. - Gatherer consists of a lowercase letters only that may include underscores (_). - Function consists of a lowercase letters only that may include underscores (_) and is separated from the gatherer by a forward slash (/). - The particular gatherers can be found at https://github.com/openshift/insights-operator/blob/master/docs/gathered-data.md. - maxLength: 256 - type: string - x-kubernetes-validations: - - message: gatherer name must be in the format of {gatherer}/{function} - where the gatherer and function are lowercase letters only - that may include underscores (_) and are separated by a - forward slash (/) if the function is provided - rule: self.matches("^[a-z]+[_a-z]*[a-z]([/a-z][_a-z]*)?[a-z]$") - state: - description: |- - state allows you to configure specific gatherer. Valid values are "Enabled", "Disabled" and omitted. - When omitted, this means no opinion and the platform is left to choose a reasonable default. - The current default is Enabled. - enum: - - "" - - Enabled - - Disabled - type: string - required: - - name - type: object - maxItems: 100 + description: dataPolicyOption declares valid data policy types + enum: + - ObfuscateNetworking + - WorkloadNames + type: string + maxItems: 2 type: array + x-kubernetes-list-type: atomic + x-kubernetes-validations: + - message: dataPolicy items must be unique + rule: self.all(x, self.exists_one(y, x == y)) + gatherers: + description: gatherers is an optional field that specifies the configuration + of the gatherers. + properties: + custom: + description: |- + custom provides gathering configuration. + It is required when mode is Custom, and forbidden otherwise. + Custom configuration allows user to disable only a subset of gatherers. + Gatherers that are not explicitly disabled in custom configuration will run. + properties: + configs: + description: |- + configs is a required list of gatherers configurations that can be used to enable or disable specific gatherers. + It may not exceed 100 items and each gatherer can be present only once. + It is possible to disable an entire set of gatherers while allowing a specific function within that set. + The particular gatherers IDs can be found at https://github.com/openshift/insights-operator/blob/master/docs/gathered-data.md. + Run the following command to get the names of last active gatherers: + "oc get insightsoperators.operator.openshift.io cluster -o json | jq '.status.gatherStatus.gatherers[].name'" + items: + description: gathererConfig allows to configure specific + gatherers + properties: + name: + description: |- + name is the required name of a specific gatherer + It may not exceed 256 characters. + The format for a gatherer name is: {gatherer}/{function} where the function is optional. + Gatherer consists of a lowercase letters only that may include underscores (_). + Function consists of a lowercase letters only that may include underscores (_) and is separated from the gatherer by a forward slash (/). + The particular gatherers can be found at https://github.com/openshift/insights-operator/blob/master/docs/gathered-data.md. + Run the following command to get the names of last active gatherers: + "oc get insightsoperators.operator.openshift.io cluster -o json | jq '.status.gatherStatus.gatherers[].name'" + maxLength: 256 + type: string + x-kubernetes-validations: + - message: gatherer name must be in the format of {gatherer}/{function} + where the gatherer and function are lowercase letters + only that may include underscores (_) and are separated + by a forward slash (/) if the function is provided + rule: self.matches("^[a-z]+[_a-z]*[a-z]([/a-z][_a-z]*)?[a-z]$") + state: + description: |- + state is a required field that allows you to configure specific gatherer. Valid values are "Enabled" and "Disabled". + When set to Enabled the gatherer will run. + When set to Disabled the gatherer will not run. + enum: + - Enabled + - Disabled + type: string + required: + - name + - state + type: object + maxItems: 100 + type: array + x-kubernetes-list-map-keys: + - name + x-kubernetes-list-type: map + required: + - configs + type: object + mode: + description: |- + mode is a required field that specifies the mode for gatherers. Allowed values are All, None, and Custom. + When set to All, all gatherers wil run and gather data. + When set to None, all gatherers will be disabled and no data will be gathered. + When set to Custom, the custom configuration from the custom field will be applied. + enum: + - All + - None + - Custom + type: string + required: + - mode + type: object + x-kubernetes-validations: + - message: custom is required when mode is Custom, and forbidden otherwise + rule: 'has(self.mode) && self.mode == ''Custom'' ? has(self.custom) + : !has(self.custom)' storage: description: |- storage is an optional field that allows user to define persistent storage for gathering jobs to store the Insights data archive. @@ -350,7 +396,6 @@ spec: minLength: 5 type: string required: - - conditions - lastGatherDuration - name type: object @@ -503,6 +548,7 @@ spec: type: object maxItems: 100 type: array + x-kubernetes-list-type: atomic startTime: description: startTime is the time when Insights data gathering started. format: date-time diff --git a/insights/v1alpha2/zz_generated.crd-manifests/0000_10_insights_01_datagathers-DevPreviewNoUpgrade.crd.yaml b/insights/v1alpha2/zz_generated.crd-manifests/0000_10_insights_01_datagathers-DevPreviewNoUpgrade.crd.yaml index 30ab634cc14..7a1b25eab15 100644 --- a/insights/v1alpha2/zz_generated.crd-manifests/0000_10_insights_01_datagathers-DevPreviewNoUpgrade.crd.yaml +++ b/insights/v1alpha2/zz_generated.crd-manifests/0000_10_insights_01_datagathers-DevPreviewNoUpgrade.crd.yaml @@ -2,7 +2,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - api-approved.openshift.io: https://github.com/openshift/api/pull/1365 + api-approved.openshift.io: https://github.com/openshift/api/pull/2248 api.openshift.io/merged-by-featuregates: "true" include.release.openshift.io/ibm-cloud-managed: "true" include.release.openshift.io/self-managed-high-availability: "true" @@ -60,58 +60,104 @@ spec: properties: dataPolicy: description: |- - dataPolicy allows user to enable additional global obfuscation of the IP addresses and base domain - in the Insights archive data. Valid values are "ClearText" and "ObfuscateNetworking". - When set to ClearText the data is not obfuscated. + dataPolicy is an optional list of DataPolicyOptions that allows user to enable additional obfuscation of the Insights archive data. + It may not exceed 2 items and must not contain duplicates. + Valid values are ObfuscateNetworking and WorkloadNames. When set to ObfuscateNetworking the IP addresses and the cluster domain name are obfuscated. - When omitted, this means no opinion and the platform is left to choose a reasonable default, which is subject to change over time. - The current default is ClearText. - enum: - - "" - - ClearText - - ObfuscateNetworking - type: string - gatherers: - description: |- - gatherers is an optional list of gatherers configurations. - The list must not exceed 100 items. - The particular gatherers IDs can be found at https://github.com/openshift/insights-operator/blob/master/docs/gathered-data.md. - Run the following command to get the names of last active gatherers: - "oc get insightsoperators.operator.openshift.io cluster -o json | jq '.status.gatherStatus.gatherers[].name'" + When set to WorkloadNames, the gathered data about cluster resources will not contain the workload names for your deployments. Resources UIDs will be used instead. + When omitted no obfuscation is applied. items: - description: gathererConfig allows to configure specific gatherers - properties: - name: - description: |- - name is the required name of specific gatherer - It must be at most 256 characters in length. - The format for the gatherer name should be: {gatherer}/{function} where the function is optional. - Gatherer consists of a lowercase letters only that may include underscores (_). - Function consists of a lowercase letters only that may include underscores (_) and is separated from the gatherer by a forward slash (/). - The particular gatherers can be found at https://github.com/openshift/insights-operator/blob/master/docs/gathered-data.md. - maxLength: 256 - type: string - x-kubernetes-validations: - - message: gatherer name must be in the format of {gatherer}/{function} - where the gatherer and function are lowercase letters only - that may include underscores (_) and are separated by a - forward slash (/) if the function is provided - rule: self.matches("^[a-z]+[_a-z]*[a-z]([/a-z][_a-z]*)?[a-z]$") - state: - description: |- - state allows you to configure specific gatherer. Valid values are "Enabled", "Disabled" and omitted. - When omitted, this means no opinion and the platform is left to choose a reasonable default. - The current default is Enabled. - enum: - - "" - - Enabled - - Disabled - type: string - required: - - name - type: object - maxItems: 100 + description: dataPolicyOption declares valid data policy types + enum: + - ObfuscateNetworking + - WorkloadNames + type: string + maxItems: 2 type: array + x-kubernetes-list-type: atomic + x-kubernetes-validations: + - message: dataPolicy items must be unique + rule: self.all(x, self.exists_one(y, x == y)) + gatherers: + description: gatherers is an optional field that specifies the configuration + of the gatherers. + properties: + custom: + description: |- + custom provides gathering configuration. + It is required when mode is Custom, and forbidden otherwise. + Custom configuration allows user to disable only a subset of gatherers. + Gatherers that are not explicitly disabled in custom configuration will run. + properties: + configs: + description: |- + configs is a required list of gatherers configurations that can be used to enable or disable specific gatherers. + It may not exceed 100 items and each gatherer can be present only once. + It is possible to disable an entire set of gatherers while allowing a specific function within that set. + The particular gatherers IDs can be found at https://github.com/openshift/insights-operator/blob/master/docs/gathered-data.md. + Run the following command to get the names of last active gatherers: + "oc get insightsoperators.operator.openshift.io cluster -o json | jq '.status.gatherStatus.gatherers[].name'" + items: + description: gathererConfig allows to configure specific + gatherers + properties: + name: + description: |- + name is the required name of a specific gatherer + It may not exceed 256 characters. + The format for a gatherer name is: {gatherer}/{function} where the function is optional. + Gatherer consists of a lowercase letters only that may include underscores (_). + Function consists of a lowercase letters only that may include underscores (_) and is separated from the gatherer by a forward slash (/). + The particular gatherers can be found at https://github.com/openshift/insights-operator/blob/master/docs/gathered-data.md. + Run the following command to get the names of last active gatherers: + "oc get insightsoperators.operator.openshift.io cluster -o json | jq '.status.gatherStatus.gatherers[].name'" + maxLength: 256 + type: string + x-kubernetes-validations: + - message: gatherer name must be in the format of {gatherer}/{function} + where the gatherer and function are lowercase letters + only that may include underscores (_) and are separated + by a forward slash (/) if the function is provided + rule: self.matches("^[a-z]+[_a-z]*[a-z]([/a-z][_a-z]*)?[a-z]$") + state: + description: |- + state is a required field that allows you to configure specific gatherer. Valid values are "Enabled" and "Disabled". + When set to Enabled the gatherer will run. + When set to Disabled the gatherer will not run. + enum: + - Enabled + - Disabled + type: string + required: + - name + - state + type: object + maxItems: 100 + type: array + x-kubernetes-list-map-keys: + - name + x-kubernetes-list-type: map + required: + - configs + type: object + mode: + description: |- + mode is a required field that specifies the mode for gatherers. Allowed values are All, None, and Custom. + When set to All, all gatherers wil run and gather data. + When set to None, all gatherers will be disabled and no data will be gathered. + When set to Custom, the custom configuration from the custom field will be applied. + enum: + - All + - None + - Custom + type: string + required: + - mode + type: object + x-kubernetes-validations: + - message: custom is required when mode is Custom, and forbidden otherwise + rule: 'has(self.mode) && self.mode == ''Custom'' ? has(self.custom) + : !has(self.custom)' storage: description: |- storage is an optional field that allows user to define persistent storage for gathering jobs to store the Insights data archive. @@ -350,7 +396,6 @@ spec: minLength: 5 type: string required: - - conditions - lastGatherDuration - name type: object @@ -503,6 +548,7 @@ spec: type: object maxItems: 100 type: array + x-kubernetes-list-type: atomic startTime: description: startTime is the time when Insights data gathering started. format: date-time diff --git a/insights/v1alpha2/zz_generated.crd-manifests/0000_10_insights_01_datagathers-TechPreviewNoUpgrade.crd.yaml b/insights/v1alpha2/zz_generated.crd-manifests/0000_10_insights_01_datagathers-TechPreviewNoUpgrade.crd.yaml index 8bd1cf034cd..240213b115a 100644 --- a/insights/v1alpha2/zz_generated.crd-manifests/0000_10_insights_01_datagathers-TechPreviewNoUpgrade.crd.yaml +++ b/insights/v1alpha2/zz_generated.crd-manifests/0000_10_insights_01_datagathers-TechPreviewNoUpgrade.crd.yaml @@ -2,7 +2,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - api-approved.openshift.io: https://github.com/openshift/api/pull/1365 + api-approved.openshift.io: https://github.com/openshift/api/pull/2248 api.openshift.io/merged-by-featuregates: "true" include.release.openshift.io/ibm-cloud-managed: "true" include.release.openshift.io/self-managed-high-availability: "true" @@ -60,58 +60,104 @@ spec: properties: dataPolicy: description: |- - dataPolicy allows user to enable additional global obfuscation of the IP addresses and base domain - in the Insights archive data. Valid values are "ClearText" and "ObfuscateNetworking". - When set to ClearText the data is not obfuscated. + dataPolicy is an optional list of DataPolicyOptions that allows user to enable additional obfuscation of the Insights archive data. + It may not exceed 2 items and must not contain duplicates. + Valid values are ObfuscateNetworking and WorkloadNames. When set to ObfuscateNetworking the IP addresses and the cluster domain name are obfuscated. - When omitted, this means no opinion and the platform is left to choose a reasonable default, which is subject to change over time. - The current default is ClearText. - enum: - - "" - - ClearText - - ObfuscateNetworking - type: string - gatherers: - description: |- - gatherers is an optional list of gatherers configurations. - The list must not exceed 100 items. - The particular gatherers IDs can be found at https://github.com/openshift/insights-operator/blob/master/docs/gathered-data.md. - Run the following command to get the names of last active gatherers: - "oc get insightsoperators.operator.openshift.io cluster -o json | jq '.status.gatherStatus.gatherers[].name'" + When set to WorkloadNames, the gathered data about cluster resources will not contain the workload names for your deployments. Resources UIDs will be used instead. + When omitted no obfuscation is applied. items: - description: gathererConfig allows to configure specific gatherers - properties: - name: - description: |- - name is the required name of specific gatherer - It must be at most 256 characters in length. - The format for the gatherer name should be: {gatherer}/{function} where the function is optional. - Gatherer consists of a lowercase letters only that may include underscores (_). - Function consists of a lowercase letters only that may include underscores (_) and is separated from the gatherer by a forward slash (/). - The particular gatherers can be found at https://github.com/openshift/insights-operator/blob/master/docs/gathered-data.md. - maxLength: 256 - type: string - x-kubernetes-validations: - - message: gatherer name must be in the format of {gatherer}/{function} - where the gatherer and function are lowercase letters only - that may include underscores (_) and are separated by a - forward slash (/) if the function is provided - rule: self.matches("^[a-z]+[_a-z]*[a-z]([/a-z][_a-z]*)?[a-z]$") - state: - description: |- - state allows you to configure specific gatherer. Valid values are "Enabled", "Disabled" and omitted. - When omitted, this means no opinion and the platform is left to choose a reasonable default. - The current default is Enabled. - enum: - - "" - - Enabled - - Disabled - type: string - required: - - name - type: object - maxItems: 100 + description: dataPolicyOption declares valid data policy types + enum: + - ObfuscateNetworking + - WorkloadNames + type: string + maxItems: 2 type: array + x-kubernetes-list-type: atomic + x-kubernetes-validations: + - message: dataPolicy items must be unique + rule: self.all(x, self.exists_one(y, x == y)) + gatherers: + description: gatherers is an optional field that specifies the configuration + of the gatherers. + properties: + custom: + description: |- + custom provides gathering configuration. + It is required when mode is Custom, and forbidden otherwise. + Custom configuration allows user to disable only a subset of gatherers. + Gatherers that are not explicitly disabled in custom configuration will run. + properties: + configs: + description: |- + configs is a required list of gatherers configurations that can be used to enable or disable specific gatherers. + It may not exceed 100 items and each gatherer can be present only once. + It is possible to disable an entire set of gatherers while allowing a specific function within that set. + The particular gatherers IDs can be found at https://github.com/openshift/insights-operator/blob/master/docs/gathered-data.md. + Run the following command to get the names of last active gatherers: + "oc get insightsoperators.operator.openshift.io cluster -o json | jq '.status.gatherStatus.gatherers[].name'" + items: + description: gathererConfig allows to configure specific + gatherers + properties: + name: + description: |- + name is the required name of a specific gatherer + It may not exceed 256 characters. + The format for a gatherer name is: {gatherer}/{function} where the function is optional. + Gatherer consists of a lowercase letters only that may include underscores (_). + Function consists of a lowercase letters only that may include underscores (_) and is separated from the gatherer by a forward slash (/). + The particular gatherers can be found at https://github.com/openshift/insights-operator/blob/master/docs/gathered-data.md. + Run the following command to get the names of last active gatherers: + "oc get insightsoperators.operator.openshift.io cluster -o json | jq '.status.gatherStatus.gatherers[].name'" + maxLength: 256 + type: string + x-kubernetes-validations: + - message: gatherer name must be in the format of {gatherer}/{function} + where the gatherer and function are lowercase letters + only that may include underscores (_) and are separated + by a forward slash (/) if the function is provided + rule: self.matches("^[a-z]+[_a-z]*[a-z]([/a-z][_a-z]*)?[a-z]$") + state: + description: |- + state is a required field that allows you to configure specific gatherer. Valid values are "Enabled" and "Disabled". + When set to Enabled the gatherer will run. + When set to Disabled the gatherer will not run. + enum: + - Enabled + - Disabled + type: string + required: + - name + - state + type: object + maxItems: 100 + type: array + x-kubernetes-list-map-keys: + - name + x-kubernetes-list-type: map + required: + - configs + type: object + mode: + description: |- + mode is a required field that specifies the mode for gatherers. Allowed values are All, None, and Custom. + When set to All, all gatherers wil run and gather data. + When set to None, all gatherers will be disabled and no data will be gathered. + When set to Custom, the custom configuration from the custom field will be applied. + enum: + - All + - None + - Custom + type: string + required: + - mode + type: object + x-kubernetes-validations: + - message: custom is required when mode is Custom, and forbidden otherwise + rule: 'has(self.mode) && self.mode == ''Custom'' ? has(self.custom) + : !has(self.custom)' storage: description: |- storage is an optional field that allows user to define persistent storage for gathering jobs to store the Insights data archive. @@ -350,7 +396,6 @@ spec: minLength: 5 type: string required: - - conditions - lastGatherDuration - name type: object @@ -503,6 +548,7 @@ spec: type: object maxItems: 100 type: array + x-kubernetes-list-type: atomic startTime: description: startTime is the time when Insights data gathering started. format: date-time diff --git a/insights/v1alpha2/zz_generated.deepcopy.go b/insights/v1alpha2/zz_generated.deepcopy.go index b14c60b61e1..3016d7fe4a6 100644 --- a/insights/v1alpha2/zz_generated.deepcopy.go +++ b/insights/v1alpha2/zz_generated.deepcopy.go @@ -10,6 +10,27 @@ 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 *Custom) DeepCopyInto(out *Custom) { + *out = *in + if in.Configs != nil { + in, out := &in.Configs, &out.Configs + *out = make([]GathererConfig, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Custom. +func (in *Custom) DeepCopy() *Custom { + if in == nil { + return nil + } + out := new(Custom) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *DataGather) DeepCopyInto(out *DataGather) { *out = *in @@ -74,11 +95,12 @@ func (in *DataGatherList) DeepCopyObject() runtime.Object { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *DataGatherSpec) DeepCopyInto(out *DataGatherSpec) { *out = *in - if in.Gatherers != nil { - in, out := &in.Gatherers, &out.Gatherers - *out = make([]GathererConfig, len(*in)) + if in.DataPolicy != nil { + in, out := &in.DataPolicy, &out.DataPolicy + *out = make([]DataPolicyOption, len(*in)) copy(*out, *in) } + in.Gatherers.DeepCopyInto(&out.Gatherers) if in.Storage != nil { in, out := &in.Storage, &out.Storage *out = new(Storage) @@ -175,6 +197,27 @@ func (in *GathererStatus) DeepCopy() *GathererStatus { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Gatherers) DeepCopyInto(out *Gatherers) { + *out = *in + if in.Custom != nil { + in, out := &in.Custom, &out.Custom + *out = new(Custom) + (*in).DeepCopyInto(*out) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Gatherers. +func (in *Gatherers) DeepCopy() *Gatherers { + if in == nil { + return nil + } + out := new(Gatherers) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *HealthCheck) DeepCopyInto(out *HealthCheck) { *out = *in diff --git a/insights/v1alpha2/zz_generated.featuregated-crd-manifests.yaml b/insights/v1alpha2/zz_generated.featuregated-crd-manifests.yaml index 1f98d0fcf28..939b42075c8 100644 --- a/insights/v1alpha2/zz_generated.featuregated-crd-manifests.yaml +++ b/insights/v1alpha2/zz_generated.featuregated-crd-manifests.yaml @@ -1,6 +1,6 @@ datagathers.insights.openshift.io: Annotations: {} - ApprovedPRNumber: https://github.com/openshift/api/pull/1365 + ApprovedPRNumber: https://github.com/openshift/api/pull/2248 CRDName: datagathers.insights.openshift.io Capability: "" Category: "" diff --git a/insights/v1alpha2/zz_generated.featuregated-crd-manifests/datagathers.insights.openshift.io/InsightsOnDemandDataGather.yaml b/insights/v1alpha2/zz_generated.featuregated-crd-manifests/datagathers.insights.openshift.io/InsightsOnDemandDataGather.yaml index f315c4fe297..7611d269c7c 100644 --- a/insights/v1alpha2/zz_generated.featuregated-crd-manifests/datagathers.insights.openshift.io/InsightsOnDemandDataGather.yaml +++ b/insights/v1alpha2/zz_generated.featuregated-crd-manifests/datagathers.insights.openshift.io/InsightsOnDemandDataGather.yaml @@ -2,7 +2,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - api-approved.openshift.io: https://github.com/openshift/api/pull/1365 + api-approved.openshift.io: https://github.com/openshift/api/pull/2248 api.openshift.io/filename-cvo-runlevel: "0000_10" api.openshift.io/filename-operator: insights api.openshift.io/filename-ordering: "01" @@ -60,58 +60,104 @@ spec: properties: dataPolicy: description: |- - dataPolicy allows user to enable additional global obfuscation of the IP addresses and base domain - in the Insights archive data. Valid values are "ClearText" and "ObfuscateNetworking". - When set to ClearText the data is not obfuscated. + dataPolicy is an optional list of DataPolicyOptions that allows user to enable additional obfuscation of the Insights archive data. + It may not exceed 2 items and must not contain duplicates. + Valid values are ObfuscateNetworking and WorkloadNames. When set to ObfuscateNetworking the IP addresses and the cluster domain name are obfuscated. - When omitted, this means no opinion and the platform is left to choose a reasonable default, which is subject to change over time. - The current default is ClearText. - enum: - - "" - - ClearText - - ObfuscateNetworking - type: string - gatherers: - description: |- - gatherers is an optional list of gatherers configurations. - The list must not exceed 100 items. - The particular gatherers IDs can be found at https://github.com/openshift/insights-operator/blob/master/docs/gathered-data.md. - Run the following command to get the names of last active gatherers: - "oc get insightsoperators.operator.openshift.io cluster -o json | jq '.status.gatherStatus.gatherers[].name'" + When set to WorkloadNames, the gathered data about cluster resources will not contain the workload names for your deployments. Resources UIDs will be used instead. + When omitted no obfuscation is applied. items: - description: gathererConfig allows to configure specific gatherers - properties: - name: - description: |- - name is the required name of specific gatherer - It must be at most 256 characters in length. - The format for the gatherer name should be: {gatherer}/{function} where the function is optional. - Gatherer consists of a lowercase letters only that may include underscores (_). - Function consists of a lowercase letters only that may include underscores (_) and is separated from the gatherer by a forward slash (/). - The particular gatherers can be found at https://github.com/openshift/insights-operator/blob/master/docs/gathered-data.md. - maxLength: 256 - type: string - x-kubernetes-validations: - - message: gatherer name must be in the format of {gatherer}/{function} - where the gatherer and function are lowercase letters only - that may include underscores (_) and are separated by a - forward slash (/) if the function is provided - rule: self.matches("^[a-z]+[_a-z]*[a-z]([/a-z][_a-z]*)?[a-z]$") - state: - description: |- - state allows you to configure specific gatherer. Valid values are "Enabled", "Disabled" and omitted. - When omitted, this means no opinion and the platform is left to choose a reasonable default. - The current default is Enabled. - enum: - - "" - - Enabled - - Disabled - type: string - required: - - name - type: object - maxItems: 100 + description: dataPolicyOption declares valid data policy types + enum: + - ObfuscateNetworking + - WorkloadNames + type: string + maxItems: 2 type: array + x-kubernetes-list-type: atomic + x-kubernetes-validations: + - message: dataPolicy items must be unique + rule: self.all(x, self.exists_one(y, x == y)) + gatherers: + description: gatherers is an optional field that specifies the configuration + of the gatherers. + properties: + custom: + description: |- + custom provides gathering configuration. + It is required when mode is Custom, and forbidden otherwise. + Custom configuration allows user to disable only a subset of gatherers. + Gatherers that are not explicitly disabled in custom configuration will run. + properties: + configs: + description: |- + configs is a required list of gatherers configurations that can be used to enable or disable specific gatherers. + It may not exceed 100 items and each gatherer can be present only once. + It is possible to disable an entire set of gatherers while allowing a specific function within that set. + The particular gatherers IDs can be found at https://github.com/openshift/insights-operator/blob/master/docs/gathered-data.md. + Run the following command to get the names of last active gatherers: + "oc get insightsoperators.operator.openshift.io cluster -o json | jq '.status.gatherStatus.gatherers[].name'" + items: + description: gathererConfig allows to configure specific + gatherers + properties: + name: + description: |- + name is the required name of a specific gatherer + It may not exceed 256 characters. + The format for a gatherer name is: {gatherer}/{function} where the function is optional. + Gatherer consists of a lowercase letters only that may include underscores (_). + Function consists of a lowercase letters only that may include underscores (_) and is separated from the gatherer by a forward slash (/). + The particular gatherers can be found at https://github.com/openshift/insights-operator/blob/master/docs/gathered-data.md. + Run the following command to get the names of last active gatherers: + "oc get insightsoperators.operator.openshift.io cluster -o json | jq '.status.gatherStatus.gatherers[].name'" + maxLength: 256 + type: string + x-kubernetes-validations: + - message: gatherer name must be in the format of {gatherer}/{function} + where the gatherer and function are lowercase letters + only that may include underscores (_) and are separated + by a forward slash (/) if the function is provided + rule: self.matches("^[a-z]+[_a-z]*[a-z]([/a-z][_a-z]*)?[a-z]$") + state: + description: |- + state is a required field that allows you to configure specific gatherer. Valid values are "Enabled" and "Disabled". + When set to Enabled the gatherer will run. + When set to Disabled the gatherer will not run. + enum: + - Enabled + - Disabled + type: string + required: + - name + - state + type: object + maxItems: 100 + type: array + x-kubernetes-list-map-keys: + - name + x-kubernetes-list-type: map + required: + - configs + type: object + mode: + description: |- + mode is a required field that specifies the mode for gatherers. Allowed values are All, None, and Custom. + When set to All, all gatherers wil run and gather data. + When set to None, all gatherers will be disabled and no data will be gathered. + When set to Custom, the custom configuration from the custom field will be applied. + enum: + - All + - None + - Custom + type: string + required: + - mode + type: object + x-kubernetes-validations: + - message: custom is required when mode is Custom, and forbidden otherwise + rule: 'has(self.mode) && self.mode == ''Custom'' ? has(self.custom) + : !has(self.custom)' storage: description: |- storage is an optional field that allows user to define persistent storage for gathering jobs to store the Insights data archive. @@ -350,7 +396,6 @@ spec: minLength: 5 type: string required: - - conditions - lastGatherDuration - name type: object @@ -503,6 +548,7 @@ spec: type: object maxItems: 100 type: array + x-kubernetes-list-type: atomic startTime: description: startTime is the time when Insights data gathering started. format: date-time diff --git a/insights/v1alpha2/zz_generated.swagger_doc_generated.go b/insights/v1alpha2/zz_generated.swagger_doc_generated.go index f45576a0ff4..8a9ab7e5be3 100644 --- a/insights/v1alpha2/zz_generated.swagger_doc_generated.go +++ b/insights/v1alpha2/zz_generated.swagger_doc_generated.go @@ -11,6 +11,15 @@ package v1alpha2 // Those methods can be generated by using hack/update-swagger-docs.sh // AUTO-GENERATED FUNCTIONS START HERE +var map_Custom = map[string]string{ + "": "custom provides the custom configuration of gatherers", + "configs": "configs is a required list of gatherers configurations that can be used to enable or disable specific gatherers. It may not exceed 100 items and each gatherer can be present only once. It is possible to disable an entire set of gatherers while allowing a specific function within that set. The particular gatherers IDs can be found at https://github.com/openshift/insights-operator/blob/master/docs/gathered-data.md. Run the following command to get the names of last active gatherers: \"oc get insightsoperators.operator.openshift.io cluster -o json | jq '.status.gatherStatus.gatherers[].name'\"", +} + +func (Custom) SwaggerDoc() map[string]string { + return map_Custom +} + var map_DataGather = map[string]string{ "": "\n\nDataGather provides data gather configuration options and status for the particular Insights data gathering.\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.", "metadata": "metadata is the standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", @@ -34,8 +43,8 @@ func (DataGatherList) SwaggerDoc() map[string]string { var map_DataGatherSpec = map[string]string{ "": "DataGatherSpec contains the configuration for the DataGather.", - "dataPolicy": "dataPolicy allows user to enable additional global obfuscation of the IP addresses and base domain in the Insights archive data. Valid values are \"ClearText\" and \"ObfuscateNetworking\". When set to ClearText the data is not obfuscated. When set to ObfuscateNetworking the IP addresses and the cluster domain name are obfuscated. When omitted, this means no opinion and the platform is left to choose a reasonable default, which is subject to change over time. The current default is ClearText.", - "gatherers": "gatherers is an optional list of gatherers configurations. The list must not exceed 100 items. The particular gatherers IDs can be found at https://github.com/openshift/insights-operator/blob/master/docs/gathered-data.md. Run the following command to get the names of last active gatherers: \"oc get insightsoperators.operator.openshift.io cluster -o json | jq '.status.gatherStatus.gatherers[].name'\"", + "dataPolicy": "dataPolicy is an optional list of DataPolicyOptions that allows user to enable additional obfuscation of the Insights archive data. It may not exceed 2 items and must not contain duplicates. Valid values are ObfuscateNetworking and WorkloadNames. When set to ObfuscateNetworking the IP addresses and the cluster domain name are obfuscated. When set to WorkloadNames, the gathered data about cluster resources will not contain the workload names for your deployments. Resources UIDs will be used instead. When omitted no obfuscation is applied.", + "gatherers": "gatherers is an optional field that specifies the configuration of the gatherers.", "storage": "storage is an optional field that allows user to define persistent storage for gathering jobs to store the Insights data archive. If omitted, the gathering job will use ephemeral storage.", } @@ -61,8 +70,8 @@ func (DataGatherStatus) SwaggerDoc() map[string]string { var map_GathererConfig = map[string]string{ "": "gathererConfig allows to configure specific gatherers", - "name": "name is the required name of specific gatherer It must be at most 256 characters in length. The format for the gatherer name should be: {gatherer}/{function} where the function is optional. Gatherer consists of a lowercase letters only that may include underscores (_). Function consists of a lowercase letters only that may include underscores (_) and is separated from the gatherer by a forward slash (/). The particular gatherers can be found at https://github.com/openshift/insights-operator/blob/master/docs/gathered-data.md.", - "state": "state allows you to configure specific gatherer. Valid values are \"Enabled\", \"Disabled\" and omitted. When omitted, this means no opinion and the platform is left to choose a reasonable default. The current default is Enabled.", + "name": "name is the required name of a specific gatherer It may not exceed 256 characters. The format for a gatherer name is: {gatherer}/{function} where the function is optional. Gatherer consists of a lowercase letters only that may include underscores (_). Function consists of a lowercase letters only that may include underscores (_) and is separated from the gatherer by a forward slash (/). The particular gatherers can be found at https://github.com/openshift/insights-operator/blob/master/docs/gathered-data.md. Run the following command to get the names of last active gatherers: \"oc get insightsoperators.operator.openshift.io cluster -o json | jq '.status.gatherStatus.gatherers[].name'\"", + "state": "state is a required field that allows you to configure specific gatherer. Valid values are \"Enabled\" and \"Disabled\". When set to Enabled the gatherer will run. When set to Disabled the gatherer will not run.", } func (GathererConfig) SwaggerDoc() map[string]string { @@ -80,6 +89,16 @@ func (GathererStatus) SwaggerDoc() map[string]string { return map_GathererStatus } +var map_Gatherers = map[string]string{ + "": "Gathereres specifies the configuration of the gatherers", + "mode": "mode is a required field that specifies the mode for gatherers. Allowed values are All, None, and Custom. When set to All, all gatherers wil run and gather data. When set to None, all gatherers will be disabled and no data will be gathered. When set to Custom, the custom configuration from the custom field will be applied.", + "custom": "custom provides gathering configuration. It is required when mode is Custom, and forbidden otherwise. Custom configuration allows user to disable only a subset of gatherers. Gatherers that are not explicitly disabled in custom configuration will run.", +} + +func (Gatherers) SwaggerDoc() map[string]string { + return map_Gatherers +} + var map_HealthCheck = map[string]string{ "": "healthCheck represents an Insights health check attributes.", "description": "description provides basic description of the healtcheck.", diff --git a/openapi/generated_openapi/zz_generated.openapi.go b/openapi/generated_openapi/zz_generated.openapi.go index 69354d54d91..15fe75b31c3 100644 --- a/openapi/generated_openapi/zz_generated.openapi.go +++ b/openapi/generated_openapi/zz_generated.openapi.go @@ -566,12 +566,14 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA "github.com/openshift/api/insights/v1alpha1.PersistentVolumeClaimReference": schema_openshift_api_insights_v1alpha1_PersistentVolumeClaimReference(ref), "github.com/openshift/api/insights/v1alpha1.PersistentVolumeConfig": schema_openshift_api_insights_v1alpha1_PersistentVolumeConfig(ref), "github.com/openshift/api/insights/v1alpha1.Storage": schema_openshift_api_insights_v1alpha1_Storage(ref), + "github.com/openshift/api/insights/v1alpha2.Custom": schema_openshift_api_insights_v1alpha2_Custom(ref), "github.com/openshift/api/insights/v1alpha2.DataGather": schema_openshift_api_insights_v1alpha2_DataGather(ref), "github.com/openshift/api/insights/v1alpha2.DataGatherList": schema_openshift_api_insights_v1alpha2_DataGatherList(ref), "github.com/openshift/api/insights/v1alpha2.DataGatherSpec": schema_openshift_api_insights_v1alpha2_DataGatherSpec(ref), "github.com/openshift/api/insights/v1alpha2.DataGatherStatus": schema_openshift_api_insights_v1alpha2_DataGatherStatus(ref), "github.com/openshift/api/insights/v1alpha2.GathererConfig": schema_openshift_api_insights_v1alpha2_GathererConfig(ref), "github.com/openshift/api/insights/v1alpha2.GathererStatus": schema_openshift_api_insights_v1alpha2_GathererStatus(ref), + "github.com/openshift/api/insights/v1alpha2.Gatherers": schema_openshift_api_insights_v1alpha2_Gatherers(ref), "github.com/openshift/api/insights/v1alpha2.HealthCheck": schema_openshift_api_insights_v1alpha2_HealthCheck(ref), "github.com/openshift/api/insights/v1alpha2.InsightsReport": schema_openshift_api_insights_v1alpha2_InsightsReport(ref), "github.com/openshift/api/insights/v1alpha2.ObjectReference": schema_openshift_api_insights_v1alpha2_ObjectReference(ref), @@ -27598,6 +27600,44 @@ func schema_openshift_api_insights_v1alpha1_Storage(ref common.ReferenceCallback } } +func schema_openshift_api_insights_v1alpha2_Custom(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "custom provides the custom configuration of gatherers", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "configs": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-map-keys": []interface{}{ + "name", + }, + "x-kubernetes-list-type": "map", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "configs is a required list of gatherers configurations that can be used to enable or disable specific gatherers. It may not exceed 100 items and each gatherer can be present only once. It is possible to disable an entire set of gatherers while allowing a specific function within that set. The particular gatherers IDs can be found at https://github.com/openshift/insights-operator/blob/master/docs/gathered-data.md. Run the following command to get the names of last active gatherers: \"oc get insightsoperators.operator.openshift.io cluster -o json | jq '.status.gatherStatus.gatherers[].name'\"", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/openshift/api/insights/v1alpha2.GathererConfig"), + }, + }, + }, + }, + }, + }, + Required: []string{"configs"}, + }, + }, + Dependencies: []string{ + "github.com/openshift/api/insights/v1alpha2.GathererConfig"}, + } +} + func schema_openshift_api_insights_v1alpha2_DataGather(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ @@ -27712,27 +27752,32 @@ func schema_openshift_api_insights_v1alpha2_DataGatherSpec(ref common.ReferenceC Type: []string{"object"}, Properties: map[string]spec.Schema{ "dataPolicy": { - SchemaProps: spec.SchemaProps{ - Description: "dataPolicy allows user to enable additional global obfuscation of the IP addresses and base domain in the Insights archive data. Valid values are \"ClearText\" and \"ObfuscateNetworking\". When set to ClearText the data is not obfuscated. When set to ObfuscateNetworking the IP addresses and the cluster domain name are obfuscated. When omitted, this means no opinion and the platform is left to choose a reasonable default, which is subject to change over time. The current default is ClearText.", - Default: "", - Type: []string{"string"}, - Format: "", + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, }, - }, - "gatherers": { SchemaProps: spec.SchemaProps{ - Description: "gatherers is an optional list of gatherers configurations. The list must not exceed 100 items. The particular gatherers IDs can be found at https://github.com/openshift/insights-operator/blob/master/docs/gathered-data.md. Run the following command to get the names of last active gatherers: \"oc get insightsoperators.operator.openshift.io cluster -o json | jq '.status.gatherStatus.gatherers[].name'\"", + Description: "dataPolicy is an optional list of DataPolicyOptions that allows user to enable additional obfuscation of the Insights archive data. It may not exceed 2 items and must not contain duplicates. Valid values are ObfuscateNetworking and WorkloadNames. When set to ObfuscateNetworking the IP addresses and the cluster domain name are obfuscated. When set to WorkloadNames, the gathered data about cluster resources will not contain the workload names for your deployments. Resources UIDs will be used instead. When omitted no obfuscation is applied.", Type: []string{"array"}, Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("github.com/openshift/api/insights/v1alpha2.GathererConfig"), + Default: "", + Type: []string{"string"}, + Format: "", }, }, }, }, }, + "gatherers": { + SchemaProps: spec.SchemaProps{ + Description: "gatherers is an optional field that specifies the configuration of the gatherers.", + Default: map[string]interface{}{}, + Ref: ref("github.com/openshift/api/insights/v1alpha2.Gatherers"), + }, + }, "storage": { SchemaProps: spec.SchemaProps{ Description: "storage is an optional field that allows user to define persistent storage for gathering jobs to store the Insights data archive. If omitted, the gathering job will use ephemeral storage.", @@ -27743,7 +27788,7 @@ func schema_openshift_api_insights_v1alpha2_DataGatherSpec(ref common.ReferenceC }, }, Dependencies: []string{ - "github.com/openshift/api/insights/v1alpha2.GathererConfig", "github.com/openshift/api/insights/v1alpha2.Storage"}, + "github.com/openshift/api/insights/v1alpha2.Gatherers", "github.com/openshift/api/insights/v1alpha2.Storage"}, } } @@ -27818,6 +27863,11 @@ func schema_openshift_api_insights_v1alpha2_DataGatherStatus(ref common.Referenc }, }, "relatedObjects": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, SchemaProps: spec.SchemaProps{ Description: "relatedObjects is a list of resources which are useful when debugging or inspecting the data gathering Pod", Type: []string{"array"}, @@ -27862,7 +27912,7 @@ func schema_openshift_api_insights_v1alpha2_GathererConfig(ref common.ReferenceC Properties: map[string]spec.Schema{ "name": { SchemaProps: spec.SchemaProps{ - Description: "name is the required name of specific gatherer It must be at most 256 characters in length. The format for the gatherer name should be: {gatherer}/{function} where the function is optional. Gatherer consists of a lowercase letters only that may include underscores (_). Function consists of a lowercase letters only that may include underscores (_) and is separated from the gatherer by a forward slash (/). The particular gatherers can be found at https://github.com/openshift/insights-operator/blob/master/docs/gathered-data.md.", + Description: "name is the required name of a specific gatherer It may not exceed 256 characters. The format for a gatherer name is: {gatherer}/{function} where the function is optional. Gatherer consists of a lowercase letters only that may include underscores (_). Function consists of a lowercase letters only that may include underscores (_) and is separated from the gatherer by a forward slash (/). The particular gatherers can be found at https://github.com/openshift/insights-operator/blob/master/docs/gathered-data.md. Run the following command to get the names of last active gatherers: \"oc get insightsoperators.operator.openshift.io cluster -o json | jq '.status.gatherStatus.gatherers[].name'\"", Default: "", Type: []string{"string"}, Format: "", @@ -27870,14 +27920,14 @@ func schema_openshift_api_insights_v1alpha2_GathererConfig(ref common.ReferenceC }, "state": { SchemaProps: spec.SchemaProps{ - Description: "state allows you to configure specific gatherer. Valid values are \"Enabled\", \"Disabled\" and omitted. When omitted, this means no opinion and the platform is left to choose a reasonable default. The current default is Enabled.", + Description: "state is a required field that allows you to configure specific gatherer. Valid values are \"Enabled\" and \"Disabled\". When set to Enabled the gatherer will run. When set to Disabled the gatherer will not run.", Default: "", Type: []string{"string"}, Format: "", }, }, }, - Required: []string{"name"}, + Required: []string{"name", "state"}, }, }, } @@ -27927,7 +27977,7 @@ func schema_openshift_api_insights_v1alpha2_GathererStatus(ref common.ReferenceC }, }, }, - Required: []string{"conditions", "name", "lastGatherDuration"}, + Required: []string{"name", "lastGatherDuration"}, }, }, Dependencies: []string{ @@ -27935,6 +27985,36 @@ func schema_openshift_api_insights_v1alpha2_GathererStatus(ref common.ReferenceC } } +func schema_openshift_api_insights_v1alpha2_Gatherers(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "Gathereres specifies the configuration of the gatherers", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "mode": { + SchemaProps: spec.SchemaProps{ + Description: "mode is a required field that specifies the mode for gatherers. Allowed values are All, None, and Custom. When set to All, all gatherers wil run and gather data. When set to None, all gatherers will be disabled and no data will be gathered. When set to Custom, the custom configuration from the custom field will be applied.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "custom": { + SchemaProps: spec.SchemaProps{ + Description: "custom provides gathering configuration. It is required when mode is Custom, and forbidden otherwise. Custom configuration allows user to disable only a subset of gatherers. Gatherers that are not explicitly disabled in custom configuration will run.", + Ref: ref("github.com/openshift/api/insights/v1alpha2.Custom"), + }, + }, + }, + Required: []string{"mode"}, + }, + }, + Dependencies: []string{ + "github.com/openshift/api/insights/v1alpha2.Custom"}, + } +} + func schema_openshift_api_insights_v1alpha2_HealthCheck(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ diff --git a/openapi/openapi.json b/openapi/openapi.json index a09ecf747d2..85c27fba715 100644 --- a/openapi/openapi.json +++ b/openapi/openapi.json @@ -15432,6 +15432,27 @@ } } }, + "com.github.openshift.api.insights.v1alpha2.Custom": { + "description": "custom provides the custom configuration of gatherers", + "type": "object", + "required": [ + "configs" + ], + "properties": { + "configs": { + "description": "configs is a required list of gatherers configurations that can be used to enable or disable specific gatherers. It may not exceed 100 items and each gatherer can be present only once. It is possible to disable an entire set of gatherers while allowing a specific function within that set. The particular gatherers IDs can be found at https://github.com/openshift/insights-operator/blob/master/docs/gathered-data.md. Run the following command to get the names of last active gatherers: \"oc get insightsoperators.operator.openshift.io cluster -o json | jq '.status.gatherStatus.gatherers[].name'\"", + "type": "array", + "items": { + "default": {}, + "$ref": "#/definitions/com.github.openshift.api.insights.v1alpha2.GathererConfig" + }, + "x-kubernetes-list-map-keys": [ + "name" + ], + "x-kubernetes-list-type": "map" + } + } + }, "com.github.openshift.api.insights.v1alpha2.DataGather": { "description": "DataGather provides data gather configuration options and status for the particular Insights data gathering.\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.", "type": "object", @@ -15497,17 +15518,18 @@ "type": "object", "properties": { "dataPolicy": { - "description": "dataPolicy allows user to enable additional global obfuscation of the IP addresses and base domain in the Insights archive data. Valid values are \"ClearText\" and \"ObfuscateNetworking\". When set to ClearText the data is not obfuscated. When set to ObfuscateNetworking the IP addresses and the cluster domain name are obfuscated. When omitted, this means no opinion and the platform is left to choose a reasonable default, which is subject to change over time. The current default is ClearText.", - "type": "string", - "default": "" - }, - "gatherers": { - "description": "gatherers is an optional list of gatherers configurations. The list must not exceed 100 items. The particular gatherers IDs can be found at https://github.com/openshift/insights-operator/blob/master/docs/gathered-data.md. Run the following command to get the names of last active gatherers: \"oc get insightsoperators.operator.openshift.io cluster -o json | jq '.status.gatherStatus.gatherers[].name'\"", + "description": "dataPolicy is an optional list of DataPolicyOptions that allows user to enable additional obfuscation of the Insights archive data. It may not exceed 2 items and must not contain duplicates. Valid values are ObfuscateNetworking and WorkloadNames. When set to ObfuscateNetworking the IP addresses and the cluster domain name are obfuscated. When set to WorkloadNames, the gathered data about cluster resources will not contain the workload names for your deployments. Resources UIDs will be used instead. When omitted no obfuscation is applied.", "type": "array", "items": { - "default": {}, - "$ref": "#/definitions/com.github.openshift.api.insights.v1alpha2.GathererConfig" - } + "type": "string", + "default": "" + }, + "x-kubernetes-list-type": "atomic" + }, + "gatherers": { + "description": "gatherers is an optional field that specifies the configuration of the gatherers.", + "default": {}, + "$ref": "#/definitions/com.github.openshift.api.insights.v1alpha2.Gatherers" }, "storage": { "description": "storage is an optional field that allows user to define persistent storage for gathering jobs to store the Insights data archive. If omitted, the gathering job will use ephemeral storage.", @@ -15566,7 +15588,8 @@ "items": { "default": {}, "$ref": "#/definitions/com.github.openshift.api.insights.v1alpha2.ObjectReference" - } + }, + "x-kubernetes-list-type": "atomic" }, "startTime": { "description": "startTime is the time when Insights data gathering started.", @@ -15578,16 +15601,17 @@ "description": "gathererConfig allows to configure specific gatherers", "type": "object", "required": [ - "name" + "name", + "state" ], "properties": { "name": { - "description": "name is the required name of specific gatherer It must be at most 256 characters in length. The format for the gatherer name should be: {gatherer}/{function} where the function is optional. Gatherer consists of a lowercase letters only that may include underscores (_). Function consists of a lowercase letters only that may include underscores (_) and is separated from the gatherer by a forward slash (/). The particular gatherers can be found at https://github.com/openshift/insights-operator/blob/master/docs/gathered-data.md.", + "description": "name is the required name of a specific gatherer It may not exceed 256 characters. The format for a gatherer name is: {gatherer}/{function} where the function is optional. Gatherer consists of a lowercase letters only that may include underscores (_). Function consists of a lowercase letters only that may include underscores (_) and is separated from the gatherer by a forward slash (/). The particular gatherers can be found at https://github.com/openshift/insights-operator/blob/master/docs/gathered-data.md. Run the following command to get the names of last active gatherers: \"oc get insightsoperators.operator.openshift.io cluster -o json | jq '.status.gatherStatus.gatherers[].name'\"", "type": "string", "default": "" }, "state": { - "description": "state allows you to configure specific gatherer. Valid values are \"Enabled\", \"Disabled\" and omitted. When omitted, this means no opinion and the platform is left to choose a reasonable default. The current default is Enabled.", + "description": "state is a required field that allows you to configure specific gatherer. Valid values are \"Enabled\" and \"Disabled\". When set to Enabled the gatherer will run. When set to Disabled the gatherer will not run.", "type": "string", "default": "" } @@ -15597,7 +15621,6 @@ "description": "gathererStatus represents information about a particular data gatherer.", "type": "object", "required": [ - "conditions", "name", "lastGatherDuration" ], @@ -15625,6 +15648,24 @@ } } }, + "com.github.openshift.api.insights.v1alpha2.Gatherers": { + "description": "Gathereres specifies the configuration of the gatherers", + "type": "object", + "required": [ + "mode" + ], + "properties": { + "custom": { + "description": "custom provides gathering configuration. It is required when mode is Custom, and forbidden otherwise. Custom configuration allows user to disable only a subset of gatherers. Gatherers that are not explicitly disabled in custom configuration will run.", + "$ref": "#/definitions/com.github.openshift.api.insights.v1alpha2.Custom" + }, + "mode": { + "description": "mode is a required field that specifies the mode for gatherers. Allowed values are All, None, and Custom. When set to All, all gatherers wil run and gather data. When set to None, all gatherers will be disabled and no data will be gathered. When set to Custom, the custom configuration from the custom field will be applied.", + "type": "string", + "default": "" + } + } + }, "com.github.openshift.api.insights.v1alpha2.HealthCheck": { "description": "healthCheck represents an Insights health check attributes.", "type": "object", From 522fbdc0e8f8b6d7d7da8a74f224bccca305a5af Mon Sep 17 00:00:00 2001 From: Ondrej Pokorny Date: Wed, 2 Apr 2025 15:32:35 +0200 Subject: [PATCH 3/3] feat: review Signed-off-by: Ondrej Pokorny --- insights/v1alpha2/Makefile | 2 +- insights/v1alpha2/doc.go | 1 - .../InsightsOnDemandDataGather.yaml | 236 ++++++------------ insights/v1alpha2/types_insights.go | 182 ++++++++------ ...ts_01_datagathers-CustomNoUpgrade.crd.yaml | 181 ++++++++------ ...1_datagathers-DevPreviewNoUpgrade.crd.yaml | 181 ++++++++------ ..._datagathers-TechPreviewNoUpgrade.crd.yaml | 181 ++++++++------ insights/v1alpha2/zz_generated.deepcopy.go | 22 +- .../InsightsOnDemandDataGather.yaml | 181 ++++++++------ .../zz_generated.swagger_doc_generated.go | 38 ++- .../generated_openapi/zz_generated.openapi.go | 102 +++++--- openapi/openapi.json | 93 ++++--- 12 files changed, 756 insertions(+), 644 deletions(-) diff --git a/insights/v1alpha2/Makefile b/insights/v1alpha2/Makefile index 6907cf13901..d5f9bb96c6c 100644 --- a/insights/v1alpha2/Makefile +++ b/insights/v1alpha2/Makefile @@ -1,3 +1,3 @@ .PHONY: test test: - make -C ../../tests test GINKGO_EXTRA_ARGS=--focus="insights.openshift.io/v1alpha2" \ No newline at end of file + make -C ../../tests test GINKGO_EXTRA_ARGS=--focus="insights.openshift.io/v1alpha2" diff --git a/insights/v1alpha2/doc.go b/insights/v1alpha2/doc.go index dda76abcc8a..9738e1be576 100644 --- a/insights/v1alpha2/doc.go +++ b/insights/v1alpha2/doc.go @@ -2,7 +2,6 @@ // +k8s:defaulter-gen=TypeMeta // +k8s:openapi-gen=true -// +kubebuilder:validation:Optional // +groupName=insights.openshift.io // Package v1alpha2 is the v1alpha2 version of the API. package v1alpha2 diff --git a/insights/v1alpha2/tests/datagathers.insights.openshift.io/InsightsOnDemandDataGather.yaml b/insights/v1alpha2/tests/datagathers.insights.openshift.io/InsightsOnDemandDataGather.yaml index 9eee96dc022..6a797b0785c 100644 --- a/insights/v1alpha2/tests/datagathers.insights.openshift.io/InsightsOnDemandDataGather.yaml +++ b/insights/v1alpha2/tests/datagathers.insights.openshift.io/InsightsOnDemandDataGather.yaml @@ -356,95 +356,7 @@ tests: resource: "pods" namespace: "openshift-insights" expectedStatusError: 'status: Invalid value: "object": cannot remove finishTime attribute from status' - - name: dataGatherState cannot be removed from status - initial: | - apiVersion: insights.openshift.io/v1alpha2 - kind: DataGather - spec: {} # No spec is required for a DataGather - status: - dataGatherState: Running - updated: | - apiVersion: insights.openshift.io/v1alpha2 - kind: DataGather - spec: {} # No spec is required for a DataGather - status: - relatedObjects: - - name: periodic-job-xyz - group: "" - resource: "pods" - namespace: "openshift-insights" - expectedStatusError: 'status: Invalid value: "object": cannot remove dataGatherState attribute from status' - - name: dataGatherState cannot transition from Running to Pending - initial: | - apiVersion: insights.openshift.io/v1alpha2 - kind: DataGather - spec: {} # No spec is required for a DataGather - status: - dataGatherState: Running - updated: | - apiVersion: insights.openshift.io/v1alpha2 - kind: DataGather - spec: {} # No spec is required for a DataGather - status: - dataGatherState: Pending - expectedStatusError: 'status.dataGatherState: Invalid value: "string": dataGatherState cannot transition from Running to Pending' - - name: dataGatherState cannot transition from Completed to Pending - initial: | - apiVersion: insights.openshift.io/v1alpha2 - kind: DataGather - spec: {} # No spec is required for a DataGather - status: - dataGatherState: Completed - updated: | - apiVersion: insights.openshift.io/v1alpha2 - kind: DataGather - spec: {} # No spec is required for a DataGather - status: - dataGatherState: Pending - expectedStatusError: 'status.dataGatherState: Invalid value: "string": dataGatherState cannot transition from Completed to Pending' - - name: dataGatherState cannot transition from Failed to Pending - initial: | - apiVersion: insights.openshift.io/v1alpha2 - kind: DataGather - spec: {} # No spec is required for a DataGather - status: - dataGatherState: Failed - updated: | - apiVersion: insights.openshift.io/v1alpha2 - kind: DataGather - spec: {} # No spec is required for a DataGather - status: - dataGatherState: Pending - expectedStatusError: 'status.dataGatherState: Invalid value: "string": dataGatherState cannot transition from Failed to Pending' - - name: dataGatherState cannot transition from Completed to Running - initial: | - apiVersion: insights.openshift.io/v1alpha2 - kind: DataGather - spec: {} # No spec is required for a DataGather - status: - dataGatherState: Completed - updated: | - apiVersion: insights.openshift.io/v1alpha2 - kind: DataGather - spec: {} # No spec is required for a DataGather - status: - dataGatherState: Running - expectedStatusError: 'status.dataGatherState: Invalid value: "string": dataGatherState cannot transition from Completed to Running' - - name: dataGatherState cannot transition from Failed to Running - initial: | - apiVersion: insights.openshift.io/v1alpha2 - kind: DataGather - spec: {} # No spec is required for a DataGather - status: - dataGatherState: Failed - updated: | - apiVersion: insights.openshift.io/v1alpha2 - kind: DataGather - spec: {} # No spec is required for a DataGather - status: - dataGatherState: Running - expectedStatusError: 'status.dataGatherState: Invalid value: "string": dataGatherState cannot transition from Failed to Running' - - name: lastGatherDuration can be updated with a trailing zero value + - name: lastGatherSeconds must be integer initial: | apiVersion: insights.openshift.io/v1alpha2 kind: DataGather @@ -456,28 +368,35 @@ tests: status: gatherers: - name: testGatherer - lastGatherDuration: 1m0s + lastGatherSeconds: 1.1 conditions: - type: Gathered status: "True" reason: OK message: "test message" lastTransitionTime: "2024-12-01T08:04:21Z" - expected: | + expectedStatusError: "gatherers[0].lastGatherSeconds in body must be of type integer" + - name: lastGatherSeconds cannot be updated with an invalid value + initial: | + apiVersion: insights.openshift.io/v1alpha2 + kind: DataGather + spec: {} # No spec is required for a DataGather + updated: | apiVersion: insights.openshift.io/v1alpha2 kind: DataGather spec: {} # No spec is required for a DataGather status: gatherers: - name: testGatherer - lastGatherDuration: 1m0s + lastGatherSeconds: 1d2h conditions: - type: Gathered status: "True" reason: OK message: "test message" lastTransitionTime: "2024-12-01T08:04:21Z" - - name: lastGatherDuration can be updated with a leading zero value + expectedStatusError: 'Invalid value: "string": gatherers[0].lastGatherSeconds in body must be of type integer' + - name: lastGatherSeconds cannot be updated with a negative value initial: | apiVersion: insights.openshift.io/v1alpha2 kind: DataGather @@ -489,28 +408,28 @@ tests: status: gatherers: - name: testGatherer - lastGatherDuration: 0m11s + lastGatherSeconds: -5 conditions: - type: Gathered status: "True" reason: OK message: "test message" lastTransitionTime: "2024-12-01T08:04:21Z" - expected: | + expectedStatusError: "lastGatherSeconds in body should be greater than or equal to 0" + - name: should not be updated with URL that is not HTTPS + initial: | + apiVersion: insights.openshift.io/v1alpha2 + kind: DataGather + spec: {} # No spec is required for a DataGather + updated: | apiVersion: insights.openshift.io/v1alpha2 kind: DataGather spec: {} # No spec is required for a DataGather status: - gatherers: - - name: testGatherer - lastGatherDuration: 0m11s - conditions: - - type: Gathered - status: "True" - reason: OK - message: "test message" - lastTransitionTime: "2024-12-01T08:04:21Z" - - name: lastGatherDuration can be updated with a decimal number value + insightsReport: + uri: http://example.com + expectedStatusError: 'status.insightsReport.uri: Invalid value: "string": URI must be a valid HTTPS URL (e.g., https://example.com)' + - name: should be updated with a valid HTTPS URL initial: | apiVersion: insights.openshift.io/v1alpha2 kind: DataGather @@ -520,30 +439,16 @@ tests: kind: DataGather spec: {} # No spec is required for a DataGather status: - gatherers: - - name: testGatherer - lastGatherDuration: 1m0.77s - conditions: - - type: Gathered - status: "True" - reason: OK - message: "test message" - lastTransitionTime: "2024-12-01T08:04:21Z" + insightsReport: + uri: https://example.com expected: | apiVersion: insights.openshift.io/v1alpha2 kind: DataGather spec: {} # No spec is required for a DataGather status: - gatherers: - - name: testGatherer - lastGatherDuration: 1m0.77s - conditions: - - type: Gathered - status: "True" - reason: OK - message: "test message" - lastTransitionTime: "2024-12-01T08:04:21Z" - - name: lastGatherDuration cannot be updated with an invalid value + insightsReport: + uri: https://example.com + - name: should be updated with a valid totalRisk initial: | apiVersion: insights.openshift.io/v1alpha2 kind: DataGather @@ -553,37 +458,22 @@ tests: kind: DataGather spec: {} # No spec is required for a DataGather status: - gatherers: - - name: testGatherer - lastGatherDuration: 1d2h - conditions: - - type: Gathered - status: "True" - reason: OK - message: "test message" - lastTransitionTime: "2024-12-01T08:04:21Z" - expectedStatusError: "Invalid value: \"1d2h\": gatherers[0].lastGatherDuration in body should match '^(([0-9]+(?:\\.[0-9]+)?(ns|us|µs|μs|ms|s|m|h))+)$'" - - name: lastGatherDuration cannot be updated with a negative value - initial: | - apiVersion: insights.openshift.io/v1alpha2 - kind: DataGather - spec: {} # No spec is required for a DataGather - updated: | + insightsReport: + healthChecks: + - description: Low risk update test + totalRisk: Low + advisorURI: https://example.com + expected: | apiVersion: insights.openshift.io/v1alpha2 kind: DataGather spec: {} # No spec is required for a DataGather status: - gatherers: - - name: testGatherer - lastGatherDuration: -0m5s - conditions: - - type: Gathered - status: "True" - reason: OK - message: "test message" - lastTransitionTime: "2024-12-01T08:04:21Z" - expectedStatusError: "Invalid value: \"-0m5s\": gatherers[0].lastGatherDuration in body should match '^(([0-9]+(?:\\.[0-9]+)?(ns|us|µs|μs|ms|s|m|h))+)$'" - - name: should not be updated with URL that is not HTTPS + insightsReport: + healthChecks: + - description: Low risk update test + totalRisk: Low + advisorURI: https://example.com + - name: should not be updated with invalid totalRisk value initial: | apiVersion: insights.openshift.io/v1alpha2 kind: DataGather @@ -594,9 +484,12 @@ tests: spec: {} # No spec is required for a DataGather status: insightsReport: - uri: http://example.com - expectedStatusError: 'status.insightsReport.uri: Invalid value: "string": URI must be a valid HTTPS URL (e.g., https://example.com)' - - name: should be updated with a valid HTTPS URL + healthChecks: + - description: NoRisk update test + totalRisk: NoRisk + advisorURI: https://example.com + expectedStatusError: 'totalRisk: Unsupported value: "NoRisk": supported values: "Low", "Moderate", "Important", "Critical"' + - name: should pass initial: | apiVersion: insights.openshift.io/v1alpha2 kind: DataGather @@ -607,11 +500,42 @@ tests: spec: {} # No spec is required for a DataGather status: insightsReport: - uri: https://example.com + healthChecks: + - description: NoRisk update test + totalRisk: Low + advisorURI: https://example.com + - description: NoRisk update test + totalRisk: Important + advisorURI: https://example.com expected: | apiVersion: insights.openshift.io/v1alpha2 kind: DataGather spec: {} # No spec is required for a DataGather status: insightsReport: - uri: https://example.com + healthChecks: + - description: NoRisk update test + totalRisk: Low + advisorURI: https://example.com + - description: NoRisk update test + totalRisk: Important + advisorURI: https://example.com + - name: no duplicates + initial: | + apiVersion: insights.openshift.io/v1alpha2 + kind: DataGather + spec: {} # No spec is required for a DataGather + updated: | + apiVersion: insights.openshift.io/v1alpha2 + kind: DataGather + spec: {} # No spec is required for a DataGather + status: + insightsReport: + healthChecks: + - description: Low risk update test + totalRisk: Low + advisorURI: https://example.com + - description: Low risk update test + totalRisk: Low + advisorURI: https://example.com + expectedStatusError: "invalid: status.insightsReport.healthChecks[1]: Duplicate value" diff --git a/insights/v1alpha2/types_insights.go b/insights/v1alpha2/types_insights.go index 176785304ef..38c478401f7 100644 --- a/insights/v1alpha2/types_insights.go +++ b/insights/v1alpha2/types_insights.go @@ -49,8 +49,9 @@ type DataGatherSpec struct { // +optional DataPolicy []DataPolicyOption `json:"dataPolicy"` // gatherers is an optional field that specifies the configuration of the gatherers. + // If omitted, all gatherers will be run. // +optional - Gatherers Gatherers `json:"gatherers,omitempty"` + Gatherers *Gatherers `json:"gatherers,omitempty"` // storage is an optional field that allows user to define persistent storage for gathering jobs to store the Insights data archive. // If omitted, the gathering job will use ephemeral storage. // +optional @@ -59,11 +60,13 @@ type DataGatherSpec struct { // Gathereres specifies the configuration of the gatherers // +kubebuilder:validation:XValidation:rule="has(self.mode) && self.mode == 'Custom' ? has(self.custom) : !has(self.custom)",message="custom is required when mode is Custom, and forbidden otherwise" +// +union type Gatherers struct { // mode is a required field that specifies the mode for gatherers. Allowed values are All, None, and Custom. // When set to All, all gatherers wil run and gather data. // When set to None, all gatherers will be disabled and no data will be gathered. // When set to Custom, the custom configuration from the custom field will be applied. + // +unionDiscriminator // +required Mode GatheringMode `json:"mode"` // custom provides gathering configuration. @@ -106,12 +109,14 @@ const ( // If the type is set to PersistentVolume, then the PersistentVolume must be defined. // If the type is set to Ephemeral, then the PersistentVolume must not be defined. // +kubebuilder:validation:XValidation:rule="has(self.type) && self.type == 'PersistentVolume' ? has(self.persistentVolume) : !has(self.persistentVolume)",message="persistentVolume is required when type is PersistentVolume, and forbidden otherwise" +// +union type Storage struct { // type is a required field that specifies the type of storage that will be used to store the Insights data archive. // Valid values are "PersistentVolume" and "Ephemeral". // When set to Ephemeral, the Insights data archive is stored in the ephemeral storage of the gathering job. // When set to PersistentVolume, the Insights data archive is stored in the PersistentVolume that is // defined by the PersistentVolume field. + // +unionDiscriminator // +required Type StorageType `json:"type"` // persistentVolume is an optional field that specifies the PersistentVolume that will be used to store the Insights data archive. @@ -200,43 +205,54 @@ const ( GathererStateDisabled GathererState = "Disabled" ) -// dataGatherState declares valid gathering state types -// +kubebuilder:validation:Optional -// +kubebuilder:validation:Enum=Running;Completed;Failed;Pending -// +kubebuilder:validation:XValidation:rule="!(oldSelf == 'Running' && self == 'Pending')", message="dataGatherState cannot transition from Running to Pending" -// +kubebuilder:validation:XValidation:rule="!(oldSelf == 'Completed' && self == 'Pending')", message="dataGatherState cannot transition from Completed to Pending" -// +kubebuilder:validation:XValidation:rule="!(oldSelf == 'Failed' && self == 'Pending')", message="dataGatherState cannot transition from Failed to Pending" -// +kubebuilder:validation:XValidation:rule="!(oldSelf == 'Completed' && self == 'Running')", message="dataGatherState cannot transition from Completed to Running" -// +kubebuilder:validation:XValidation:rule="!(oldSelf == 'Failed' && self == 'Running')", message="dataGatherState cannot transition from Failed to Running" -type DataGatherState string - -const ( - // Data gathering is running - DataGatherStateRunning DataGatherState = "Running" - // Data gathering is completed - DataGatherStateCompleted DataGatherState = "Completed" - // Data gathering failed - DataGatherStateFailed DataGatherState = "Failed" - // Data gathering is pending - DataGatherStatePending DataGatherState = "Pending" -) - // DataGatherStatus contains information relating to the DataGather state. // +kubebuilder:validation:XValidation:rule="(!has(oldSelf.insightsRequestID) || has(self.insightsRequestID))",message="cannot remove insightsRequestID attribute from status" // +kubebuilder:validation:XValidation:rule="(!has(oldSelf.startTime) || has(self.startTime))",message="cannot remove startTime attribute from status" // +kubebuilder:validation:XValidation:rule="(!has(oldSelf.finishTime) || has(self.finishTime))",message="cannot remove finishTime attribute from status" -// +kubebuilder:validation:XValidation:rule="(!has(oldSelf.dataGatherState) || has(self.dataGatherState))",message="cannot remove dataGatherState attribute from status" // +kubebuilder:validation:Optional type DataGatherStatus struct { - // conditions provide details on the status of the gatherer job. + // conditions is an optional field that provides details on the status of the gatherer job. + // It may not exceed 100 items and must not contain duplicates. + // + // The current condition types are DataUploaded, DataRecorded, DataProcessed, RemoteConfigurationNotAvailable, RemoteConfigurationInvalid + // + // The DataUploaded condition is used to represent whether or not the archive was successfully uploaded for further processing. + // When it has a status of True and a reason of Succeeded, the archive was successfully uploaded. + // When it has a status of Unknown and a reason of NoUploadYet, the upload has not occurred, or there was no data to upload. + // When it has a status of False and a reason Failed, the upload failed. The accompanying message will include the specific error encountered. + // + // The DataRecorded condition is used to represent whether or not the archive was successfully recorded. + // When it has a status of True and a reason of Succeeded, the archive was recorded successfully. + // When it has a status of Unknown and a reason of NoDataGatheringYet, the data gathering process has not started yet. + // When it has a status of False and a reason of RecordingFailed, the recording failed and a message will include the specific error encountered. + // + // The DataProcessed condition is used to represent whether or not the archive was processed by the processing service. + // When it has a status of True and a reason of Processed, the data was processed successfully. + // When it has a status of Unknown and a reason of NothingToProcessYet, there is no data to process at the moment. + // When it has a status of False and a reason of Failure, processing failed and a message will include the specific error encountered. + // + // The RemoteConfigurationAvailable condition is used to represent whether the remote configuration is available. + // When it has a status of Unknown and a reason of Unknown or RemoteConfigNotRequestedYet, the state of the remote configuration is unknown—typically at startup. + // When it has a status of True and a reason of Succeeded, the configuration is available. + // When it has a status of False and a reason of NoToken, the configuration was disabled by removing the cloud.openshift.com field from the pull secret. + // When it has a status of False and a reason of DisabledByConfiguration, the configuration was disabled in insightsdatagather.config.openshift.io. + // + // The RemoteConfigurationValid condition is used to represent whether the remote configuration is valid. + // When it has a status of Unknown and a reason of Unknown or NoValidationYet, the validity of the remote configuration is unknown—typically at startup. + // When it has a status of True and a reason of Succeeded, the configuration is valid. + // When it has a status of False and a reason of Invalid, the configuration is invalid. + // + // The Progressing condition is used to represent the phase of gathering + // When it has a status of False and the reason is DataGatherPending, the gathering has not started yet. + // When it has a status of True and reason is Gathering, the gathering is running. + // When it has a status of False and reason is GatheringSucceeded, the gathering succesfully finished. + // When it has a status of False and reason is GatheringFailed, the gathering failed. + // // +listType=map // +listMapKey=type // +kubebuilder:validation:MaxItems=100 // +optional Conditions []metav1.Condition `json:"conditions,omitempty"` - // dataGatherState reflects the current state of the data gathering process. - // +optional - State DataGatherState `json:"dataGatherState,omitempty"` // gatherers is a list of active gatherers (and their statuses) in the last gathering. // +listType=map // +listMapKey=name @@ -246,19 +262,21 @@ type DataGatherStatus struct { // startTime is the time when Insights data gathering started. // +kubebuilder:validation:XValidation:rule="self == oldSelf",message="startTime is immutable once set" // +optional - StartTime metav1.Time `json:"startTime,omitempty"` + StartTime *metav1.Time `json:"startTime,omitempty"` // finishTime is the time when Insights data gathering finished. // +kubebuilder:validation:XValidation:rule="self == oldSelf",message="finishTime is immutable once set" // +optional - FinishTime metav1.Time `json:"finishTime,omitempty"` - // relatedObjects is a list of resources which are useful when debugging or inspecting the data - // gathering Pod - // +listType=atomic + FinishTime *metav1.Time `json:"finishTime,omitempty"` + // relatedObjects is an optional list of resources which are useful when debugging or inspecting the data gathering Pod + // It may not exceed 100 items and must not contain duplicates. + // +listType=map + // +listMapKey=name + // +listMapKey=namespace // +kubebuilder:validation:MaxItems=100 // +optional RelatedObjects []ObjectReference `json:"relatedObjects,omitempty"` - // insightsRequestID is an Insights request ID to track the status of the - // Insights analysis (in console.redhat.com processing pipeline) for the corresponding Insights data archive. + // insightsRequestID is an optional Insights request ID to track the status of the Insights analysis (in console.redhat.com processing pipeline) for the corresponding Insights data archive. + // It may not exceed 256 characters and is immutable once set. // +kubebuilder:validation:XValidation:rule="self == oldSelf",message="insightsRequestID is immutable once set" // +kubebuilder:validation:MaxLength=256 // +optional @@ -274,35 +292,48 @@ type DataGatherStatus struct { // data gatherer. type GathererStatus struct { // conditions provide details on the status of each gatherer. + // + // The current condition type is DataGathered + // + // The DataGathered condition is used to represent whether or not the data was gathered by a gatherer specified by name. + // When it has a status of True and a reason of GatheredOK, the data has been successfully gathered as expected. + // When it has a status of False and a reason of NoData, no data was gathered—for example, when the resource is not present in the cluster. + // When it has a status of False and a reason of GatherError, an error occurred and no data was gathered. + // When it has a status of False and a reason of GatherPanic, a panic occurred during gathering and no data was collected. + // When it has a status of False and a reason of GatherWithErrorReason, data was partially gathered or gathered with an error message. + // // +listType=map // +listMapKey=type // +kubebuilder:validation:MinItems=1 // +kubebuilder:validation:MaxItems=100 // +optional Conditions []metav1.Condition `json:"conditions,omitempty"` - // name is the name of the gatherer. - // +required + // name is the required name of the gatherer. + // It must contain at least 5 characters and may not exceed 256 characters. // +kubebuilder:validation:MaxLength=256 // +kubebuilder:validation:MinLength=5 + // +required Name string `json:"name"` - // lastGatherDuration represents the time spent gathering. + // lastGatherSeconds is required field that represents the time spent gathering in seconds + // +kubebuilder:validation:Minimum=0 // +required - // +kubebuilder:validation:Type=string - // +kubebuilder:validation:Pattern="^(([0-9]+(?:\\.[0-9]+)?(ns|us|µs|μs|ms|s|m|h))+)$" - LastGatherDuration metav1.Duration `json:"lastGatherDuration"` + LastGatherSeconds int32 `json:"lastGatherSeconds"` } // insightsReport provides Insights health check report based on the most // recently sent Insights data. type InsightsReport struct { - // downloadedAt is the time when the last Insights report was downloaded. + // downloadedTime is an optional time when the last Insights report was downloaded. // An empty value means that there has not been any Insights report downloaded yet and // it usually appears in disconnected clusters (or clusters when the Insights data gathering is disabled). // +optional - DownloadedAt metav1.Time `json:"downloadedAt,omitempty"` + DownloadedTime *metav1.Time `json:"downloadedTime,omitempty"` // healthChecks provides basic information about active Insights health checks // in a cluster. - // +listType=atomic + // +listType=map + // +listMapKey=advisorURI + // +listMapKey=totalRisk + // +listMapKey=description // +kubebuilder:validation:MaxItems=100 // +optional HealthChecks []HealthCheck `json:"healthChecks,omitempty"` @@ -316,48 +347,43 @@ type InsightsReport struct { // healthCheck represents an Insights health check attributes. type HealthCheck struct { - // description provides basic description of the healtcheck. - // +required + // description is required field that provides basic description of the healtcheck. + // It must contain at least 10 characters and may not exceed 2048 characters. // +kubebuilder:validation:MaxLength=2048 // +kubebuilder:validation:MinLength=10 + // +required Description string `json:"description"` - // totalRisk of the healthcheck. Indicator of the total risk posed - // by the detected issue; combination of impact and likelihood. The values can be from 1 to 4, - // and the higher the number, the more important the issue. + // totalRisk is the required field of the healthcheck. + // It is indicator of the total risk posed by the detected issue; combination of impact and likelihood. + // Allowed values are Low, Medium, Important and Critical. + // The value represents the severity of the issue. // +required - // +kubebuilder:validation:Minimum=1 - // +kubebuilder:validation:Maximum=4 - TotalRisk int32 `json:"totalRisk"` + TotalRisk TotalRisk `json:"totalRisk"` // advisorURI is required field that provides the URL link to the Insights Advisor. // The link must be a valid HTTPS URL and the maximum length is 2048 characters. // +kubebuilder:validation:XValidation:rule=`isURL(self) && url(self).getScheme() == "https"`,message=`advisorURI must be a valid HTTPS URL (e.g., https://example.com)` // +kubebuilder:validation:MaxLength=2048 // +required AdvisorURI string `json:"advisorURI"` - // state determines what the current state of the health check is. - // Health check is enabled by default and can be disabled - // by the user in the Insights advisor user interface. - // +required - State HealthCheckState `json:"state"` } -// healthCheckState provides information about the status of the -// health check (for example, the health check may be marked as disabled by the user). -// +kubebuilder:validation:Enum:=Enabled;Disabled -type HealthCheckState string +// totalRisk defines the valid totalRisk values. +// +kubebuilder:validation:Enum=Low;Moderate;Important;Critical +type TotalRisk string const ( - // enabled marks the health check as enabled - HealthCheckEnabled HealthCheckState = "Enabled" - // disabled marks the health check as disabled - HealthCheckDisabled HealthCheckState = "Disabled" + TotalRiskLow TotalRisk = "Low" + TotalRiskModerate TotalRisk = "Moderate" + TotalRiskImportant TotalRisk = "Important" + TotalRiskCritical TotalRisk = "Critical" ) // ObjectReference contains enough information to let you inspect or modify the referred object. type ObjectReference struct { - // group is the API Group of the Resource. + // group is required field that specifies the API Group of the Resource. // Enter empty string for the core group. - // This value is empty or should follow the DNS1123 subdomain format and it must be at most 253 characters in length. + // This value is empty or it should follow the DNS1123 subdomain format. + // It must be at most 253 characters in length, and must consist only of lower case alphanumeric characters, '-' and '.', and must start and end with an alphanumeric character. // Example: "", "apps", "build.openshift.io", etc. // +kubebuilder:validation:XValidation:rule="self.size() == 0 || !format.dns1123Subdomain().validate(self).hasValue()",message="a lowercase RFC 1123 subdomain must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character." // +kubebuilder:validation:MaxLength:=253 @@ -365,24 +391,24 @@ type ObjectReference struct { Group string `json:"group"` // resource is required field of the type that is being referenced. // It is normally the plural form of the resource kind in lowercase. - // This value should consist of only lowercase alphanumeric characters and hyphens. + // It must be at most 63 characters in length, and must must consist of only lowercase alphanumeric characters and hyphens // Example: "deployments", "deploymentconfigs", "pods", etc. - // +kubebuilder:validation:XValidation:rule=`self.matches("^[a-z0-9]([-a-z0-9]*[a-z0-9])?$")`,message=`resource must consist of only lowercase alphanumeric characters and hyphens` - // +kubebuilder:validation:MaxLength=512 + // +kubebuilder:validation:XValidation:rule=`!format.dns1123Label().validate(self).hasValue()`,message="the value must consist of only lowercase alphanumeric characters and hyphens" + // +kubebuilder:validation:MaxLength=63 // +required Resource string `json:"resource"` - // name of the referent that follows the DNS1123 subdomain format. - // It must be at most 256 characters in length. + // name is required field that specifies the referent that follows the DNS1123 subdomain format. + // It must be at most 253 characters in length, and must consist only of lower case alphanumeric characters, '-' and '.', and must start and end with an alphanumeric character. // +kubebuilder:validation:XValidation:rule="!format.dns1123Subdomain().validate(self).hasValue()",message="a lowercase RFC 1123 subdomain must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character." - // +kubebuilder:validation:MaxLength=256 + // +kubebuilder:validation:MaxLength=253 // +required Name string `json:"name"` - // namespace of the referent that follows the DNS1123 subdomain format. - // It must be at most 253 characters in length. - // +kubebuilder:validation:XValidation:rule="!format.dns1123Subdomain().validate(self).hasValue()",message="a lowercase RFC 1123 subdomain must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character." - // +kubebuilder:validation:MaxLength=253 - // +optional - Namespace string `json:"namespace,omitempty"` + // namespace if required field of the referent that follows the DNS1123 labels format. + // It must be at most 63 characters in length, and must must consist of only lowercase alphanumeric characters and hyphens + // +kubebuilder:validation:XValidation:rule=`!format.dns1123Label().validate(self).hasValue()`,message="the value must consist of only lowercase alphanumeric characters and hyphens" + // +kubebuilder:validation:MaxLength=63 + // +required + Namespace string `json:"namespace"` } // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object diff --git a/insights/v1alpha2/zz_generated.crd-manifests/0000_10_insights_01_datagathers-CustomNoUpgrade.crd.yaml b/insights/v1alpha2/zz_generated.crd-manifests/0000_10_insights_01_datagathers-CustomNoUpgrade.crd.yaml index 81f2ca9e4e3..f77a0454f60 100644 --- a/insights/v1alpha2/zz_generated.crd-manifests/0000_10_insights_01_datagathers-CustomNoUpgrade.crd.yaml +++ b/insights/v1alpha2/zz_generated.crd-manifests/0000_10_insights_01_datagathers-CustomNoUpgrade.crd.yaml @@ -79,8 +79,9 @@ spec: - message: dataPolicy items must be unique rule: self.all(x, self.exists_one(y, x == y)) gatherers: - description: gatherers is an optional field that specifies the configuration - of the gatherers. + description: |- + gatherers is an optional field that specifies the configuration of the gatherers. + If omitted, all gatherers will be run. properties: custom: description: |- @@ -226,8 +227,43 @@ spec: be overridden. properties: conditions: - description: conditions provide details on the status of the gatherer - job. + description: |- + conditions is an optional field that provides details on the status of the gatherer job. + It may not exceed 100 items and must not contain duplicates. + + The current condition types are DataUploaded, DataRecorded, DataProcessed, RemoteConfigurationNotAvailable, RemoteConfigurationInvalid + + The DataUploaded condition is used to represent whether or not the archive was successfully uploaded for further processing. + When it has a status of True and a reason of Succeeded, the archive was successfully uploaded. + When it has a status of Unknown and a reason of NoUploadYet, the upload has not occurred, or there was no data to upload. + When it has a status of False and a reason Failed, the upload failed. The accompanying message will include the specific error encountered. + + The DataRecorded condition is used to represent whether or not the archive was successfully recorded. + When it has a status of True and a reason of Succeeded, the archive was recorded successfully. + When it has a status of Unknown and a reason of NoDataGatheringYet, the data gathering process has not started yet. + When it has a status of False and a reason of RecordingFailed, the recording failed and a message will include the specific error encountered. + + The DataProcessed condition is used to represent whether or not the archive was processed by the processing service. + When it has a status of True and a reason of Processed, the data was processed successfully. + When it has a status of Unknown and a reason of NothingToProcessYet, there is no data to process at the moment. + When it has a status of False and a reason of Failure, processing failed and a message will include the specific error encountered. + + The RemoteConfigurationAvailable condition is used to represent whether the remote configuration is available. + When it has a status of Unknown and a reason of Unknown or RemoteConfigNotRequestedYet, the state of the remote configuration is unknown—typically at startup. + When it has a status of True and a reason of Succeeded, the configuration is available. + When it has a status of False and a reason of NoToken, the configuration was disabled by removing the cloud.openshift.com field from the pull secret. + When it has a status of False and a reason of DisabledByConfiguration, the configuration was disabled in insightsdatagather.config.openshift.io. + + The RemoteConfigurationValid condition is used to represent whether the remote configuration is valid. + When it has a status of Unknown and a reason of Unknown or NoValidationYet, the validity of the remote configuration is unknown—typically at startup. + When it has a status of True and a reason of Succeeded, the configuration is valid. + When it has a status of False and a reason of Invalid, the configuration is invalid. + + The Progressing condition is used to represent the phase of gathering + When it has a status of False and the reason is DataGatherPending, the gathering has not started yet. + When it has a status of True and reason is Gathering, the gathering is running. + When it has a status of False and reason is GatheringSucceeded, the gathering succesfully finished. + When it has a status of False and reason is GatheringFailed, the gathering failed. items: description: Condition contains details for one aspect of the current state of this API Resource. @@ -287,26 +323,6 @@ spec: x-kubernetes-list-map-keys: - type x-kubernetes-list-type: map - dataGatherState: - description: dataGatherState reflects the current state of the data - gathering process. - enum: - - Running - - Completed - - Failed - - Pending - type: string - x-kubernetes-validations: - - message: dataGatherState cannot transition from Running to Pending - rule: '!(oldSelf == ''Running'' && self == ''Pending'')' - - message: dataGatherState cannot transition from Completed to Pending - rule: '!(oldSelf == ''Completed'' && self == ''Pending'')' - - message: dataGatherState cannot transition from Failed to Pending - rule: '!(oldSelf == ''Failed'' && self == ''Pending'')' - - message: dataGatherState cannot transition from Completed to Running - rule: '!(oldSelf == ''Completed'' && self == ''Running'')' - - message: dataGatherState cannot transition from Failed to Running - rule: '!(oldSelf == ''Failed'' && self == ''Running'')' finishTime: description: finishTime is the time when Insights data gathering finished. format: date-time @@ -323,8 +339,17 @@ spec: data gatherer. properties: conditions: - description: conditions provide details on the status of each - gatherer. + description: |- + conditions provide details on the status of each gatherer. + + The current condition type is DataGathered + + The DataGathered condition is used to represent whether or not the data was gathered by a gatherer specified by name. + When it has a status of True and a reason of GatheredOK, the data has been successfully gathered as expected. + When it has a status of False and a reason of NoData, no data was gathered—for example, when the resource is not present in the cluster. + When it has a status of False and a reason of GatherError, an error occurred and no data was gathered. + When it has a status of False and a reason of GatherPanic, a panic occurred during gathering and no data was collected. + When it has a status of False and a reason of GatherWithErrorReason, data was partially gathered or gathered with an error message. items: description: Condition contains details for one aspect of the current state of this API Resource. @@ -386,17 +411,21 @@ spec: x-kubernetes-list-map-keys: - type x-kubernetes-list-type: map - lastGatherDuration: - description: lastGatherDuration represents the time spent gathering. - pattern: ^(([0-9]+(?:\.[0-9]+)?(ns|us|µs|μs|ms|s|m|h))+)$ - type: string + lastGatherSeconds: + description: lastGatherSeconds is required field that represents + the time spent gathering in seconds + format: int32 + minimum: 0 + type: integer name: - description: name is the name of the gatherer. + description: |- + name is the required name of the gatherer. + It must contain at least 5 characters and may not exceed 256 characters. maxLength: 256 minLength: 5 type: string required: - - lastGatherDuration + - lastGatherSeconds - name type: object maxItems: 100 @@ -410,9 +439,9 @@ spec: When omitted, this means no data gathering has taken place yet or the corresponding Insights analysis (identified by "insightsRequestID") is not available. properties: - downloadedAt: + downloadedTime: description: |- - downloadedAt is the time when the last Insights report was downloaded. + downloadedTime is an optional time when the last Insights report was downloaded. An empty value means that there has not been any Insights report downloaded yet and it usually appears in disconnected clusters (or clusters when the Insights data gathering is disabled). format: date-time @@ -435,38 +464,36 @@ spec: - message: advisorURI must be a valid HTTPS URL (e.g., https://example.com) rule: isURL(self) && url(self).getScheme() == "https" description: - description: description provides basic description of the - healtcheck. + description: |- + description is required field that provides basic description of the healtcheck. + It must contain at least 10 characters and may not exceed 2048 characters. maxLength: 2048 minLength: 10 type: string - state: + totalRisk: description: |- - state determines what the current state of the health check is. - Health check is enabled by default and can be disabled - by the user in the Insights advisor user interface. + totalRisk is the required field of the healthcheck. + It is indicator of the total risk posed by the detected issue; combination of impact and likelihood. + Allowed values are Low, Medium, Important and Critical. + The value represents the severity of the issue. enum: - - Enabled - - Disabled + - Low + - Moderate + - Important + - Critical type: string - totalRisk: - description: |- - totalRisk of the healthcheck. Indicator of the total risk posed - by the detected issue; combination of impact and likelihood. The values can be from 1 to 4, - and the higher the number, the more important the issue. - format: int32 - maximum: 4 - minimum: 1 - type: integer required: - advisorURI - description - - state - totalRisk type: object maxItems: 100 type: array - x-kubernetes-list-type: atomic + x-kubernetes-list-map-keys: + - advisorURI + - totalRisk + - description + x-kubernetes-list-type: map uri: description: |- uri is optional field that provides the URL link from which the report was downloaded. @@ -479,8 +506,8 @@ spec: type: object insightsRequestID: description: |- - insightsRequestID is an Insights request ID to track the status of the - Insights analysis (in console.redhat.com processing pipeline) for the corresponding Insights data archive. + insightsRequestID is an optional Insights request ID to track the status of the Insights analysis (in console.redhat.com processing pipeline) for the corresponding Insights data archive. + It may not exceed 256 characters and is immutable once set. maxLength: 256 type: string x-kubernetes-validations: @@ -488,17 +515,18 @@ spec: rule: self == oldSelf relatedObjects: description: |- - relatedObjects is a list of resources which are useful when debugging or inspecting the data - gathering Pod + relatedObjects is an optional list of resources which are useful when debugging or inspecting the data gathering Pod + It may not exceed 100 items and must not contain duplicates. items: description: ObjectReference contains enough information to let you inspect or modify the referred object. properties: group: description: |- - group is the API Group of the Resource. + group is required field that specifies the API Group of the Resource. Enter empty string for the core group. - This value is empty or should follow the DNS1123 subdomain format and it must be at most 253 characters in length. + This value is empty or it should follow the DNS1123 subdomain format. + It must be at most 253 characters in length, and must consist only of lower case alphanumeric characters, '-' and '.', and must start and end with an alphanumeric character. Example: "", "apps", "build.openshift.io", etc. maxLength: 253 type: string @@ -509,9 +537,9 @@ spec: rule: self.size() == 0 || !format.dns1123Subdomain().validate(self).hasValue() name: description: |- - name of the referent that follows the DNS1123 subdomain format. - It must be at most 256 characters in length. - maxLength: 256 + name is required field that specifies the referent that follows the DNS1123 subdomain format. + It must be at most 253 characters in length, and must consist only of lower case alphanumeric characters, '-' and '.', and must start and end with an alphanumeric character. + maxLength: 253 type: string x-kubernetes-validations: - message: a lowercase RFC 1123 subdomain must consist of lower @@ -520,35 +548,38 @@ spec: rule: '!format.dns1123Subdomain().validate(self).hasValue()' namespace: description: |- - namespace of the referent that follows the DNS1123 subdomain format. - It must be at most 253 characters in length. - maxLength: 253 + namespace if required field of the referent that follows the DNS1123 labels format. + It must be at most 63 characters in length, and must must consist of only lowercase alphanumeric characters and hyphens + maxLength: 63 type: string x-kubernetes-validations: - - message: a lowercase RFC 1123 subdomain must consist of lower - case alphanumeric characters, '-' or '.', and must start - and end with an alphanumeric character. - rule: '!format.dns1123Subdomain().validate(self).hasValue()' + - message: the value must consist of only lowercase alphanumeric + characters and hyphens + rule: '!format.dns1123Label().validate(self).hasValue()' resource: description: |- resource is required field of the type that is being referenced. It is normally the plural form of the resource kind in lowercase. - This value should consist of only lowercase alphanumeric characters and hyphens. + It must be at most 63 characters in length, and must must consist of only lowercase alphanumeric characters and hyphens Example: "deployments", "deploymentconfigs", "pods", etc. - maxLength: 512 + maxLength: 63 type: string x-kubernetes-validations: - - message: resource must consist of only lowercase alphanumeric + - message: the value must consist of only lowercase alphanumeric characters and hyphens - rule: self.matches("^[a-z0-9]([-a-z0-9]*[a-z0-9])?$") + rule: '!format.dns1123Label().validate(self).hasValue()' required: - group - name + - namespace - resource type: object maxItems: 100 type: array - x-kubernetes-list-type: atomic + x-kubernetes-list-map-keys: + - name + - namespace + x-kubernetes-list-type: map startTime: description: startTime is the time when Insights data gathering started. format: date-time @@ -564,8 +595,6 @@ spec: rule: (!has(oldSelf.startTime) || has(self.startTime)) - message: cannot remove finishTime attribute from status rule: (!has(oldSelf.finishTime) || has(self.finishTime)) - - message: cannot remove dataGatherState attribute from status - rule: (!has(oldSelf.dataGatherState) || has(self.dataGatherState)) required: - spec type: object diff --git a/insights/v1alpha2/zz_generated.crd-manifests/0000_10_insights_01_datagathers-DevPreviewNoUpgrade.crd.yaml b/insights/v1alpha2/zz_generated.crd-manifests/0000_10_insights_01_datagathers-DevPreviewNoUpgrade.crd.yaml index 7a1b25eab15..671cddc9dd2 100644 --- a/insights/v1alpha2/zz_generated.crd-manifests/0000_10_insights_01_datagathers-DevPreviewNoUpgrade.crd.yaml +++ b/insights/v1alpha2/zz_generated.crd-manifests/0000_10_insights_01_datagathers-DevPreviewNoUpgrade.crd.yaml @@ -79,8 +79,9 @@ spec: - message: dataPolicy items must be unique rule: self.all(x, self.exists_one(y, x == y)) gatherers: - description: gatherers is an optional field that specifies the configuration - of the gatherers. + description: |- + gatherers is an optional field that specifies the configuration of the gatherers. + If omitted, all gatherers will be run. properties: custom: description: |- @@ -226,8 +227,43 @@ spec: be overridden. properties: conditions: - description: conditions provide details on the status of the gatherer - job. + description: |- + conditions is an optional field that provides details on the status of the gatherer job. + It may not exceed 100 items and must not contain duplicates. + + The current condition types are DataUploaded, DataRecorded, DataProcessed, RemoteConfigurationNotAvailable, RemoteConfigurationInvalid + + The DataUploaded condition is used to represent whether or not the archive was successfully uploaded for further processing. + When it has a status of True and a reason of Succeeded, the archive was successfully uploaded. + When it has a status of Unknown and a reason of NoUploadYet, the upload has not occurred, or there was no data to upload. + When it has a status of False and a reason Failed, the upload failed. The accompanying message will include the specific error encountered. + + The DataRecorded condition is used to represent whether or not the archive was successfully recorded. + When it has a status of True and a reason of Succeeded, the archive was recorded successfully. + When it has a status of Unknown and a reason of NoDataGatheringYet, the data gathering process has not started yet. + When it has a status of False and a reason of RecordingFailed, the recording failed and a message will include the specific error encountered. + + The DataProcessed condition is used to represent whether or not the archive was processed by the processing service. + When it has a status of True and a reason of Processed, the data was processed successfully. + When it has a status of Unknown and a reason of NothingToProcessYet, there is no data to process at the moment. + When it has a status of False and a reason of Failure, processing failed and a message will include the specific error encountered. + + The RemoteConfigurationAvailable condition is used to represent whether the remote configuration is available. + When it has a status of Unknown and a reason of Unknown or RemoteConfigNotRequestedYet, the state of the remote configuration is unknown—typically at startup. + When it has a status of True and a reason of Succeeded, the configuration is available. + When it has a status of False and a reason of NoToken, the configuration was disabled by removing the cloud.openshift.com field from the pull secret. + When it has a status of False and a reason of DisabledByConfiguration, the configuration was disabled in insightsdatagather.config.openshift.io. + + The RemoteConfigurationValid condition is used to represent whether the remote configuration is valid. + When it has a status of Unknown and a reason of Unknown or NoValidationYet, the validity of the remote configuration is unknown—typically at startup. + When it has a status of True and a reason of Succeeded, the configuration is valid. + When it has a status of False and a reason of Invalid, the configuration is invalid. + + The Progressing condition is used to represent the phase of gathering + When it has a status of False and the reason is DataGatherPending, the gathering has not started yet. + When it has a status of True and reason is Gathering, the gathering is running. + When it has a status of False and reason is GatheringSucceeded, the gathering succesfully finished. + When it has a status of False and reason is GatheringFailed, the gathering failed. items: description: Condition contains details for one aspect of the current state of this API Resource. @@ -287,26 +323,6 @@ spec: x-kubernetes-list-map-keys: - type x-kubernetes-list-type: map - dataGatherState: - description: dataGatherState reflects the current state of the data - gathering process. - enum: - - Running - - Completed - - Failed - - Pending - type: string - x-kubernetes-validations: - - message: dataGatherState cannot transition from Running to Pending - rule: '!(oldSelf == ''Running'' && self == ''Pending'')' - - message: dataGatherState cannot transition from Completed to Pending - rule: '!(oldSelf == ''Completed'' && self == ''Pending'')' - - message: dataGatherState cannot transition from Failed to Pending - rule: '!(oldSelf == ''Failed'' && self == ''Pending'')' - - message: dataGatherState cannot transition from Completed to Running - rule: '!(oldSelf == ''Completed'' && self == ''Running'')' - - message: dataGatherState cannot transition from Failed to Running - rule: '!(oldSelf == ''Failed'' && self == ''Running'')' finishTime: description: finishTime is the time when Insights data gathering finished. format: date-time @@ -323,8 +339,17 @@ spec: data gatherer. properties: conditions: - description: conditions provide details on the status of each - gatherer. + description: |- + conditions provide details on the status of each gatherer. + + The current condition type is DataGathered + + The DataGathered condition is used to represent whether or not the data was gathered by a gatherer specified by name. + When it has a status of True and a reason of GatheredOK, the data has been successfully gathered as expected. + When it has a status of False and a reason of NoData, no data was gathered—for example, when the resource is not present in the cluster. + When it has a status of False and a reason of GatherError, an error occurred and no data was gathered. + When it has a status of False and a reason of GatherPanic, a panic occurred during gathering and no data was collected. + When it has a status of False and a reason of GatherWithErrorReason, data was partially gathered or gathered with an error message. items: description: Condition contains details for one aspect of the current state of this API Resource. @@ -386,17 +411,21 @@ spec: x-kubernetes-list-map-keys: - type x-kubernetes-list-type: map - lastGatherDuration: - description: lastGatherDuration represents the time spent gathering. - pattern: ^(([0-9]+(?:\.[0-9]+)?(ns|us|µs|μs|ms|s|m|h))+)$ - type: string + lastGatherSeconds: + description: lastGatherSeconds is required field that represents + the time spent gathering in seconds + format: int32 + minimum: 0 + type: integer name: - description: name is the name of the gatherer. + description: |- + name is the required name of the gatherer. + It must contain at least 5 characters and may not exceed 256 characters. maxLength: 256 minLength: 5 type: string required: - - lastGatherDuration + - lastGatherSeconds - name type: object maxItems: 100 @@ -410,9 +439,9 @@ spec: When omitted, this means no data gathering has taken place yet or the corresponding Insights analysis (identified by "insightsRequestID") is not available. properties: - downloadedAt: + downloadedTime: description: |- - downloadedAt is the time when the last Insights report was downloaded. + downloadedTime is an optional time when the last Insights report was downloaded. An empty value means that there has not been any Insights report downloaded yet and it usually appears in disconnected clusters (or clusters when the Insights data gathering is disabled). format: date-time @@ -435,38 +464,36 @@ spec: - message: advisorURI must be a valid HTTPS URL (e.g., https://example.com) rule: isURL(self) && url(self).getScheme() == "https" description: - description: description provides basic description of the - healtcheck. + description: |- + description is required field that provides basic description of the healtcheck. + It must contain at least 10 characters and may not exceed 2048 characters. maxLength: 2048 minLength: 10 type: string - state: + totalRisk: description: |- - state determines what the current state of the health check is. - Health check is enabled by default and can be disabled - by the user in the Insights advisor user interface. + totalRisk is the required field of the healthcheck. + It is indicator of the total risk posed by the detected issue; combination of impact and likelihood. + Allowed values are Low, Medium, Important and Critical. + The value represents the severity of the issue. enum: - - Enabled - - Disabled + - Low + - Moderate + - Important + - Critical type: string - totalRisk: - description: |- - totalRisk of the healthcheck. Indicator of the total risk posed - by the detected issue; combination of impact and likelihood. The values can be from 1 to 4, - and the higher the number, the more important the issue. - format: int32 - maximum: 4 - minimum: 1 - type: integer required: - advisorURI - description - - state - totalRisk type: object maxItems: 100 type: array - x-kubernetes-list-type: atomic + x-kubernetes-list-map-keys: + - advisorURI + - totalRisk + - description + x-kubernetes-list-type: map uri: description: |- uri is optional field that provides the URL link from which the report was downloaded. @@ -479,8 +506,8 @@ spec: type: object insightsRequestID: description: |- - insightsRequestID is an Insights request ID to track the status of the - Insights analysis (in console.redhat.com processing pipeline) for the corresponding Insights data archive. + insightsRequestID is an optional Insights request ID to track the status of the Insights analysis (in console.redhat.com processing pipeline) for the corresponding Insights data archive. + It may not exceed 256 characters and is immutable once set. maxLength: 256 type: string x-kubernetes-validations: @@ -488,17 +515,18 @@ spec: rule: self == oldSelf relatedObjects: description: |- - relatedObjects is a list of resources which are useful when debugging or inspecting the data - gathering Pod + relatedObjects is an optional list of resources which are useful when debugging or inspecting the data gathering Pod + It may not exceed 100 items and must not contain duplicates. items: description: ObjectReference contains enough information to let you inspect or modify the referred object. properties: group: description: |- - group is the API Group of the Resource. + group is required field that specifies the API Group of the Resource. Enter empty string for the core group. - This value is empty or should follow the DNS1123 subdomain format and it must be at most 253 characters in length. + This value is empty or it should follow the DNS1123 subdomain format. + It must be at most 253 characters in length, and must consist only of lower case alphanumeric characters, '-' and '.', and must start and end with an alphanumeric character. Example: "", "apps", "build.openshift.io", etc. maxLength: 253 type: string @@ -509,9 +537,9 @@ spec: rule: self.size() == 0 || !format.dns1123Subdomain().validate(self).hasValue() name: description: |- - name of the referent that follows the DNS1123 subdomain format. - It must be at most 256 characters in length. - maxLength: 256 + name is required field that specifies the referent that follows the DNS1123 subdomain format. + It must be at most 253 characters in length, and must consist only of lower case alphanumeric characters, '-' and '.', and must start and end with an alphanumeric character. + maxLength: 253 type: string x-kubernetes-validations: - message: a lowercase RFC 1123 subdomain must consist of lower @@ -520,35 +548,38 @@ spec: rule: '!format.dns1123Subdomain().validate(self).hasValue()' namespace: description: |- - namespace of the referent that follows the DNS1123 subdomain format. - It must be at most 253 characters in length. - maxLength: 253 + namespace if required field of the referent that follows the DNS1123 labels format. + It must be at most 63 characters in length, and must must consist of only lowercase alphanumeric characters and hyphens + maxLength: 63 type: string x-kubernetes-validations: - - message: a lowercase RFC 1123 subdomain must consist of lower - case alphanumeric characters, '-' or '.', and must start - and end with an alphanumeric character. - rule: '!format.dns1123Subdomain().validate(self).hasValue()' + - message: the value must consist of only lowercase alphanumeric + characters and hyphens + rule: '!format.dns1123Label().validate(self).hasValue()' resource: description: |- resource is required field of the type that is being referenced. It is normally the plural form of the resource kind in lowercase. - This value should consist of only lowercase alphanumeric characters and hyphens. + It must be at most 63 characters in length, and must must consist of only lowercase alphanumeric characters and hyphens Example: "deployments", "deploymentconfigs", "pods", etc. - maxLength: 512 + maxLength: 63 type: string x-kubernetes-validations: - - message: resource must consist of only lowercase alphanumeric + - message: the value must consist of only lowercase alphanumeric characters and hyphens - rule: self.matches("^[a-z0-9]([-a-z0-9]*[a-z0-9])?$") + rule: '!format.dns1123Label().validate(self).hasValue()' required: - group - name + - namespace - resource type: object maxItems: 100 type: array - x-kubernetes-list-type: atomic + x-kubernetes-list-map-keys: + - name + - namespace + x-kubernetes-list-type: map startTime: description: startTime is the time when Insights data gathering started. format: date-time @@ -564,8 +595,6 @@ spec: rule: (!has(oldSelf.startTime) || has(self.startTime)) - message: cannot remove finishTime attribute from status rule: (!has(oldSelf.finishTime) || has(self.finishTime)) - - message: cannot remove dataGatherState attribute from status - rule: (!has(oldSelf.dataGatherState) || has(self.dataGatherState)) required: - spec type: object diff --git a/insights/v1alpha2/zz_generated.crd-manifests/0000_10_insights_01_datagathers-TechPreviewNoUpgrade.crd.yaml b/insights/v1alpha2/zz_generated.crd-manifests/0000_10_insights_01_datagathers-TechPreviewNoUpgrade.crd.yaml index 240213b115a..e805f2fdd8c 100644 --- a/insights/v1alpha2/zz_generated.crd-manifests/0000_10_insights_01_datagathers-TechPreviewNoUpgrade.crd.yaml +++ b/insights/v1alpha2/zz_generated.crd-manifests/0000_10_insights_01_datagathers-TechPreviewNoUpgrade.crd.yaml @@ -79,8 +79,9 @@ spec: - message: dataPolicy items must be unique rule: self.all(x, self.exists_one(y, x == y)) gatherers: - description: gatherers is an optional field that specifies the configuration - of the gatherers. + description: |- + gatherers is an optional field that specifies the configuration of the gatherers. + If omitted, all gatherers will be run. properties: custom: description: |- @@ -226,8 +227,43 @@ spec: be overridden. properties: conditions: - description: conditions provide details on the status of the gatherer - job. + description: |- + conditions is an optional field that provides details on the status of the gatherer job. + It may not exceed 100 items and must not contain duplicates. + + The current condition types are DataUploaded, DataRecorded, DataProcessed, RemoteConfigurationNotAvailable, RemoteConfigurationInvalid + + The DataUploaded condition is used to represent whether or not the archive was successfully uploaded for further processing. + When it has a status of True and a reason of Succeeded, the archive was successfully uploaded. + When it has a status of Unknown and a reason of NoUploadYet, the upload has not occurred, or there was no data to upload. + When it has a status of False and a reason Failed, the upload failed. The accompanying message will include the specific error encountered. + + The DataRecorded condition is used to represent whether or not the archive was successfully recorded. + When it has a status of True and a reason of Succeeded, the archive was recorded successfully. + When it has a status of Unknown and a reason of NoDataGatheringYet, the data gathering process has not started yet. + When it has a status of False and a reason of RecordingFailed, the recording failed and a message will include the specific error encountered. + + The DataProcessed condition is used to represent whether or not the archive was processed by the processing service. + When it has a status of True and a reason of Processed, the data was processed successfully. + When it has a status of Unknown and a reason of NothingToProcessYet, there is no data to process at the moment. + When it has a status of False and a reason of Failure, processing failed and a message will include the specific error encountered. + + The RemoteConfigurationAvailable condition is used to represent whether the remote configuration is available. + When it has a status of Unknown and a reason of Unknown or RemoteConfigNotRequestedYet, the state of the remote configuration is unknown—typically at startup. + When it has a status of True and a reason of Succeeded, the configuration is available. + When it has a status of False and a reason of NoToken, the configuration was disabled by removing the cloud.openshift.com field from the pull secret. + When it has a status of False and a reason of DisabledByConfiguration, the configuration was disabled in insightsdatagather.config.openshift.io. + + The RemoteConfigurationValid condition is used to represent whether the remote configuration is valid. + When it has a status of Unknown and a reason of Unknown or NoValidationYet, the validity of the remote configuration is unknown—typically at startup. + When it has a status of True and a reason of Succeeded, the configuration is valid. + When it has a status of False and a reason of Invalid, the configuration is invalid. + + The Progressing condition is used to represent the phase of gathering + When it has a status of False and the reason is DataGatherPending, the gathering has not started yet. + When it has a status of True and reason is Gathering, the gathering is running. + When it has a status of False and reason is GatheringSucceeded, the gathering succesfully finished. + When it has a status of False and reason is GatheringFailed, the gathering failed. items: description: Condition contains details for one aspect of the current state of this API Resource. @@ -287,26 +323,6 @@ spec: x-kubernetes-list-map-keys: - type x-kubernetes-list-type: map - dataGatherState: - description: dataGatherState reflects the current state of the data - gathering process. - enum: - - Running - - Completed - - Failed - - Pending - type: string - x-kubernetes-validations: - - message: dataGatherState cannot transition from Running to Pending - rule: '!(oldSelf == ''Running'' && self == ''Pending'')' - - message: dataGatherState cannot transition from Completed to Pending - rule: '!(oldSelf == ''Completed'' && self == ''Pending'')' - - message: dataGatherState cannot transition from Failed to Pending - rule: '!(oldSelf == ''Failed'' && self == ''Pending'')' - - message: dataGatherState cannot transition from Completed to Running - rule: '!(oldSelf == ''Completed'' && self == ''Running'')' - - message: dataGatherState cannot transition from Failed to Running - rule: '!(oldSelf == ''Failed'' && self == ''Running'')' finishTime: description: finishTime is the time when Insights data gathering finished. format: date-time @@ -323,8 +339,17 @@ spec: data gatherer. properties: conditions: - description: conditions provide details on the status of each - gatherer. + description: |- + conditions provide details on the status of each gatherer. + + The current condition type is DataGathered + + The DataGathered condition is used to represent whether or not the data was gathered by a gatherer specified by name. + When it has a status of True and a reason of GatheredOK, the data has been successfully gathered as expected. + When it has a status of False and a reason of NoData, no data was gathered—for example, when the resource is not present in the cluster. + When it has a status of False and a reason of GatherError, an error occurred and no data was gathered. + When it has a status of False and a reason of GatherPanic, a panic occurred during gathering and no data was collected. + When it has a status of False and a reason of GatherWithErrorReason, data was partially gathered or gathered with an error message. items: description: Condition contains details for one aspect of the current state of this API Resource. @@ -386,17 +411,21 @@ spec: x-kubernetes-list-map-keys: - type x-kubernetes-list-type: map - lastGatherDuration: - description: lastGatherDuration represents the time spent gathering. - pattern: ^(([0-9]+(?:\.[0-9]+)?(ns|us|µs|μs|ms|s|m|h))+)$ - type: string + lastGatherSeconds: + description: lastGatherSeconds is required field that represents + the time spent gathering in seconds + format: int32 + minimum: 0 + type: integer name: - description: name is the name of the gatherer. + description: |- + name is the required name of the gatherer. + It must contain at least 5 characters and may not exceed 256 characters. maxLength: 256 minLength: 5 type: string required: - - lastGatherDuration + - lastGatherSeconds - name type: object maxItems: 100 @@ -410,9 +439,9 @@ spec: When omitted, this means no data gathering has taken place yet or the corresponding Insights analysis (identified by "insightsRequestID") is not available. properties: - downloadedAt: + downloadedTime: description: |- - downloadedAt is the time when the last Insights report was downloaded. + downloadedTime is an optional time when the last Insights report was downloaded. An empty value means that there has not been any Insights report downloaded yet and it usually appears in disconnected clusters (or clusters when the Insights data gathering is disabled). format: date-time @@ -435,38 +464,36 @@ spec: - message: advisorURI must be a valid HTTPS URL (e.g., https://example.com) rule: isURL(self) && url(self).getScheme() == "https" description: - description: description provides basic description of the - healtcheck. + description: |- + description is required field that provides basic description of the healtcheck. + It must contain at least 10 characters and may not exceed 2048 characters. maxLength: 2048 minLength: 10 type: string - state: + totalRisk: description: |- - state determines what the current state of the health check is. - Health check is enabled by default and can be disabled - by the user in the Insights advisor user interface. + totalRisk is the required field of the healthcheck. + It is indicator of the total risk posed by the detected issue; combination of impact and likelihood. + Allowed values are Low, Medium, Important and Critical. + The value represents the severity of the issue. enum: - - Enabled - - Disabled + - Low + - Moderate + - Important + - Critical type: string - totalRisk: - description: |- - totalRisk of the healthcheck. Indicator of the total risk posed - by the detected issue; combination of impact and likelihood. The values can be from 1 to 4, - and the higher the number, the more important the issue. - format: int32 - maximum: 4 - minimum: 1 - type: integer required: - advisorURI - description - - state - totalRisk type: object maxItems: 100 type: array - x-kubernetes-list-type: atomic + x-kubernetes-list-map-keys: + - advisorURI + - totalRisk + - description + x-kubernetes-list-type: map uri: description: |- uri is optional field that provides the URL link from which the report was downloaded. @@ -479,8 +506,8 @@ spec: type: object insightsRequestID: description: |- - insightsRequestID is an Insights request ID to track the status of the - Insights analysis (in console.redhat.com processing pipeline) for the corresponding Insights data archive. + insightsRequestID is an optional Insights request ID to track the status of the Insights analysis (in console.redhat.com processing pipeline) for the corresponding Insights data archive. + It may not exceed 256 characters and is immutable once set. maxLength: 256 type: string x-kubernetes-validations: @@ -488,17 +515,18 @@ spec: rule: self == oldSelf relatedObjects: description: |- - relatedObjects is a list of resources which are useful when debugging or inspecting the data - gathering Pod + relatedObjects is an optional list of resources which are useful when debugging or inspecting the data gathering Pod + It may not exceed 100 items and must not contain duplicates. items: description: ObjectReference contains enough information to let you inspect or modify the referred object. properties: group: description: |- - group is the API Group of the Resource. + group is required field that specifies the API Group of the Resource. Enter empty string for the core group. - This value is empty or should follow the DNS1123 subdomain format and it must be at most 253 characters in length. + This value is empty or it should follow the DNS1123 subdomain format. + It must be at most 253 characters in length, and must consist only of lower case alphanumeric characters, '-' and '.', and must start and end with an alphanumeric character. Example: "", "apps", "build.openshift.io", etc. maxLength: 253 type: string @@ -509,9 +537,9 @@ spec: rule: self.size() == 0 || !format.dns1123Subdomain().validate(self).hasValue() name: description: |- - name of the referent that follows the DNS1123 subdomain format. - It must be at most 256 characters in length. - maxLength: 256 + name is required field that specifies the referent that follows the DNS1123 subdomain format. + It must be at most 253 characters in length, and must consist only of lower case alphanumeric characters, '-' and '.', and must start and end with an alphanumeric character. + maxLength: 253 type: string x-kubernetes-validations: - message: a lowercase RFC 1123 subdomain must consist of lower @@ -520,35 +548,38 @@ spec: rule: '!format.dns1123Subdomain().validate(self).hasValue()' namespace: description: |- - namespace of the referent that follows the DNS1123 subdomain format. - It must be at most 253 characters in length. - maxLength: 253 + namespace if required field of the referent that follows the DNS1123 labels format. + It must be at most 63 characters in length, and must must consist of only lowercase alphanumeric characters and hyphens + maxLength: 63 type: string x-kubernetes-validations: - - message: a lowercase RFC 1123 subdomain must consist of lower - case alphanumeric characters, '-' or '.', and must start - and end with an alphanumeric character. - rule: '!format.dns1123Subdomain().validate(self).hasValue()' + - message: the value must consist of only lowercase alphanumeric + characters and hyphens + rule: '!format.dns1123Label().validate(self).hasValue()' resource: description: |- resource is required field of the type that is being referenced. It is normally the plural form of the resource kind in lowercase. - This value should consist of only lowercase alphanumeric characters and hyphens. + It must be at most 63 characters in length, and must must consist of only lowercase alphanumeric characters and hyphens Example: "deployments", "deploymentconfigs", "pods", etc. - maxLength: 512 + maxLength: 63 type: string x-kubernetes-validations: - - message: resource must consist of only lowercase alphanumeric + - message: the value must consist of only lowercase alphanumeric characters and hyphens - rule: self.matches("^[a-z0-9]([-a-z0-9]*[a-z0-9])?$") + rule: '!format.dns1123Label().validate(self).hasValue()' required: - group - name + - namespace - resource type: object maxItems: 100 type: array - x-kubernetes-list-type: atomic + x-kubernetes-list-map-keys: + - name + - namespace + x-kubernetes-list-type: map startTime: description: startTime is the time when Insights data gathering started. format: date-time @@ -564,8 +595,6 @@ spec: rule: (!has(oldSelf.startTime) || has(self.startTime)) - message: cannot remove finishTime attribute from status rule: (!has(oldSelf.finishTime) || has(self.finishTime)) - - message: cannot remove dataGatherState attribute from status - rule: (!has(oldSelf.dataGatherState) || has(self.dataGatherState)) required: - spec type: object diff --git a/insights/v1alpha2/zz_generated.deepcopy.go b/insights/v1alpha2/zz_generated.deepcopy.go index 3016d7fe4a6..78209dc7c17 100644 --- a/insights/v1alpha2/zz_generated.deepcopy.go +++ b/insights/v1alpha2/zz_generated.deepcopy.go @@ -100,7 +100,11 @@ func (in *DataGatherSpec) DeepCopyInto(out *DataGatherSpec) { *out = make([]DataPolicyOption, len(*in)) copy(*out, *in) } - in.Gatherers.DeepCopyInto(&out.Gatherers) + if in.Gatherers != nil { + in, out := &in.Gatherers, &out.Gatherers + *out = new(Gatherers) + (*in).DeepCopyInto(*out) + } if in.Storage != nil { in, out := &in.Storage, &out.Storage *out = new(Storage) @@ -136,8 +140,14 @@ func (in *DataGatherStatus) DeepCopyInto(out *DataGatherStatus) { (*in)[i].DeepCopyInto(&(*out)[i]) } } - in.StartTime.DeepCopyInto(&out.StartTime) - in.FinishTime.DeepCopyInto(&out.FinishTime) + if in.StartTime != nil { + in, out := &in.StartTime, &out.StartTime + *out = (*in).DeepCopy() + } + if in.FinishTime != nil { + in, out := &in.FinishTime, &out.FinishTime + *out = (*in).DeepCopy() + } if in.RelatedObjects != nil { in, out := &in.RelatedObjects, &out.RelatedObjects *out = make([]ObjectReference, len(*in)) @@ -183,7 +193,6 @@ func (in *GathererStatus) DeepCopyInto(out *GathererStatus) { (*in)[i].DeepCopyInto(&(*out)[i]) } } - out.LastGatherDuration = in.LastGatherDuration return } @@ -237,7 +246,10 @@ func (in *HealthCheck) DeepCopy() *HealthCheck { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *InsightsReport) DeepCopyInto(out *InsightsReport) { *out = *in - in.DownloadedAt.DeepCopyInto(&out.DownloadedAt) + if in.DownloadedTime != nil { + in, out := &in.DownloadedTime, &out.DownloadedTime + *out = (*in).DeepCopy() + } if in.HealthChecks != nil { in, out := &in.HealthChecks, &out.HealthChecks *out = make([]HealthCheck, len(*in)) diff --git a/insights/v1alpha2/zz_generated.featuregated-crd-manifests/datagathers.insights.openshift.io/InsightsOnDemandDataGather.yaml b/insights/v1alpha2/zz_generated.featuregated-crd-manifests/datagathers.insights.openshift.io/InsightsOnDemandDataGather.yaml index 7611d269c7c..c7e57b363b8 100644 --- a/insights/v1alpha2/zz_generated.featuregated-crd-manifests/datagathers.insights.openshift.io/InsightsOnDemandDataGather.yaml +++ b/insights/v1alpha2/zz_generated.featuregated-crd-manifests/datagathers.insights.openshift.io/InsightsOnDemandDataGather.yaml @@ -79,8 +79,9 @@ spec: - message: dataPolicy items must be unique rule: self.all(x, self.exists_one(y, x == y)) gatherers: - description: gatherers is an optional field that specifies the configuration - of the gatherers. + description: |- + gatherers is an optional field that specifies the configuration of the gatherers. + If omitted, all gatherers will be run. properties: custom: description: |- @@ -226,8 +227,43 @@ spec: be overridden. properties: conditions: - description: conditions provide details on the status of the gatherer - job. + description: |- + conditions is an optional field that provides details on the status of the gatherer job. + It may not exceed 100 items and must not contain duplicates. + + The current condition types are DataUploaded, DataRecorded, DataProcessed, RemoteConfigurationNotAvailable, RemoteConfigurationInvalid + + The DataUploaded condition is used to represent whether or not the archive was successfully uploaded for further processing. + When it has a status of True and a reason of Succeeded, the archive was successfully uploaded. + When it has a status of Unknown and a reason of NoUploadYet, the upload has not occurred, or there was no data to upload. + When it has a status of False and a reason Failed, the upload failed. The accompanying message will include the specific error encountered. + + The DataRecorded condition is used to represent whether or not the archive was successfully recorded. + When it has a status of True and a reason of Succeeded, the archive was recorded successfully. + When it has a status of Unknown and a reason of NoDataGatheringYet, the data gathering process has not started yet. + When it has a status of False and a reason of RecordingFailed, the recording failed and a message will include the specific error encountered. + + The DataProcessed condition is used to represent whether or not the archive was processed by the processing service. + When it has a status of True and a reason of Processed, the data was processed successfully. + When it has a status of Unknown and a reason of NothingToProcessYet, there is no data to process at the moment. + When it has a status of False and a reason of Failure, processing failed and a message will include the specific error encountered. + + The RemoteConfigurationAvailable condition is used to represent whether the remote configuration is available. + When it has a status of Unknown and a reason of Unknown or RemoteConfigNotRequestedYet, the state of the remote configuration is unknown—typically at startup. + When it has a status of True and a reason of Succeeded, the configuration is available. + When it has a status of False and a reason of NoToken, the configuration was disabled by removing the cloud.openshift.com field from the pull secret. + When it has a status of False and a reason of DisabledByConfiguration, the configuration was disabled in insightsdatagather.config.openshift.io. + + The RemoteConfigurationValid condition is used to represent whether the remote configuration is valid. + When it has a status of Unknown and a reason of Unknown or NoValidationYet, the validity of the remote configuration is unknown—typically at startup. + When it has a status of True and a reason of Succeeded, the configuration is valid. + When it has a status of False and a reason of Invalid, the configuration is invalid. + + The Progressing condition is used to represent the phase of gathering + When it has a status of False and the reason is DataGatherPending, the gathering has not started yet. + When it has a status of True and reason is Gathering, the gathering is running. + When it has a status of False and reason is GatheringSucceeded, the gathering succesfully finished. + When it has a status of False and reason is GatheringFailed, the gathering failed. items: description: Condition contains details for one aspect of the current state of this API Resource. @@ -287,26 +323,6 @@ spec: x-kubernetes-list-map-keys: - type x-kubernetes-list-type: map - dataGatherState: - description: dataGatherState reflects the current state of the data - gathering process. - enum: - - Running - - Completed - - Failed - - Pending - type: string - x-kubernetes-validations: - - message: dataGatherState cannot transition from Running to Pending - rule: '!(oldSelf == ''Running'' && self == ''Pending'')' - - message: dataGatherState cannot transition from Completed to Pending - rule: '!(oldSelf == ''Completed'' && self == ''Pending'')' - - message: dataGatherState cannot transition from Failed to Pending - rule: '!(oldSelf == ''Failed'' && self == ''Pending'')' - - message: dataGatherState cannot transition from Completed to Running - rule: '!(oldSelf == ''Completed'' && self == ''Running'')' - - message: dataGatherState cannot transition from Failed to Running - rule: '!(oldSelf == ''Failed'' && self == ''Running'')' finishTime: description: finishTime is the time when Insights data gathering finished. format: date-time @@ -323,8 +339,17 @@ spec: data gatherer. properties: conditions: - description: conditions provide details on the status of each - gatherer. + description: |- + conditions provide details on the status of each gatherer. + + The current condition type is DataGathered + + The DataGathered condition is used to represent whether or not the data was gathered by a gatherer specified by name. + When it has a status of True and a reason of GatheredOK, the data has been successfully gathered as expected. + When it has a status of False and a reason of NoData, no data was gathered—for example, when the resource is not present in the cluster. + When it has a status of False and a reason of GatherError, an error occurred and no data was gathered. + When it has a status of False and a reason of GatherPanic, a panic occurred during gathering and no data was collected. + When it has a status of False and a reason of GatherWithErrorReason, data was partially gathered or gathered with an error message. items: description: Condition contains details for one aspect of the current state of this API Resource. @@ -386,17 +411,21 @@ spec: x-kubernetes-list-map-keys: - type x-kubernetes-list-type: map - lastGatherDuration: - description: lastGatherDuration represents the time spent gathering. - pattern: ^(([0-9]+(?:\.[0-9]+)?(ns|us|µs|μs|ms|s|m|h))+)$ - type: string + lastGatherSeconds: + description: lastGatherSeconds is required field that represents + the time spent gathering in seconds + format: int32 + minimum: 0 + type: integer name: - description: name is the name of the gatherer. + description: |- + name is the required name of the gatherer. + It must contain at least 5 characters and may not exceed 256 characters. maxLength: 256 minLength: 5 type: string required: - - lastGatherDuration + - lastGatherSeconds - name type: object maxItems: 100 @@ -410,9 +439,9 @@ spec: When omitted, this means no data gathering has taken place yet or the corresponding Insights analysis (identified by "insightsRequestID") is not available. properties: - downloadedAt: + downloadedTime: description: |- - downloadedAt is the time when the last Insights report was downloaded. + downloadedTime is an optional time when the last Insights report was downloaded. An empty value means that there has not been any Insights report downloaded yet and it usually appears in disconnected clusters (or clusters when the Insights data gathering is disabled). format: date-time @@ -435,38 +464,36 @@ spec: - message: advisorURI must be a valid HTTPS URL (e.g., https://example.com) rule: isURL(self) && url(self).getScheme() == "https" description: - description: description provides basic description of the - healtcheck. + description: |- + description is required field that provides basic description of the healtcheck. + It must contain at least 10 characters and may not exceed 2048 characters. maxLength: 2048 minLength: 10 type: string - state: + totalRisk: description: |- - state determines what the current state of the health check is. - Health check is enabled by default and can be disabled - by the user in the Insights advisor user interface. + totalRisk is the required field of the healthcheck. + It is indicator of the total risk posed by the detected issue; combination of impact and likelihood. + Allowed values are Low, Medium, Important and Critical. + The value represents the severity of the issue. enum: - - Enabled - - Disabled + - Low + - Moderate + - Important + - Critical type: string - totalRisk: - description: |- - totalRisk of the healthcheck. Indicator of the total risk posed - by the detected issue; combination of impact and likelihood. The values can be from 1 to 4, - and the higher the number, the more important the issue. - format: int32 - maximum: 4 - minimum: 1 - type: integer required: - advisorURI - description - - state - totalRisk type: object maxItems: 100 type: array - x-kubernetes-list-type: atomic + x-kubernetes-list-map-keys: + - advisorURI + - totalRisk + - description + x-kubernetes-list-type: map uri: description: |- uri is optional field that provides the URL link from which the report was downloaded. @@ -479,8 +506,8 @@ spec: type: object insightsRequestID: description: |- - insightsRequestID is an Insights request ID to track the status of the - Insights analysis (in console.redhat.com processing pipeline) for the corresponding Insights data archive. + insightsRequestID is an optional Insights request ID to track the status of the Insights analysis (in console.redhat.com processing pipeline) for the corresponding Insights data archive. + It may not exceed 256 characters and is immutable once set. maxLength: 256 type: string x-kubernetes-validations: @@ -488,17 +515,18 @@ spec: rule: self == oldSelf relatedObjects: description: |- - relatedObjects is a list of resources which are useful when debugging or inspecting the data - gathering Pod + relatedObjects is an optional list of resources which are useful when debugging or inspecting the data gathering Pod + It may not exceed 100 items and must not contain duplicates. items: description: ObjectReference contains enough information to let you inspect or modify the referred object. properties: group: description: |- - group is the API Group of the Resource. + group is required field that specifies the API Group of the Resource. Enter empty string for the core group. - This value is empty or should follow the DNS1123 subdomain format and it must be at most 253 characters in length. + This value is empty or it should follow the DNS1123 subdomain format. + It must be at most 253 characters in length, and must consist only of lower case alphanumeric characters, '-' and '.', and must start and end with an alphanumeric character. Example: "", "apps", "build.openshift.io", etc. maxLength: 253 type: string @@ -509,9 +537,9 @@ spec: rule: self.size() == 0 || !format.dns1123Subdomain().validate(self).hasValue() name: description: |- - name of the referent that follows the DNS1123 subdomain format. - It must be at most 256 characters in length. - maxLength: 256 + name is required field that specifies the referent that follows the DNS1123 subdomain format. + It must be at most 253 characters in length, and must consist only of lower case alphanumeric characters, '-' and '.', and must start and end with an alphanumeric character. + maxLength: 253 type: string x-kubernetes-validations: - message: a lowercase RFC 1123 subdomain must consist of lower @@ -520,35 +548,38 @@ spec: rule: '!format.dns1123Subdomain().validate(self).hasValue()' namespace: description: |- - namespace of the referent that follows the DNS1123 subdomain format. - It must be at most 253 characters in length. - maxLength: 253 + namespace if required field of the referent that follows the DNS1123 labels format. + It must be at most 63 characters in length, and must must consist of only lowercase alphanumeric characters and hyphens + maxLength: 63 type: string x-kubernetes-validations: - - message: a lowercase RFC 1123 subdomain must consist of lower - case alphanumeric characters, '-' or '.', and must start - and end with an alphanumeric character. - rule: '!format.dns1123Subdomain().validate(self).hasValue()' + - message: the value must consist of only lowercase alphanumeric + characters and hyphens + rule: '!format.dns1123Label().validate(self).hasValue()' resource: description: |- resource is required field of the type that is being referenced. It is normally the plural form of the resource kind in lowercase. - This value should consist of only lowercase alphanumeric characters and hyphens. + It must be at most 63 characters in length, and must must consist of only lowercase alphanumeric characters and hyphens Example: "deployments", "deploymentconfigs", "pods", etc. - maxLength: 512 + maxLength: 63 type: string x-kubernetes-validations: - - message: resource must consist of only lowercase alphanumeric + - message: the value must consist of only lowercase alphanumeric characters and hyphens - rule: self.matches("^[a-z0-9]([-a-z0-9]*[a-z0-9])?$") + rule: '!format.dns1123Label().validate(self).hasValue()' required: - group - name + - namespace - resource type: object maxItems: 100 type: array - x-kubernetes-list-type: atomic + x-kubernetes-list-map-keys: + - name + - namespace + x-kubernetes-list-type: map startTime: description: startTime is the time when Insights data gathering started. format: date-time @@ -564,8 +595,6 @@ spec: rule: (!has(oldSelf.startTime) || has(self.startTime)) - message: cannot remove finishTime attribute from status rule: (!has(oldSelf.finishTime) || has(self.finishTime)) - - message: cannot remove dataGatherState attribute from status - rule: (!has(oldSelf.dataGatherState) || has(self.dataGatherState)) required: - spec type: object diff --git a/insights/v1alpha2/zz_generated.swagger_doc_generated.go b/insights/v1alpha2/zz_generated.swagger_doc_generated.go index 8a9ab7e5be3..203f8141254 100644 --- a/insights/v1alpha2/zz_generated.swagger_doc_generated.go +++ b/insights/v1alpha2/zz_generated.swagger_doc_generated.go @@ -44,7 +44,7 @@ func (DataGatherList) SwaggerDoc() map[string]string { var map_DataGatherSpec = map[string]string{ "": "DataGatherSpec contains the configuration for the DataGather.", "dataPolicy": "dataPolicy is an optional list of DataPolicyOptions that allows user to enable additional obfuscation of the Insights archive data. It may not exceed 2 items and must not contain duplicates. Valid values are ObfuscateNetworking and WorkloadNames. When set to ObfuscateNetworking the IP addresses and the cluster domain name are obfuscated. When set to WorkloadNames, the gathered data about cluster resources will not contain the workload names for your deployments. Resources UIDs will be used instead. When omitted no obfuscation is applied.", - "gatherers": "gatherers is an optional field that specifies the configuration of the gatherers.", + "gatherers": "gatherers is an optional field that specifies the configuration of the gatherers. If omitted, all gatherers will be run.", "storage": "storage is an optional field that allows user to define persistent storage for gathering jobs to store the Insights data archive. If omitted, the gathering job will use ephemeral storage.", } @@ -54,13 +54,12 @@ func (DataGatherSpec) SwaggerDoc() map[string]string { var map_DataGatherStatus = map[string]string{ "": "DataGatherStatus contains information relating to the DataGather state.", - "conditions": "conditions provide details on the status of the gatherer job.", - "dataGatherState": "dataGatherState reflects the current state of the data gathering process.", + "conditions": "conditions is an optional field that provides details on the status of the gatherer job. It may not exceed 100 items and must not contain duplicates.\n\nThe current condition types are DataUploaded, DataRecorded, DataProcessed, RemoteConfigurationNotAvailable, RemoteConfigurationInvalid\n\nThe DataUploaded condition is used to represent whether or not the archive was successfully uploaded for further processing. When it has a status of True and a reason of Succeeded, the archive was successfully uploaded. When it has a status of Unknown and a reason of NoUploadYet, the upload has not occurred, or there was no data to upload. When it has a status of False and a reason Failed, the upload failed. The accompanying message will include the specific error encountered.\n\nThe DataRecorded condition is used to represent whether or not the archive was successfully recorded. When it has a status of True and a reason of Succeeded, the archive was recorded successfully. When it has a status of Unknown and a reason of NoDataGatheringYet, the data gathering process has not started yet. When it has a status of False and a reason of RecordingFailed, the recording failed and a message will include the specific error encountered.\n\nThe DataProcessed condition is used to represent whether or not the archive was processed by the processing service. When it has a status of True and a reason of Processed, the data was processed successfully. When it has a status of Unknown and a reason of NothingToProcessYet, there is no data to process at the moment. When it has a status of False and a reason of Failure, processing failed and a message will include the specific error encountered.\n\nThe RemoteConfigurationAvailable condition is used to represent whether the remote configuration is available. When it has a status of Unknown and a reason of Unknown or RemoteConfigNotRequestedYet, the state of the remote configuration is unknown—typically at startup. When it has a status of True and a reason of Succeeded, the configuration is available. When it has a status of False and a reason of NoToken, the configuration was disabled by removing the cloud.openshift.com field from the pull secret. When it has a status of False and a reason of DisabledByConfiguration, the configuration was disabled in insightsdatagather.config.openshift.io.\n\nThe RemoteConfigurationValid condition is used to represent whether the remote configuration is valid. When it has a status of Unknown and a reason of Unknown or NoValidationYet, the validity of the remote configuration is unknown—typically at startup. When it has a status of True and a reason of Succeeded, the configuration is valid. When it has a status of False and a reason of Invalid, the configuration is invalid.\n\nThe Progressing condition is used to represent the phase of gathering When it has a status of False and the reason is DataGatherPending, the gathering has not started yet. When it has a status of True and reason is Gathering, the gathering is running. When it has a status of False and reason is GatheringSucceeded, the gathering succesfully finished. When it has a status of False and reason is GatheringFailed, the gathering failed.", "gatherers": "gatherers is a list of active gatherers (and their statuses) in the last gathering.", "startTime": "startTime is the time when Insights data gathering started.", "finishTime": "finishTime is the time when Insights data gathering finished.", - "relatedObjects": "relatedObjects is a list of resources which are useful when debugging or inspecting the data gathering Pod", - "insightsRequestID": "insightsRequestID is an Insights request ID to track the status of the Insights analysis (in console.redhat.com processing pipeline) for the corresponding Insights data archive.", + "relatedObjects": "relatedObjects is an optional list of resources which are useful when debugging or inspecting the data gathering Pod It may not exceed 100 items and must not contain duplicates.", + "insightsRequestID": "insightsRequestID is an optional Insights request ID to track the status of the Insights analysis (in console.redhat.com processing pipeline) for the corresponding Insights data archive. It may not exceed 256 characters and is immutable once set.", "insightsReport": "insightsReport provides general Insights analysis results. When omitted, this means no data gathering has taken place yet or the corresponding Insights analysis (identified by \"insightsRequestID\") is not available.", } @@ -79,10 +78,10 @@ func (GathererConfig) SwaggerDoc() map[string]string { } var map_GathererStatus = map[string]string{ - "": "gathererStatus represents information about a particular data gatherer.", - "conditions": "conditions provide details on the status of each gatherer.", - "name": "name is the name of the gatherer.", - "lastGatherDuration": "lastGatherDuration represents the time spent gathering.", + "": "gathererStatus represents information about a particular data gatherer.", + "conditions": "conditions provide details on the status of each gatherer.\n\nThe current condition type is DataGathered\n\nThe DataGathered condition is used to represent whether or not the data was gathered by a gatherer specified by name. When it has a status of True and a reason of GatheredOK, the data has been successfully gathered as expected. When it has a status of False and a reason of NoData, no data was gathered—for example, when the resource is not present in the cluster. When it has a status of False and a reason of GatherError, an error occurred and no data was gathered. When it has a status of False and a reason of GatherPanic, a panic occurred during gathering and no data was collected. When it has a status of False and a reason of GatherWithErrorReason, data was partially gathered or gathered with an error message.", + "name": "name is the required name of the gatherer. It must contain at least 5 characters and may not exceed 256 characters.", + "lastGatherSeconds": "lastGatherSeconds is required field that represents the time spent gathering in seconds", } func (GathererStatus) SwaggerDoc() map[string]string { @@ -101,10 +100,9 @@ func (Gatherers) SwaggerDoc() map[string]string { var map_HealthCheck = map[string]string{ "": "healthCheck represents an Insights health check attributes.", - "description": "description provides basic description of the healtcheck.", - "totalRisk": "totalRisk of the healthcheck. Indicator of the total risk posed by the detected issue; combination of impact and likelihood. The values can be from 1 to 4, and the higher the number, the more important the issue.", + "description": "description is required field that provides basic description of the healtcheck. It must contain at least 10 characters and may not exceed 2048 characters.", + "totalRisk": "totalRisk is the required field of the healthcheck. It is indicator of the total risk posed by the detected issue; combination of impact and likelihood. Allowed values are Low, Medium, Important and Critical. The value represents the severity of the issue.", "advisorURI": "advisorURI is required field that provides the URL link to the Insights Advisor. The link must be a valid HTTPS URL and the maximum length is 2048 characters.", - "state": "state determines what the current state of the health check is. Health check is enabled by default and can be disabled by the user in the Insights advisor user interface.", } func (HealthCheck) SwaggerDoc() map[string]string { @@ -112,10 +110,10 @@ func (HealthCheck) SwaggerDoc() map[string]string { } var map_InsightsReport = map[string]string{ - "": "insightsReport provides Insights health check report based on the most recently sent Insights data.", - "downloadedAt": "downloadedAt is the time when the last Insights report was downloaded. An empty value means that there has not been any Insights report downloaded yet and it usually appears in disconnected clusters (or clusters when the Insights data gathering is disabled).", - "healthChecks": "healthChecks provides basic information about active Insights health checks in a cluster.", - "uri": "uri is optional field that provides the URL link from which the report was downloaded. The link must be a valid HTTPS URL and the maximum length is 2048 characters.", + "": "insightsReport provides Insights health check report based on the most recently sent Insights data.", + "downloadedTime": "downloadedTime is an optional time when the last Insights report was downloaded. An empty value means that there has not been any Insights report downloaded yet and it usually appears in disconnected clusters (or clusters when the Insights data gathering is disabled).", + "healthChecks": "healthChecks provides basic information about active Insights health checks in a cluster.", + "uri": "uri is optional field that provides the URL link from which the report was downloaded. The link must be a valid HTTPS URL and the maximum length is 2048 characters.", } func (InsightsReport) SwaggerDoc() map[string]string { @@ -124,10 +122,10 @@ func (InsightsReport) SwaggerDoc() map[string]string { var map_ObjectReference = map[string]string{ "": "ObjectReference contains enough information to let you inspect or modify the referred object.", - "group": "group is the API Group of the Resource. Enter empty string for the core group. This value is empty or should follow the DNS1123 subdomain format and it must be at most 253 characters in length. Example: \"\", \"apps\", \"build.openshift.io\", etc.", - "resource": "resource is required field of the type that is being referenced. It is normally the plural form of the resource kind in lowercase. This value should consist of only lowercase alphanumeric characters and hyphens. Example: \"deployments\", \"deploymentconfigs\", \"pods\", etc.", - "name": "name of the referent that follows the DNS1123 subdomain format. It must be at most 256 characters in length.", - "namespace": "namespace of the referent that follows the DNS1123 subdomain format. It must be at most 253 characters in length.", + "group": "group is required field that specifies the API Group of the Resource. Enter empty string for the core group. This value is empty or it should follow the DNS1123 subdomain format. It must be at most 253 characters in length, and must consist only of lower case alphanumeric characters, '-' and '.', and must start and end with an alphanumeric character. Example: \"\", \"apps\", \"build.openshift.io\", etc.", + "resource": "resource is required field of the type that is being referenced. It is normally the plural form of the resource kind in lowercase. It must be at most 63 characters in length, and must must consist of only lowercase alphanumeric characters and hyphens Example: \"deployments\", \"deploymentconfigs\", \"pods\", etc.", + "name": "name is required field that specifies the referent that follows the DNS1123 subdomain format. It must be at most 253 characters in length, and must consist only of lower case alphanumeric characters, '-' and '.', and must start and end with an alphanumeric character.", + "namespace": "namespace if required field of the referent that follows the DNS1123 labels format. It must be at most 63 characters in length, and must must consist of only lowercase alphanumeric characters and hyphens", } func (ObjectReference) SwaggerDoc() map[string]string { diff --git a/openapi/generated_openapi/zz_generated.openapi.go b/openapi/generated_openapi/zz_generated.openapi.go index 15fe75b31c3..e881a055d61 100644 --- a/openapi/generated_openapi/zz_generated.openapi.go +++ b/openapi/generated_openapi/zz_generated.openapi.go @@ -27773,8 +27773,7 @@ func schema_openshift_api_insights_v1alpha2_DataGatherSpec(ref common.ReferenceC }, "gatherers": { SchemaProps: spec.SchemaProps{ - Description: "gatherers is an optional field that specifies the configuration of the gatherers.", - Default: map[string]interface{}{}, + Description: "gatherers is an optional field that specifies the configuration of the gatherers. If omitted, all gatherers will be run.", Ref: ref("github.com/openshift/api/insights/v1alpha2.Gatherers"), }, }, @@ -27809,7 +27808,7 @@ func schema_openshift_api_insights_v1alpha2_DataGatherStatus(ref common.Referenc }, }, SchemaProps: spec.SchemaProps{ - Description: "conditions provide details on the status of the gatherer job.", + Description: "conditions is an optional field that provides details on the status of the gatherer job. It may not exceed 100 items and must not contain duplicates.\n\nThe current condition types are DataUploaded, DataRecorded, DataProcessed, RemoteConfigurationNotAvailable, RemoteConfigurationInvalid\n\nThe DataUploaded condition is used to represent whether or not the archive was successfully uploaded for further processing. When it has a status of True and a reason of Succeeded, the archive was successfully uploaded. When it has a status of Unknown and a reason of NoUploadYet, the upload has not occurred, or there was no data to upload. When it has a status of False and a reason Failed, the upload failed. The accompanying message will include the specific error encountered.\n\nThe DataRecorded condition is used to represent whether or not the archive was successfully recorded. When it has a status of True and a reason of Succeeded, the archive was recorded successfully. When it has a status of Unknown and a reason of NoDataGatheringYet, the data gathering process has not started yet. When it has a status of False and a reason of RecordingFailed, the recording failed and a message will include the specific error encountered.\n\nThe DataProcessed condition is used to represent whether or not the archive was processed by the processing service. When it has a status of True and a reason of Processed, the data was processed successfully. When it has a status of Unknown and a reason of NothingToProcessYet, there is no data to process at the moment. When it has a status of False and a reason of Failure, processing failed and a message will include the specific error encountered.\n\nThe RemoteConfigurationAvailable condition is used to represent whether the remote configuration is available. When it has a status of Unknown and a reason of Unknown or RemoteConfigNotRequestedYet, the state of the remote configuration is unknown—typically at startup. When it has a status of True and a reason of Succeeded, the configuration is available. When it has a status of False and a reason of NoToken, the configuration was disabled by removing the cloud.openshift.com field from the pull secret. When it has a status of False and a reason of DisabledByConfiguration, the configuration was disabled in insightsdatagather.config.openshift.io.\n\nThe RemoteConfigurationValid condition is used to represent whether the remote configuration is valid. When it has a status of Unknown and a reason of Unknown or NoValidationYet, the validity of the remote configuration is unknown—typically at startup. When it has a status of True and a reason of Succeeded, the configuration is valid. When it has a status of False and a reason of Invalid, the configuration is invalid.\n\nThe Progressing condition is used to represent the phase of gathering When it has a status of False and the reason is DataGatherPending, the gathering has not started yet. When it has a status of True and reason is Gathering, the gathering is running. When it has a status of False and reason is GatheringSucceeded, the gathering succesfully finished. When it has a status of False and reason is GatheringFailed, the gathering failed.", Type: []string{"array"}, Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ @@ -27821,13 +27820,6 @@ func schema_openshift_api_insights_v1alpha2_DataGatherStatus(ref common.Referenc }, }, }, - "dataGatherState": { - SchemaProps: spec.SchemaProps{ - Description: "dataGatherState reflects the current state of the data gathering process.", - Type: []string{"string"}, - Format: "", - }, - }, "gatherers": { VendorExtensible: spec.VendorExtensible{ Extensions: spec.Extensions{ @@ -27865,11 +27857,15 @@ func schema_openshift_api_insights_v1alpha2_DataGatherStatus(ref common.Referenc "relatedObjects": { VendorExtensible: spec.VendorExtensible{ Extensions: spec.Extensions{ - "x-kubernetes-list-type": "atomic", + "x-kubernetes-list-map-keys": []interface{}{ + "name", + "namespace", + }, + "x-kubernetes-list-type": "map", }, }, SchemaProps: spec.SchemaProps{ - Description: "relatedObjects is a list of resources which are useful when debugging or inspecting the data gathering Pod", + Description: "relatedObjects is an optional list of resources which are useful when debugging or inspecting the data gathering Pod It may not exceed 100 items and must not contain duplicates.", Type: []string{"array"}, Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ @@ -27883,7 +27879,7 @@ func schema_openshift_api_insights_v1alpha2_DataGatherStatus(ref common.Referenc }, "insightsRequestID": { SchemaProps: spec.SchemaProps{ - Description: "insightsRequestID is an Insights request ID to track the status of the Insights analysis (in console.redhat.com processing pipeline) for the corresponding Insights data archive.", + Description: "insightsRequestID is an optional Insights request ID to track the status of the Insights analysis (in console.redhat.com processing pipeline) for the corresponding Insights data archive. It may not exceed 256 characters and is immutable once set.", Type: []string{"string"}, Format: "", }, @@ -27950,7 +27946,7 @@ func schema_openshift_api_insights_v1alpha2_GathererStatus(ref common.ReferenceC }, }, SchemaProps: spec.SchemaProps{ - Description: "conditions provide details on the status of each gatherer.", + Description: "conditions provide details on the status of each gatherer.\n\nThe current condition type is DataGathered\n\nThe DataGathered condition is used to represent whether or not the data was gathered by a gatherer specified by name. When it has a status of True and a reason of GatheredOK, the data has been successfully gathered as expected. When it has a status of False and a reason of NoData, no data was gathered—for example, when the resource is not present in the cluster. When it has a status of False and a reason of GatherError, an error occurred and no data was gathered. When it has a status of False and a reason of GatherPanic, a panic occurred during gathering and no data was collected. When it has a status of False and a reason of GatherWithErrorReason, data was partially gathered or gathered with an error message.", Type: []string{"array"}, Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ @@ -27964,24 +27960,26 @@ func schema_openshift_api_insights_v1alpha2_GathererStatus(ref common.ReferenceC }, "name": { SchemaProps: spec.SchemaProps{ - Description: "name is the name of the gatherer.", + Description: "name is the required name of the gatherer. It must contain at least 5 characters and may not exceed 256 characters.", Default: "", Type: []string{"string"}, Format: "", }, }, - "lastGatherDuration": { + "lastGatherSeconds": { SchemaProps: spec.SchemaProps{ - Description: "lastGatherDuration represents the time spent gathering.", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Duration"), + Description: "lastGatherSeconds is required field that represents the time spent gathering in seconds", + Default: 0, + Type: []string{"integer"}, + Format: "int32", }, }, }, - Required: []string{"name", "lastGatherDuration"}, + Required: []string{"name", "lastGatherSeconds"}, }, }, Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.Condition", "k8s.io/apimachinery/pkg/apis/meta/v1.Duration"}, + "k8s.io/apimachinery/pkg/apis/meta/v1.Condition"}, } } @@ -28009,6 +28007,18 @@ func schema_openshift_api_insights_v1alpha2_Gatherers(ref common.ReferenceCallba }, Required: []string{"mode"}, }, + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-unions": []interface{}{ + map[string]interface{}{ + "discriminator": "mode", + "fields-to-discriminateBy": map[string]interface{}{ + "custom": "Custom", + }, + }, + }, + }, + }, }, Dependencies: []string{ "github.com/openshift/api/insights/v1alpha2.Custom"}, @@ -28024,7 +28034,7 @@ func schema_openshift_api_insights_v1alpha2_HealthCheck(ref common.ReferenceCall Properties: map[string]spec.Schema{ "description": { SchemaProps: spec.SchemaProps{ - Description: "description provides basic description of the healtcheck.", + Description: "description is required field that provides basic description of the healtcheck. It must contain at least 10 characters and may not exceed 2048 characters.", Default: "", Type: []string{"string"}, Format: "", @@ -28032,30 +28042,22 @@ func schema_openshift_api_insights_v1alpha2_HealthCheck(ref common.ReferenceCall }, "totalRisk": { SchemaProps: spec.SchemaProps{ - Description: "totalRisk of the healthcheck. Indicator of the total risk posed by the detected issue; combination of impact and likelihood. The values can be from 1 to 4, and the higher the number, the more important the issue.", - Default: 0, - Type: []string{"integer"}, - Format: "int32", - }, - }, - "advisorURI": { - SchemaProps: spec.SchemaProps{ - Description: "advisorURI is required field that provides the URL link to the Insights Advisor. The link must be a valid HTTPS URL and the maximum length is 2048 characters.", + Description: "totalRisk is the required field of the healthcheck. It is indicator of the total risk posed by the detected issue; combination of impact and likelihood. Allowed values are Low, Medium, Important and Critical. The value represents the severity of the issue.", Default: "", Type: []string{"string"}, Format: "", }, }, - "state": { + "advisorURI": { SchemaProps: spec.SchemaProps{ - Description: "state determines what the current state of the health check is. Health check is enabled by default and can be disabled by the user in the Insights advisor user interface.", + Description: "advisorURI is required field that provides the URL link to the Insights Advisor. The link must be a valid HTTPS URL and the maximum length is 2048 characters.", Default: "", Type: []string{"string"}, Format: "", }, }, }, - Required: []string{"description", "totalRisk", "advisorURI", "state"}, + Required: []string{"description", "totalRisk", "advisorURI"}, }, }, } @@ -28068,16 +28070,21 @@ func schema_openshift_api_insights_v1alpha2_InsightsReport(ref common.ReferenceC Description: "insightsReport provides Insights health check report based on the most recently sent Insights data.", Type: []string{"object"}, Properties: map[string]spec.Schema{ - "downloadedAt": { + "downloadedTime": { SchemaProps: spec.SchemaProps{ - Description: "downloadedAt is the time when the last Insights report was downloaded. An empty value means that there has not been any Insights report downloaded yet and it usually appears in disconnected clusters (or clusters when the Insights data gathering is disabled).", + Description: "downloadedTime is an optional time when the last Insights report was downloaded. An empty value means that there has not been any Insights report downloaded yet and it usually appears in disconnected clusters (or clusters when the Insights data gathering is disabled).", Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Time"), }, }, "healthChecks": { VendorExtensible: spec.VendorExtensible{ Extensions: spec.Extensions{ - "x-kubernetes-list-type": "atomic", + "x-kubernetes-list-map-keys": []interface{}{ + "advisorURI", + "totalRisk", + "description", + }, + "x-kubernetes-list-type": "map", }, }, SchemaProps: spec.SchemaProps{ @@ -28117,7 +28124,7 @@ func schema_openshift_api_insights_v1alpha2_ObjectReference(ref common.Reference Properties: map[string]spec.Schema{ "group": { SchemaProps: spec.SchemaProps{ - Description: "group is the API Group of the Resource. Enter empty string for the core group. This value is empty or should follow the DNS1123 subdomain format and it must be at most 253 characters in length. Example: \"\", \"apps\", \"build.openshift.io\", etc.", + Description: "group is required field that specifies the API Group of the Resource. Enter empty string for the core group. This value is empty or it should follow the DNS1123 subdomain format. It must be at most 253 characters in length, and must consist only of lower case alphanumeric characters, '-' and '.', and must start and end with an alphanumeric character. Example: \"\", \"apps\", \"build.openshift.io\", etc.", Default: "", Type: []string{"string"}, Format: "", @@ -28125,7 +28132,7 @@ func schema_openshift_api_insights_v1alpha2_ObjectReference(ref common.Reference }, "resource": { SchemaProps: spec.SchemaProps{ - Description: "resource is required field of the type that is being referenced. It is normally the plural form of the resource kind in lowercase. This value should consist of only lowercase alphanumeric characters and hyphens. Example: \"deployments\", \"deploymentconfigs\", \"pods\", etc.", + Description: "resource is required field of the type that is being referenced. It is normally the plural form of the resource kind in lowercase. It must be at most 63 characters in length, and must must consist of only lowercase alphanumeric characters and hyphens Example: \"deployments\", \"deploymentconfigs\", \"pods\", etc.", Default: "", Type: []string{"string"}, Format: "", @@ -28133,7 +28140,7 @@ func schema_openshift_api_insights_v1alpha2_ObjectReference(ref common.Reference }, "name": { SchemaProps: spec.SchemaProps{ - Description: "name of the referent that follows the DNS1123 subdomain format. It must be at most 256 characters in length.", + Description: "name is required field that specifies the referent that follows the DNS1123 subdomain format. It must be at most 253 characters in length, and must consist only of lower case alphanumeric characters, '-' and '.', and must start and end with an alphanumeric character.", Default: "", Type: []string{"string"}, Format: "", @@ -28141,13 +28148,14 @@ func schema_openshift_api_insights_v1alpha2_ObjectReference(ref common.Reference }, "namespace": { SchemaProps: spec.SchemaProps{ - Description: "namespace of the referent that follows the DNS1123 subdomain format. It must be at most 253 characters in length.", + Description: "namespace if required field of the referent that follows the DNS1123 labels format. It must be at most 63 characters in length, and must must consist of only lowercase alphanumeric characters and hyphens", + Default: "", Type: []string{"string"}, Format: "", }, }, }, - Required: []string{"group", "resource", "name"}, + Required: []string{"group", "resource", "name", "namespace"}, }, }, } @@ -28229,6 +28237,18 @@ func schema_openshift_api_insights_v1alpha2_Storage(ref common.ReferenceCallback }, Required: []string{"type"}, }, + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-unions": []interface{}{ + map[string]interface{}{ + "discriminator": "type", + "fields-to-discriminateBy": map[string]interface{}{ + "persistentVolume": "PersistentVolume", + }, + }, + }, + }, + }, }, Dependencies: []string{ "github.com/openshift/api/insights/v1alpha2.PersistentVolumeConfig"}, diff --git a/openapi/openapi.json b/openapi/openapi.json index 85c27fba715..eff35090db3 100644 --- a/openapi/openapi.json +++ b/openapi/openapi.json @@ -15527,8 +15527,7 @@ "x-kubernetes-list-type": "atomic" }, "gatherers": { - "description": "gatherers is an optional field that specifies the configuration of the gatherers.", - "default": {}, + "description": "gatherers is an optional field that specifies the configuration of the gatherers. If omitted, all gatherers will be run.", "$ref": "#/definitions/com.github.openshift.api.insights.v1alpha2.Gatherers" }, "storage": { @@ -15542,7 +15541,7 @@ "type": "object", "properties": { "conditions": { - "description": "conditions provide details on the status of the gatherer job.", + "description": "conditions is an optional field that provides details on the status of the gatherer job. It may not exceed 100 items and must not contain duplicates.\n\nThe current condition types are DataUploaded, DataRecorded, DataProcessed, RemoteConfigurationNotAvailable, RemoteConfigurationInvalid\n\nThe DataUploaded condition is used to represent whether or not the archive was successfully uploaded for further processing. When it has a status of True and a reason of Succeeded, the archive was successfully uploaded. When it has a status of Unknown and a reason of NoUploadYet, the upload has not occurred, or there was no data to upload. When it has a status of False and a reason Failed, the upload failed. The accompanying message will include the specific error encountered.\n\nThe DataRecorded condition is used to represent whether or not the archive was successfully recorded. When it has a status of True and a reason of Succeeded, the archive was recorded successfully. When it has a status of Unknown and a reason of NoDataGatheringYet, the data gathering process has not started yet. When it has a status of False and a reason of RecordingFailed, the recording failed and a message will include the specific error encountered.\n\nThe DataProcessed condition is used to represent whether or not the archive was processed by the processing service. When it has a status of True and a reason of Processed, the data was processed successfully. When it has a status of Unknown and a reason of NothingToProcessYet, there is no data to process at the moment. When it has a status of False and a reason of Failure, processing failed and a message will include the specific error encountered.\n\nThe RemoteConfigurationAvailable condition is used to represent whether the remote configuration is available. When it has a status of Unknown and a reason of Unknown or RemoteConfigNotRequestedYet, the state of the remote configuration is unknown—typically at startup. When it has a status of True and a reason of Succeeded, the configuration is available. When it has a status of False and a reason of NoToken, the configuration was disabled by removing the cloud.openshift.com field from the pull secret. When it has a status of False and a reason of DisabledByConfiguration, the configuration was disabled in insightsdatagather.config.openshift.io.\n\nThe RemoteConfigurationValid condition is used to represent whether the remote configuration is valid. When it has a status of Unknown and a reason of Unknown or NoValidationYet, the validity of the remote configuration is unknown—typically at startup. When it has a status of True and a reason of Succeeded, the configuration is valid. When it has a status of False and a reason of Invalid, the configuration is invalid.\n\nThe Progressing condition is used to represent the phase of gathering When it has a status of False and the reason is DataGatherPending, the gathering has not started yet. When it has a status of True and reason is Gathering, the gathering is running. When it has a status of False and reason is GatheringSucceeded, the gathering succesfully finished. When it has a status of False and reason is GatheringFailed, the gathering failed.", "type": "array", "items": { "default": {}, @@ -15553,10 +15552,6 @@ ], "x-kubernetes-list-type": "map" }, - "dataGatherState": { - "description": "dataGatherState reflects the current state of the data gathering process.", - "type": "string" - }, "finishTime": { "description": "finishTime is the time when Insights data gathering finished.", "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.Time" @@ -15579,17 +15574,21 @@ "$ref": "#/definitions/com.github.openshift.api.insights.v1alpha2.InsightsReport" }, "insightsRequestID": { - "description": "insightsRequestID is an Insights request ID to track the status of the Insights analysis (in console.redhat.com processing pipeline) for the corresponding Insights data archive.", + "description": "insightsRequestID is an optional Insights request ID to track the status of the Insights analysis (in console.redhat.com processing pipeline) for the corresponding Insights data archive. It may not exceed 256 characters and is immutable once set.", "type": "string" }, "relatedObjects": { - "description": "relatedObjects is a list of resources which are useful when debugging or inspecting the data gathering Pod", + "description": "relatedObjects is an optional list of resources which are useful when debugging or inspecting the data gathering Pod It may not exceed 100 items and must not contain duplicates.", "type": "array", "items": { "default": {}, "$ref": "#/definitions/com.github.openshift.api.insights.v1alpha2.ObjectReference" }, - "x-kubernetes-list-type": "atomic" + "x-kubernetes-list-map-keys": [ + "name", + "namespace" + ], + "x-kubernetes-list-type": "map" }, "startTime": { "description": "startTime is the time when Insights data gathering started.", @@ -15622,11 +15621,11 @@ "type": "object", "required": [ "name", - "lastGatherDuration" + "lastGatherSeconds" ], "properties": { "conditions": { - "description": "conditions provide details on the status of each gatherer.", + "description": "conditions provide details on the status of each gatherer.\n\nThe current condition type is DataGathered\n\nThe DataGathered condition is used to represent whether or not the data was gathered by a gatherer specified by name. When it has a status of True and a reason of GatheredOK, the data has been successfully gathered as expected. When it has a status of False and a reason of NoData, no data was gathered—for example, when the resource is not present in the cluster. When it has a status of False and a reason of GatherError, an error occurred and no data was gathered. When it has a status of False and a reason of GatherPanic, a panic occurred during gathering and no data was collected. When it has a status of False and a reason of GatherWithErrorReason, data was partially gathered or gathered with an error message.", "type": "array", "items": { "default": {}, @@ -15637,12 +15636,14 @@ ], "x-kubernetes-list-type": "map" }, - "lastGatherDuration": { - "description": "lastGatherDuration represents the time spent gathering.", - "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.Duration" + "lastGatherSeconds": { + "description": "lastGatherSeconds is required field that represents the time spent gathering in seconds", + "type": "integer", + "format": "int32", + "default": 0 }, "name": { - "description": "name is the name of the gatherer.", + "description": "name is the required name of the gatherer. It must contain at least 5 characters and may not exceed 256 characters.", "type": "string", "default": "" } @@ -15664,7 +15665,15 @@ "type": "string", "default": "" } - } + }, + "x-kubernetes-unions": [ + { + "discriminator": "mode", + "fields-to-discriminateBy": { + "custom": "Custom" + } + } + ] }, "com.github.openshift.api.insights.v1alpha2.HealthCheck": { "description": "healthCheck represents an Insights health check attributes.", @@ -15672,8 +15681,7 @@ "required": [ "description", "totalRisk", - "advisorURI", - "state" + "advisorURI" ], "properties": { "advisorURI": { @@ -15682,20 +15690,14 @@ "default": "" }, "description": { - "description": "description provides basic description of the healtcheck.", + "description": "description is required field that provides basic description of the healtcheck. It must contain at least 10 characters and may not exceed 2048 characters.", "type": "string", "default": "" }, - "state": { - "description": "state determines what the current state of the health check is. Health check is enabled by default and can be disabled by the user in the Insights advisor user interface.", + "totalRisk": { + "description": "totalRisk is the required field of the healthcheck. It is indicator of the total risk posed by the detected issue; combination of impact and likelihood. Allowed values are Low, Medium, Important and Critical. The value represents the severity of the issue.", "type": "string", "default": "" - }, - "totalRisk": { - "description": "totalRisk of the healthcheck. Indicator of the total risk posed by the detected issue; combination of impact and likelihood. The values can be from 1 to 4, and the higher the number, the more important the issue.", - "type": "integer", - "format": "int32", - "default": 0 } } }, @@ -15703,8 +15705,8 @@ "description": "insightsReport provides Insights health check report based on the most recently sent Insights data.", "type": "object", "properties": { - "downloadedAt": { - "description": "downloadedAt is the time when the last Insights report was downloaded. An empty value means that there has not been any Insights report downloaded yet and it usually appears in disconnected clusters (or clusters when the Insights data gathering is disabled).", + "downloadedTime": { + "description": "downloadedTime is an optional time when the last Insights report was downloaded. An empty value means that there has not been any Insights report downloaded yet and it usually appears in disconnected clusters (or clusters when the Insights data gathering is disabled).", "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.Time" }, "healthChecks": { @@ -15714,7 +15716,12 @@ "default": {}, "$ref": "#/definitions/com.github.openshift.api.insights.v1alpha2.HealthCheck" }, - "x-kubernetes-list-type": "atomic" + "x-kubernetes-list-map-keys": [ + "advisorURI", + "totalRisk", + "description" + ], + "x-kubernetes-list-type": "map" }, "uri": { "description": "uri is optional field that provides the URL link from which the report was downloaded. The link must be a valid HTTPS URL and the maximum length is 2048 characters.", @@ -15728,25 +15735,27 @@ "required": [ "group", "resource", - "name" + "name", + "namespace" ], "properties": { "group": { - "description": "group is the API Group of the Resource. Enter empty string for the core group. This value is empty or should follow the DNS1123 subdomain format and it must be at most 253 characters in length. Example: \"\", \"apps\", \"build.openshift.io\", etc.", + "description": "group is required field that specifies the API Group of the Resource. Enter empty string for the core group. This value is empty or it should follow the DNS1123 subdomain format. It must be at most 253 characters in length, and must consist only of lower case alphanumeric characters, '-' and '.', and must start and end with an alphanumeric character. Example: \"\", \"apps\", \"build.openshift.io\", etc.", "type": "string", "default": "" }, "name": { - "description": "name of the referent that follows the DNS1123 subdomain format. It must be at most 256 characters in length.", + "description": "name is required field that specifies the referent that follows the DNS1123 subdomain format. It must be at most 253 characters in length, and must consist only of lower case alphanumeric characters, '-' and '.', and must start and end with an alphanumeric character.", "type": "string", "default": "" }, "namespace": { - "description": "namespace of the referent that follows the DNS1123 subdomain format. It must be at most 253 characters in length.", - "type": "string" + "description": "namespace if required field of the referent that follows the DNS1123 labels format. It must be at most 63 characters in length, and must must consist of only lowercase alphanumeric characters and hyphens", + "type": "string", + "default": "" }, "resource": { - "description": "resource is required field of the type that is being referenced. It is normally the plural form of the resource kind in lowercase. This value should consist of only lowercase alphanumeric characters and hyphens. Example: \"deployments\", \"deploymentconfigs\", \"pods\", etc.", + "description": "resource is required field of the type that is being referenced. It is normally the plural form of the resource kind in lowercase. It must be at most 63 characters in length, and must must consist of only lowercase alphanumeric characters and hyphens Example: \"deployments\", \"deploymentconfigs\", \"pods\", etc.", "type": "string", "default": "" } @@ -15800,7 +15809,15 @@ "type": "string", "default": "" } - } + }, + "x-kubernetes-unions": [ + { + "discriminator": "type", + "fields-to-discriminateBy": { + "persistentVolume": "PersistentVolume" + } + } + ] }, "com.github.openshift.api.kubecontrolplane.v1.AggregatorConfig": { "description": "AggregatorConfig holds information required to make the aggregator function.",