Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@ clean:
.PHONY: clean

# Set crd-schema-gen variables
CRD_SCHEMA_GEN_APIS := $(shell echo ./vendor/github.com/openshift/api/{authorization/v1,config/v1,quota/v1,security/v1,operator/v1alpha1})
CRD_SCHEMA_GEN_APIS := $(shell echo ./vendor/github.com/openshift/api/{authorization/v1,config/v1,quota/v1,security/v1,operator/v1alpha1,console/v1})
CRD_SCHEMA_GEN_VERSION :=v0.2.1

update-codegen: update-codegen-crds
.PHONY: update-codegen

verify-codegen: verify-codegen-crds
.PHONY: verify-codegen
.PHONY: verify-codegen
87 changes: 87 additions & 0 deletions manifests/0000_10_config-operator_01_consoleclidownload.crd.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
apiVersion: apiextensions.k8s.io/v1beta1
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Rebase, and I have to say I like the output of this much better. It's limited to the fields that specifically matter to the custom resource.

kind: CustomResourceDefinition
metadata:
name: consoleclidownloads.console.openshift.io
annotations:
displayName: ConsoleCLIDownload
description: Extension for configuring openshift web console command line interface
(CLI) downloads.
spec:
scope: Cluster
group: console.openshift.io
versions:
- name: v1
served: true
storage: true
names:
plural: consoleclidownloads
singular: consoleclidownload
kind: ConsoleCLIDownload
listKind: ConsoleCLIDownloadList
additionalPrinterColumns:
- name: Display name
type: string
JSONPath: .spec.displayName
- name: Age
type: string
JSONPath: .metadata.creationTimestamp
- name: Description
type: string
JSONPath: .spec.description
subresources:
status: {}
validation:
openAPIV3Schema:
description: ConsoleCLIDownload is an extension for configuring openshift web
console command line interface (CLI) downloads.
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: Standard object's metadata.
type: object
spec:
description: ConsoleCLIDownloadSpec is the desired cli download configuration.
Comment thread
benjaminapetersen marked this conversation as resolved.
type: object
required:
- description
- displayName
- links
properties:
description:
description: description is the description of the CLI download (can
include markdown).
type: string
displayName:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

can this be empty?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

It's a required field, so it should not be empty.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Are we allowed to change this now? API has been in for a release already.

description: displayName is the display name of the CLI download.
type: string
links:
description: links is a list of objects that provide CLI download link
details.
type: array
items:
description: Represents a standard link that could be generated in
HTML
type: object
required:
- href
- text
properties:
href:
description: href is the absolute secure URL for the link (must
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

you can use pattern: "<regex>" to restrict the value.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This I need to fix as it has been part of the historical API. We have been using:

pattern: '^https://([\w-]+.)+[\w-]+(/[\w- ./?%&=])?$'

Just need to figure out how to get this in openshift/api to generate.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Ok this should be resolved via https://github.com/openshift/api/pull/457/files#r331225859 on our next regeneration.

use https)
type: string
text:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

can this be empty?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Perhaps we assumed required would validate that it is not empty. I'm guessing present but empty is allowed without regex, given your questions. We should update.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Are we allowed to change this now? API has been in for a release already.

description: text is the display text for the link
type: string
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
name: consoleexternalloglinks.console.openshift.io
annotations:
displayName: ConsoleExternalLogLinks
description: ConsoleExternalLogLink is an extension for customizing OpenShift
web console log links.
spec:
scope: Cluster
group: console.openshift.io
versions:
- name: v1
served: true
storage: true
names:
plural: consoleexternalloglinks
singular: consoleexternalloglink
kind: ConsoleExternalLogLink
listKind: ConsoleExternalLogLinkList
additionalPrinterColumns:
- name: Text
type: string
JSONPath: .spec.text
- name: HrefTemplate
type: string
JSONPath: .spec.hrefTemplate
- name: Age
type: date
JSONPath: .metadata.creationTimestamp
subresources:
status: {}
validation:
openAPIV3Schema:
description: ConsoleExternalLogLink is an extension for customizing OpenShift
web console log links.
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: Standard object's metadata.
type: object
spec:
Comment thread
benjaminapetersen marked this conversation as resolved.
description: ConsoleExternalLogLinkSpec is the desired log link configuration.
The log link will appear on the logs tab of the pod details page.
type: object
required:
- hrefTemplate
- text
properties:
hrefTemplate:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

use pattern to restrict it to https

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

