Skip to content

Commit 241cc51

Browse files
committed
CONSOLE-4882: Support mailto: links in ConsoleLink href field
1 parent 916c700 commit 241cc51

File tree

9 files changed

+69
-30
lines changed

9 files changed

+69
-30
lines changed

console/v1/tests/consolelinks.console.openshift.io/AAA_ungated.yaml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,18 @@ tests:
1818
href: "https://"
1919
location: HelpMenu
2020
text: foo
21+
- name: Should be able to create a ConsoleLink with mailto href
22+
initial: |
23+
apiVersion: console.openshift.io/v1
24+
kind: ConsoleLink
25+
spec:
26+
href: "mailto:[email protected]"
27+
location: HelpMenu
28+
text: Contact Platform Team
29+
expected: |
30+
apiVersion: console.openshift.io/v1
31+
kind: ConsoleLink
32+
spec:
33+
href: "mailto:[email protected]"
34+
location: HelpMenu
35+
text: Contact Platform Team

console/v1/types.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ package v1
44
type Link struct {
55
// text is the display text for the link
66
Text string `json:"text"`
7-
// href is the absolute secure URL for the link (must use https)
8-
// +kubebuilder:validation:Pattern=`^https://`
7+
// href is the absolute URL for the link. Must use https:// for web URLs or mailto: for email links.
8+
// +kubebuilder:validation:Pattern=`^(https://|mailto:)`
99
Href string `json:"href"`
1010
}

console/v1/zz_generated.crd-manifests/00_consolelinks.crd.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,9 @@ spec:
8080
- section
8181
type: object
8282
href:
83-
description: href is the absolute secure URL for the link (must use
84-
https)
85-
pattern: ^https://
83+
description: 'href is the absolute URL for the link. Must use https://
84+
for web URLs or mailto: for email links.'
85+
pattern: ^(https://|mailto:)
8686
type: string
8787
location:
8888
description: location determines which location in the console the

console/v1/zz_generated.crd-manifests/00_consolenotifications.crd.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,9 @@ spec:
7070
description: link is an object that holds notification link details.
7171
properties:
7272
href:
73-
description: href is the absolute secure URL for the link (must
74-
use https)
75-
pattern: ^https://
73+
description: 'href is the absolute URL for the link. Must use
74+
https:// for web URLs or mailto: for email links.'
75+
pattern: ^(https://|mailto:)
7676
type: string
7777
text:
7878
description: text is the display text for the link

console/v1/zz_generated.featuregated-crd-manifests/consolelinks.console.openshift.io/AAA_ungated.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,9 @@ spec:
7979
- section
8080
type: object
8181
href:
82-
description: href is the absolute secure URL for the link (must use
83-
https)
84-
pattern: ^https://
82+
description: 'href is the absolute URL for the link. Must use https://
83+
for web URLs or mailto: for email links.'
84+
pattern: ^(https://|mailto:)
8585
type: string
8686
location:
8787
description: location determines which location in the console the

console/v1/zz_generated.featuregated-crd-manifests/consolenotifications.console.openshift.io/AAA_ungated.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,9 @@ spec:
6969
description: link is an object that holds notification link details.
7070
properties:
7171
href:
72-
description: href is the absolute secure URL for the link (must
73-
use https)
74-
pattern: ^https://
72+
description: 'href is the absolute URL for the link. Must use
73+
https:// for web URLs or mailto: for email links.'
74+
pattern: ^(https://|mailto:)
7575
type: string
7676
text:
7777
description: text is the display text for the link

console/v1/zz_generated.swagger_doc_generated.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

openapi/generated_openapi/zz_generated.openapi.go

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

openapi/openapi.json

Lines changed: 37 additions & 13 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)