Skip to content

Commit

Permalink
fix naming
Browse files Browse the repository at this point in the history
  • Loading branch information
dmi-feo committed Oct 16, 2024
1 parent ea185cb commit 8627358
Show file tree
Hide file tree
Showing 9 changed files with 21 additions and 21 deletions.
2 changes: 1 addition & 1 deletion api/v1/ytsaurus_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -523,7 +523,7 @@ type StrawberryControllerSpec struct {
NodeSelector map[string]string `json:"nodeSelector,omitempty"`
ExternalProxy *string `json:"externalProxy,omitempty"`
ControllerFamilies []string `json:"controllerFamilies,omitempty"`
DefaultFamily *string `json:"defaultFamily,omitempty"`
DefaultRouteFamily *string `json:"defaultRouteFamily,omitempty"`
}

type YQLAgentSpec struct {
Expand Down
4 changes: 2 additions & 2 deletions api/v1/zz_generated.deepcopy.go

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

2 changes: 1 addition & 1 deletion config/crd/bases/cluster.ytsaurus.tech_ytsaurus.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29436,7 +29436,7 @@ spec:
items:
type: string
type: array
defaultFamily:
defaultRouteFamily:
type: string
externalProxy:
type: string
Expand Down
16 changes: 8 additions & 8 deletions docs/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -1465,15 +1465,15 @@ _Appears in:_
_Appears in:_
- [YtsaurusSpec](#ytsaurusspec)

| Field | Description | Default | Validation |
| --- | --- | --- | --- |
| Field | Description | Default | Validation |
|-----------------------------------------------------------------------------------------------------------------------------------------| --- | --- | --- |
| `resources` _[ResourceRequirements](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.28/#resourcerequirements-v1-core)_ | | | |
| `image` _string_ | | | |
| `tolerations` _[Toleration](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.28/#toleration-v1-core) array_ | | | |
| `nodeSelector` _object (keys:string, values:string)_ | | | |
| `externalProxy` _string_ | | | |
| `controllerFamilies` _string array_ | | | |
| `defaultFamily` _string_ | | | |
| `image` _string_ | | | |
| `tolerations` _[Toleration](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.28/#toleration-v1-core) array_ | | | |
| `nodeSelector` _object (keys:string, values:string)_ | | | |
| `externalProxy` _string_ | | | |
| `controllerFamilies` _string array_ | | | |
| `defaultRouteFamily` _string_ | | | |


#### StructuredLoggerSpec
Expand Down
2 changes: 1 addition & 1 deletion pkg/ytconfig/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ type AddressResolver struct {

type StrawberryControllerFamiliesConfig struct {
ControllerFamilies []string `yson:"controller_families,omitempty"`
DefaultFamily string `yson:"default_family,omitempty"`
DefaultRouteFamily string `yson:"default_route_family,omitempty"`
ExternalProxy *string `yson:"external_proxy,omitempty"`
}

Expand Down
6 changes: 3 additions & 3 deletions pkg/ytconfig/generator.go
Original file line number Diff line number Diff line change
Expand Up @@ -317,10 +317,10 @@ func (g *Generator) fillStrawberryControllerFamiliesConfig(c *StrawberryControll
} else {
c.ControllerFamilies = consts.GetDefaultStrawberryControllerFamilies()
}
if s.DefaultFamily != nil {
c.DefaultFamily = *s.DefaultFamily
if s.DefaultRouteFamily != nil {
c.DefaultRouteFamily = *s.DefaultRouteFamily
} else {
c.DefaultFamily = consts.DefaultStrawberryControllerFamily
c.DefaultRouteFamily = consts.DefaultStrawberryControllerFamily
}
c.ExternalProxy = s.ExternalProxy
}
Expand Down
4 changes: 2 additions & 2 deletions pkg/ytconfig/generator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -356,8 +356,8 @@ func TestGetStrawberryControllerConfigWithCustomFamilies(t *testing.T) {
g.ytsaurus.Spec.StrawberryController.ControllerFamilies,
"superservice1", "superservice2", "superservice3",
)
defaultFamily := "superservice2"
g.ytsaurus.Spec.StrawberryController.DefaultFamily = &defaultFamily
defaultRouteFamily := "superservice2"
g.ytsaurus.Spec.StrawberryController.DefaultRouteFamily = &defaultRouteFamily
cfg, err := g.GetStrawberryControllerConfig()
require.NoError(t, err)
canonize.Assert(t, cfg)
Expand Down
4 changes: 2 additions & 2 deletions pkg/ytconfig/strawberry.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,15 @@ func getStrawberryController(conFamConfig StrawberryControllerFamiliesConfig, re
if conFamConfig.ExternalProxy != nil {
httpControllerMappings = make(map[string]string, len(conFamConfig.ControllerFamilies))
for _, cFamily := range conFamConfig.ControllerFamilies {
if cFamily == conFamConfig.DefaultFamily {
if cFamily == conFamConfig.DefaultRouteFamily {
httpControllerMappings["*"] = cFamily
} else {
host := fmt.Sprintf("%s.%s", cFamily, *conFamConfig.ExternalProxy)
httpControllerMappings[host] = cFamily
}
}
} else {
httpControllerMappings = map[string]string{"*": conFamConfig.DefaultFamily}
httpControllerMappings = map[string]string{"*": conFamConfig.DefaultRouteFamily}
}

return StrawberryController{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29447,7 +29447,7 @@ spec:
items:
type: string
type: array
defaultFamily:
defaultRouteFamily:
type: string
externalProxy:
type: string
Expand Down

0 comments on commit 8627358

Please sign in to comment.