Skip to content
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

Update HawtioConfig type to match @hawtio/react hawtconfig.json model #69

Closed
tadayosi opened this issue Nov 6, 2023 · 4 comments
Closed
Assignees
Milestone

Comments

@tadayosi
Copy link
Member

tadayosi commented Nov 6, 2023

type HawtioConfig struct {
// The information to be displayed in the About page
About HawtioAbout `json:"about,omitempty"`
// The UI branding
Branding HawtioBranding `json:"branding,omitempty"`
// The OpenShift related configuration
Online HawtioOnline `json:"online,omitempty"`
// Disables UI components with matching routes
DisabledRoutes []string `json:"disabledRoutes,omitempty"`
}

@tadayosi tadayosi added this to the 1.0.0 milestone Nov 6, 2023
@tadayosi tadayosi self-assigned this Nov 10, 2023
@tadayosi
Copy link
Member Author

@phantomjinx I found that there is online.consoleLink option in hawtconfig.json for hawtio-operator, which is not present in hawtio/react. Do you know if it's used in hawtio-online? If it's not dead code but isn't utilised in hawtio-online, it might be something we miss.

// The configuration for the OpenShift Web console link.
// A link is added to the application menu when the Hawtio deployment is equal to 'cluster'.
// Otherwise, a link is added to the Hawtio project dashboard.
ConsoleLink HawtioConsoleLink `json:"consoleLink,omitempty"`
}
// The configuration for the OpenShift Web console link
type HawtioConsoleLink struct {
// The text display for the link
Text string `json:"text,omitempty"`
// The section of the application menu in which the link should appear.
//It is only applicable when the Hawtio deployment type is equal to 'cluster'.
// +optional
Section string `json:"section,omitempty"`
// The path, relative to the Hawtio status URL, for the icon used in front of the link in the application menu.
// It is only applicable when the Hawtio deployment type is equal to 'cluster'.
// The image should be square and will be shown at 24x24 pixels.
// +optional
ImageRelativePath string `json:"imageRelativePath,omitempty"`
}

@tadayosi
Copy link
Member Author

OK, I learned hard that the HawtioConfig type here doesn't necessarily reflect the type definition provided by @hawtio/react. HawtioConfig generally only needs type definitions for what the operater uses. Ultimately, what is really needed is the online.consoleLink for the operator, and the rest (even About and Branding) are not really needed here.
(@phantomjinx That answers my own question above. It's ok that we don't observe the usages of online.consoleLink anywhere else, since hawtio-operator is where the option is consumed.)

That concludes this task of syncing the definitions between @hawtio/react and hawtio-operator is not needed.

@tadayosi
Copy link
Member Author

In addition, the recent changes I added to hawtconfig.json at @hawtio/react hawtio/hawtio-next#646 uses union type boolean | string[]. JS/TS is fine to handle union types but Go isn't. That makes it really hard to encode the type definitions in the operator, so ultimately we should avoid using union types.

But for now, I don't think the operator will use the newly added option jmx.workspace, and it really shouldn't as the operator should be agnostic to the configurations of specific Hawtio plugins, even if it's as basic as JMX.

@tadayosi
Copy link
Member Author

I'm closing it as 'Wont Do'.

@tadayosi tadayosi closed this as not planned Won't fix, can't repro, duplicate, stale Nov 10, 2023
tadayosi added a commit that referenced this issue Nov 10, 2023
Comment is added to explain what was found during issue #69.
@lhein lhein moved this from New to Ignored in Kanban Board Apr 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

No branches or pull requests

1 participant