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

Separate CHYT init options into makeDefault and createPublicClique #347

Merged
merged 2 commits into from
Sep 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions api/v1/chyt_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,11 @@ 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.
CreatePublicClique *bool `json:"createPublicClique,omitempty"`
}

// ChytStatus defines the observed state of Chyt
Expand Down
5 changes: 5 additions & 0 deletions api/v1/zz_generated.deepcopy.go

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

5 changes: 5 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,10 @@ spec:
spec:
description: ChytSpec defines the desired state of Chyt
properties:
createPublicClique:
description: Create ch_public clique, which is used by default when
running CHYT queries.
type: boolean
image:
type: string
imagePullSecrets:
Expand All @@ -58,6 +62,7 @@ spec:
type: array
makeDefault:
default: false
description: Mark specified image as default for cliques.
type: boolean
ytsaurus:
description: |-
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. | | |



Expand Down
3 changes: 2 additions & 1 deletion pkg/components/chyt.go
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,8 @@ 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 {
createPublicClique := c.chyt.GetResource().Spec.CreatePublicClique
if c.ytsaurus.Spec.StrawberryController != nil && createPublicClique != nil && *createPublicClique {
if !dry {
c.prepareChPublicJob()
}
Expand Down
5 changes: 5 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,10 @@ spec:
spec:
description: ChytSpec defines the desired state of Chyt
properties:
createPublicClique:
description: Create ch_public clique, which is used by default when
running CHYT queries.
type: boolean
image:
type: string
imagePullSecrets:
Expand All @@ -69,6 +73,7 @@ spec:
type: array
makeDefault:
default: false
description: Mark specified image as default for cliques.
type: boolean
ytsaurus:
description: |-
Expand Down
Loading