Skip to content

Commit

Permalink
Separate CHYT init options into makeDefault and createPublicClique
Browse files Browse the repository at this point in the history
  • Loading branch information
achulkov2 committed Sep 19, 2024
1 parent 54143b9 commit 1334eeb
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 2 deletions.
4 changes: 4 additions & 0 deletions api/v1/chyt_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,12 @@ type ChytSpec struct {

Ytsaurus *corev1.LocalObjectReference `json:"ytsaurus,omitempty"`
Image string `json:"image,omitempty"`
// Mark specified image as default for cliques.
//+kubebuilder:default:=false
MakeDefault bool `json:"makeDefault"`
// Create ch_public clique, which is used by default when running CHYT queries.
//+kubebuilder:default:=false
CreatePublicClique bool `json:"createPublicClique"`
}

// ChytStatus defines the observed state of Chyt
Expand Down
7 changes: 7 additions & 0 deletions config/crd/bases/cluster.ytsaurus.tech_chyts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@ spec:
spec:
description: ChytSpec defines the desired state of Chyt
properties:
createPublicClique:
default: false
description: Create ch_public clique, which is used by default when
running CHYT queries.
type: boolean
image:
type: string
imagePullSecrets:
Expand All @@ -58,6 +63,7 @@ spec:
type: array
makeDefault:
default: false
description: Mark specified image as default for cliques.
type: boolean
ytsaurus:
description: |-
Expand All @@ -72,6 +78,7 @@ spec:
type: object
x-kubernetes-map-type: atomic
required:
- createPublicClique
- makeDefault
type: object
status:
Expand Down
1 change: 1 addition & 0 deletions config/samples/cluster_v1_chyt.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ spec:
minisaurus
image: ghcr.io/ytsaurus/chyt:2.14.0-relwithdebinfo
makeDefault: true
createPublicClique: true
3 changes: 2 additions & 1 deletion docs/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,8 @@ _Appears in:_
| `imagePullSecrets` _[LocalObjectReference](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.28/#localobjectreference-v1-core) array_ | | | |
| `ytsaurus` _[LocalObjectReference](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.28/#localobjectreference-v1-core)_ | | | |
| `image` _string_ | | | |
| `makeDefault` _boolean_ | | false | |
| `makeDefault` _boolean_ | Mark specified image as default for cliques. | false | |
| `createPublicClique` _boolean_ | Create ch_public clique, which is used by default when running CHYT queries. | false | |



Expand Down
2 changes: 1 addition & 1 deletion pkg/components/chyt.go
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ func (c *Chyt) doSync(ctx context.Context, dry bool) (ComponentStatus, error) {
return status, err
}

if c.ytsaurus.Spec.StrawberryController != nil && c.chyt.GetResource().Spec.MakeDefault {
if c.ytsaurus.Spec.StrawberryController != nil && c.chyt.GetResource().Spec.CreatePublicClique {
if !dry {
c.prepareChPublicJob()
}
Expand Down
7 changes: 7 additions & 0 deletions ytop-chart/templates/crds/chyts.cluster.ytsaurus.tech.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,11 @@ spec:
spec:
description: ChytSpec defines the desired state of Chyt
properties:
createPublicClique:
default: false
description: Create ch_public clique, which is used by default when
running CHYT queries.
type: boolean
image:
type: string
imagePullSecrets:
Expand All @@ -69,6 +74,7 @@ spec:
type: array
makeDefault:
default: false
description: Mark specified image as default for cliques.
type: boolean
ytsaurus:
description: |-
Expand All @@ -83,6 +89,7 @@ spec:
type: object
x-kubernetes-map-type: atomic
required:
- createPublicClique
- makeDefault
type: object
status:
Expand Down

0 comments on commit 1334eeb

Please sign in to comment.