-
Notifications
You must be signed in to change notification settings - Fork 585
Add api types for console extension resources and console server config #318
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
openshift-merge-robot
merged 1 commit into
openshift:master
from
benjaminapetersen:console/extensions
Jun 7, 2019
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| reviewers: | ||
| - benjaminapetersen | ||
| - spadgett |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| package console | ||
|
|
||
| import ( | ||
| "k8s.io/apimachinery/pkg/runtime" | ||
| "k8s.io/apimachinery/pkg/runtime/schema" | ||
|
|
||
| consolev1 "github.com/openshift/api/console/v1" | ||
| ) | ||
|
|
||
| const ( | ||
| GroupName = "console.openshift.io" | ||
| ) | ||
|
|
||
| var ( | ||
| schemeBuilder = runtime.NewSchemeBuilder(consolev1.Install) | ||
| // Install is a function which adds every version of this group to a scheme | ||
| Install = schemeBuilder.AddToScheme | ||
| ) | ||
|
|
||
| func Resource(resource string) schema.GroupResource { | ||
| return schema.GroupResource{Group: GroupName, Resource: resource} | ||
| } | ||
|
|
||
| func Kind(kind string) schema.GroupKind { | ||
| return schema.GroupKind{Group: GroupName, Kind: kind} | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| // +k8s:deepcopy-gen=package,register | ||
| // +k8s:defaulter-gen=TypeMeta | ||
| // +k8s:openapi-gen=true | ||
|
|
||
| // +groupName=console.openshift.io | ||
| // Package v1 is the v1 version of the API. | ||
| package v1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| package v1 | ||
|
|
||
| import ( | ||
| corev1 "k8s.io/api/core/v1" | ||
| metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | ||
| "k8s.io/apimachinery/pkg/runtime" | ||
| "k8s.io/apimachinery/pkg/runtime/schema" | ||
| ) | ||
|
|
||
| var ( | ||
| GroupName = "console.openshift.io" | ||
| GroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1"} | ||
| schemeBuilder = runtime.NewSchemeBuilder(addKnownTypes, corev1.AddToScheme) | ||
| // Install is a function which adds this version to a scheme | ||
| Install = schemeBuilder.AddToScheme | ||
|
|
||
| // SchemeGroupVersion generated code relies on this name | ||
| // Deprecated | ||
| SchemeGroupVersion = GroupVersion | ||
| // AddToScheme exists solely to keep the old generators creating valid code | ||
| // DEPRECATED | ||
| AddToScheme = schemeBuilder.AddToScheme | ||
| ) | ||
|
|
||
| // Resource generated code relies on this being here, but it logically belongs to the group | ||
| // DEPRECATED | ||
| func Resource(resource string) schema.GroupResource { | ||
| return schema.GroupResource{Group: GroupName, Resource: resource} | ||
| } | ||
|
|
||
| // addKnownTypes adds types to API group | ||
| func addKnownTypes(scheme *runtime.Scheme) error { | ||
| scheme.AddKnownTypes(GroupVersion, | ||
| &ConsoleLink{}, | ||
| &ConsoleCLIDownload{}, | ||
| &ConsoleNotification{}, | ||
| ) | ||
| metav1.AddToGroupVersion(scheme, GroupVersion) | ||
| return nil | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| package v1 | ||
|
|
||
| // Represents a standard link that could be generated in HTML | ||
| type Link struct { | ||
| // text is the display text for the link | ||
| Text string `json:"text"` | ||
| // href is the absolute secure URL for the link (must use https) | ||
| Href string `json:"href"` | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| package v1 | ||
|
|
||
| import metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | ||
|
|
||
| // +genclient | ||
| // +genclient:nonNamespaced | ||
| // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object | ||
|
|
||
| // ConsoleCLIDownload is an extension for configuring openshift web console command line interface (CLI) downloads. | ||
| type ConsoleCLIDownload struct { | ||
| metav1.TypeMeta `json:",inline"` | ||
| // Standard object's metadata. | ||
| metav1.ObjectMeta `json:"metadata,omitempty"` | ||
| Spec ConsoleCLIDownloadSpec `json:"spec"` | ||
| } | ||
|
|
||
| // ConsoleCLIDownloadSpec is the desired cli download configuration. | ||
| type ConsoleCLIDownloadSpec struct { | ||
| // displayName is the display name of the CLI download. | ||
| DisplayName string `json:"displayName"` | ||
| // description is the description of the CLI download (can include markdown). | ||
| Description string `json:"description"` | ||
| // links is a list of objects that provide CLI download link details. | ||
| Links []Link `json:"links"` | ||
| } | ||
|
|
||
| // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object | ||
|
|
||
| type ConsoleCLIDownloadList struct { | ||
| metav1.TypeMeta `json:",inline"` | ||
| // Standard object's metadata. | ||
| metav1.ListMeta `json:"metadata"` | ||
| Items []ConsoleCLIDownload `json:"items"` | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| package v1 | ||
|
|
||
| import metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | ||
|
|
||
| // +genclient | ||
| // +genclient:nonNamespaced | ||
| // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object | ||
|
|
||
| // ConsoleLink is an extension for customizing OpenShift web console links. | ||
| type ConsoleLink struct { | ||
| metav1.TypeMeta `json:",inline"` | ||
| // Standard object's metadata. | ||
| metav1.ObjectMeta `json:"metadata,omitempty"` | ||
| Spec ConsoleLinkSpec `json:"spec"` | ||
| } | ||
|
|
||
| // ConsoleLinkSpec is the desired console link configuration. | ||
| type ConsoleLinkSpec struct { | ||
| Link `json:",inline"` | ||
| // location determines which location in the console the link will be appended to. | ||
| Location ConsoleLinkLocation `json:"location"` | ||
| } | ||
|
|
||
| // ConsoleLinkLocationSelector is a set of possible menu targets to which a link may be appended. | ||
| type ConsoleLinkLocation string | ||
|
|
||
| const ( | ||
| // HelpMenu indicates that the link should appear in the help menu in the console. | ||
| HelpMenu ConsoleLinkLocation = "HelpMenu" | ||
| // UserMenu indicates that the link should appear in the user menu in the console. | ||
| UserMenu ConsoleLinkLocation = "UserMenu" | ||
| ) | ||
|
|
||
| // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object | ||
|
|
||
| type ConsoleLinkList struct { | ||
| metav1.TypeMeta `json:",inline"` | ||
| // Standard object's metadata. | ||
| metav1.ListMeta `json:"metadata"` | ||
| Items []ConsoleLink `json:"items"` | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,55 @@ | ||
| package v1 | ||
|
|
||
| import metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | ||
|
|
||
| // +genclient | ||
| // +genclient:nonNamespaced | ||
| // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object | ||
|
|
||
| // ConsoleNotification is the extension for configuring openshift web console notifications. | ||
| type ConsoleNotification struct { | ||
| metav1.TypeMeta `json:",inline"` | ||
| // Standard object's metadata. | ||
| metav1.ObjectMeta `json:"metadata,omitempty"` | ||
| Spec ConsoleNotificationSpec `json:"spec"` | ||
| } | ||
|
|
||
| // ConsoleNotificationSpec is the desired console notification configuration. | ||
| type ConsoleNotificationSpec struct { | ||
| // text is the visible text of the notification. | ||
| Text string `json:"text"` | ||
| // location is the location of the notification in the console. | ||
| // +optional | ||
| Location ConsoleNotificationLocation `json:"location,omitempty"` | ||
| // link is an object that holds notification link details. | ||
| // +optional | ||
| Link *Link `json:"link,omitempty"` | ||
| // color is the color of the text for the notification as CSS data type color. | ||
| // +optional | ||
| Color string `json:"color,omitempty"` | ||
| // backgroundColor is the color of the background for the notification as CSS data type color. | ||
| // +optional | ||
| BackgroundColor string `json:"backgroundColor,omitempty"` | ||
| } | ||
|
|
||
| // ConsoleNotificationLocationSelector is a set of possible notification targets | ||
| // to which a notification may be appended. | ||
| type ConsoleNotificationLocation string | ||
|
|
||
| const ( | ||
| // BannerTop indicates that the notification should appear at the top of the console. | ||
| BannerTop ConsoleNotificationLocation = "BannerTop" | ||
| // BannerBottom indicates that the notification should appear at the bottom of the console. | ||
| BannerBottom ConsoleNotificationLocation = "BannerBottom" | ||
| // BannerTopBottom indicates that the notification should appear both at the top and at the bottom of the console. | ||
| BannerTopBottom ConsoleNotificationLocation = "BannerTopBottom" | ||
| ) | ||
|
|
||
| // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object | ||
|
|
||
| type ConsoleNotificationList struct { | ||
| metav1.TypeMeta `json:",inline"` | ||
| // Standard object's metadata. | ||
| metav1.ListMeta `json:"metadata"` | ||
| Items []ConsoleNotification `json:"items"` | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.