description: "hrefTemplate is an absolute secure URL (must use https)
for the log link including variables to be replaced. Variables are
specified in the URL with the format ${variableName}, for instance,
${containerName} and will be replaced with the corresponding values
from the resource. Resource is a pod. Supported variables are: - ${resourceName}
- name of the resource which containes the logs - ${resourceUID} -
UID of the resource which contains the logs - e.g. `11111111-2222-3333-4444-555555555555`
- ${containerName} - name of the resource's container that contains
the logs - ${resourceNamespace} - namespace of the resource that contains
the logs - ${podLabels} - JSON representation of labels matching the
pod with the logs - e.g. `{\"key1\":\"value1\",\"key2\":\"value2\"}`
\n e.g., https://example.com/logs?resourceName=${resourceName}&containerName=${containerName}&resourceNamespace=${resourceNamespace}&podLabels=${podLabels}"
type: string
namespaceFilter:
description: namespaceFilter is a regular expression used to restrict
a log link to a matching set of namespaces (e.g., `^openshift-`).
The string is converted into a regular expression using the JavaScript
RegExp constructor. If not specified, links will be displayed for
all the namespaces.
type: string
text:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

can this be empty?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Same, don't know if we can change it at this point.

description: text is the display text for the link
type: string
107 changes: 107 additions & 0 deletions manifests/0000_10_config-operator_01_consolelink.crd.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
name: consolelinks.console.openshift.io
annotations:
displayName: ConsoleLinks
description: Extension for customizing OpenShift web console links
spec:
scope: Cluster
group: console.openshift.io
versions:
- name: v1
served: true
storage: true
names:
plural: consolelinks
singular: consolelink
kind: ConsoleLink
listKind: ConsoleLinkList
additionalPrinterColumns:
- name: Text
type: string
JSONPath: .spec.text
- name: URL
type: string
JSONPath: .spec.href
- name: Menu
type: string
JSONPath: .spec.menu
- name: Age
type: date
JSONPath: .metadata.creationTimestamp
subresources:
status: {}
validation:
openAPIV3Schema:
description: ConsoleLink is an extension for customizing OpenShift web console
links.
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: Standard object's metadata.
type: object
spec:
Comment thread
benjaminapetersen marked this conversation as resolved.
description: ConsoleLinkSpec is the desired console link configuration.
type: object
required:
- href
- location
- text
properties:
applicationMenu:
description: applicationMenu holds information about section and icon
used for the link in the application menu, and it is applicable only
when location is set to ApplicationMenu.
type: object
required:
- section
properties:
imageURL:
description: imageUrl is the URL for the icon used in front of the
link in the application menu. The URL must be an HTTPS URL or
a Data URI. The image should be square and will be shown at 24x24
pixels.
type: string
section:
description: section is the section of the application menu in which
the link should appear.
type: string
href:
description: href is the absolute secure URL for the link (must use
https)
type: string
location:
description: location determines which location in the console the link
will be appended to.
type: string
namespaceDashboard:
description: namespaceDashboard holds information about namespaces in
which the dashboard link should appear, and it is applicable only
when location is set to NamespaceDashboard. If not specified, the
link will appear in all namespaces.
type: object
required:
- namespaces
properties:
namespaces:
description: namespaces is an array of namespace names in which
the dashboard link should appear.
type: array
items:
type: string
text:
description: text is the display text for the link
type: string
87 changes: 87 additions & 0 deletions manifests/0000_10_config-operator_01_consolenotification.crd.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
name: consolenotifications.console.openshift.io
annotations:
displayName: ConsoleNotification
description: Extension for configuring openshift web console notifications.
spec:
scope: Cluster
group: console.openshift.io
versions:
- name: v1
served: true
storage: true
names:
plural: consolenotifications
singular: consolenotification
kind: ConsoleNotification
listKind: ConsoleNotificationList
additionalPrinterColumns:
- name: Text
type: string
JSONPath: .spec.text
- name: Location
type: string
JSONPath: .spec.location
- name: Age
type: date
JSONPath: .metadata.creationTimestamp
subresources:
status: {}
validation:
openAPIV3Schema:
description: ConsoleNotification is the extension for configuring openshift
web console notifications.
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: Standard object's metadata.
type: object
spec:
Comment thread
benjaminapetersen marked this conversation as resolved.
description: ConsoleNotificationSpec is the desired console notification
configuration.
type: object
required:
- text
properties:
backgroundColor:
description: backgroundColor is the color of the background for the
notification as CSS data type color.
type: string
color:
description: color is the color of the text for the notification as
CSS data type color.
type: string
link:
description: link is an object that holds notification link details.
type: object
required:
- href
- text
properties:
href:
description: href is the absolute secure URL for the link (must
use https)
type: string
text:
description: text is the display text for the link
type: string
location:
description: location is the location of the notification in the console.
type: string
text:
description: text is the visible text of the notification.
type: string