Skip to content

Commit

Permalink
RHCLOUD-33912: update crd spec to match chrome-service
Browse files Browse the repository at this point in the history
  • Loading branch information
florkbr committed Oct 7, 2024
1 parent 4a3dd44 commit 703872f
Show file tree
Hide file tree
Showing 3 changed files with 201 additions and 11 deletions.
50 changes: 39 additions & 11 deletions api/v1alpha1/frontend_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,26 +76,54 @@ type FrontendDeployments struct {
}

type FedModule struct {
ManifestLocation string `json:"manifestLocation" yaml:"manifestLocation"`
Modules []Module `json:"modules,omitempty" yaml:"modules,omitempty"`
ModuleID string `json:"moduleID,omitempty" yaml:"moduleID,omitempty"`
Config *apiextensions.JSON `json:"config,omitempty" yaml:"config,omitempty"`
FullProfile *bool `json:"fullProfile,omitempty" yaml:"fullProfile,omitempty"`
ManifestLocation string `json:"manifestLocation" yaml:"manifestLocation"`
Modules []Module `json:"modules,omitempty" yaml:"modules,omitempty"`
ModuleID string `json:"moduleID,omitempty" yaml:"moduleID,omitempty"`
Config *apiextensions.JSON `json:"config,omitempty" yaml:"config,omitempty"` // Type does not match what is currently in chrome-service spec
ModuleConfig *ModuleConfig `json:"moduleConfig,omitempty" yaml:"moduleConfig,omitempty"`
FullProfile *bool `json:"fullProfile,omitempty" yaml:"fullProfile,omitempty"`
DefaultDocumentTitle string `json:"defaultDocumentTitle,omitempty" yaml:"defaultDocumentTitle,omitempty"`
IsFedramp *bool `json:"isFedramp,omitempty" yaml:"isFedramp,omitempty"`
Analytics *Analytics `json:"analytics,omitempty" yaml:"analytics,omitempty"`
}

type Module struct {
ID string `json:"id" yaml:"id"`
Module string `json:"module" yaml:"module"`
Routes []Route `json:"routes" yaml:"routes"`
Dependencies []string `json:"dependencies,omitempty" yaml:"dependencies,omitempty"`
OptionalDependencies []string `json:"optionalDependencies,omitempty" yaml:"optionalDependencies,omitempty"`
Dependencies []string `json:"dependencies,omitempty" yaml:"dependencies,omitempty"` // not in the current chrome-service spec
OptionalDependencies []string `json:"optionalDependencies,omitempty" yaml:"optionalDependencies,omitempty"` // not in the current chrome-service spec
}

type ModuleConfig struct {
SupportCaseData SupportCaseData `json:"supportCaseData,omitempty" yaml:"supportCaseData,omitempty"`
SSOScopes []string `json:"ssoScopes,omitempty" yaml:"ssoScopes,omitempty"`
}

type Route struct {
Pathname string `json:"pathname" yaml:"pathname"`
Dynamic bool `json:"dynamic,omitempty" yaml:"dynamic,omitempty"`
Exact bool `json:"exact,omitempty" yaml:"exact,omitempty"`
Props *apiextensions.JSON `json:"props,omitempty" yaml:"props,omitempty"`
Pathname string `json:"pathname" yaml:"pathname"`
Dynamic bool `json:"dynamic,omitempty" yaml:"dynamic,omitempty"`
Exact bool `json:"exact,omitempty" yaml:"exact,omitempty"`
Props *apiextensions.JSON `json:"props,omitempty" yaml:"props,omitempty"`
FullProfile bool `json:"fullProfile,omitempty" yaml:"fullProfile,omitempty"`
IsFedramp bool `json:"isFedramp,omitempty" yaml:"isFedramp,omitempty"`
SupportCaseData *SupportCaseData `json:"supportCaseData,omitempty" yaml:"supportCaseData,omitempty"`
Permissions []Permission `json:"permissions,omitempty" yaml:"permissions,omitempty"`
}

type Analytics struct {
APIKey string `json:"APIKey" yaml:"APIKey"`
}

type SupportCaseData struct {
Version string `json:"version" yaml:"version"`
Product string `json:"product" yaml:"product"`
}

type Permission struct {
Method string `json:"method" yaml:"method"`
Apps []string `json:"apps,omitempty" yaml:"apps,omitempty"`
Args []string `json:"args,omitempty" yaml:"args,omitempty"` // TODO validate array item type (string?)
}

// +kubebuilder:object:root=true
Expand Down
103 changes: 103 additions & 0 deletions api/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

59 changes: 59 additions & 0 deletions config/crd/bases/cloud.redhat.com_frontends.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -92,12 +92,40 @@ spec:
type: string
module:
properties:
analytics:
properties:
APIKey:
type: string
required:
- APIKey
type: object
config:
x-kubernetes-preserve-unknown-fields: true
defaultDocumentTitle:
type: string
fullProfile:
type: boolean
isFedramp:
type: boolean
manifestLocation:
type: string
moduleConfig:
properties:
ssoScopes:
items:
type: string
type: array
supportCaseData:
properties:
product:
type: string
version:
type: string
required:
- product
- version
type: object
type: object
moduleID:
type: string
modules:
Expand All @@ -122,10 +150,41 @@ spec:
type: boolean
exact:
type: boolean
fullProfile:
type: boolean
isFedramp:
type: boolean
pathname:
type: string
permissions:
items:
properties:
apps:
items:
type: string
type: array
args:
items:
type: string
type: array
method:
type: string
required:
- method
type: object
type: array
props:
x-kubernetes-preserve-unknown-fields: true
supportCaseData:
properties:
product:
type: string
version:
type: string
required:
- product
- version
type: object
required:
- pathname
type: object
Expand Down

0 comments on commit 703872f

Please sign in to comment.