-
Notifications
You must be signed in to change notification settings - Fork 0
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
Add functionality for stopping/starting deployment #25
Merged
Merged
Changes from 3 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
aaf8672
Add functionality for stopping/starting deployment
hariso 55b3153
remove default
hariso 55f87cf
remove default
hariso fca5ac9
Merge branch 'main' into haris/start-stop-deployment
hariso 116f926
running is a ptr
hariso ccd5690
make install not needed
hariso c6e9be8
Fix deployment status (#26)
lyuboxa 9c583e8
fix samples
lyuboxa File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,32 @@ | ||
apiVersion: operator.conduit.io/v1 | ||
apiVersion: operator.conduit.io/v1alpha | ||
kind: Conduit | ||
metadata: | ||
name: conduit-generator | ||
name: conduit-generator-image-ver | ||
spec: | ||
running: true | ||
name: generator.log | ||
description: generator pipeline | ||
image: ghcr.io/conduitio/conduit | ||
version: v0.9.0 | ||
version: v0.11.1 | ||
connectors: | ||
- name: source-connector | ||
type: source | ||
plugin: builtin:generator | ||
plugin: "builtin:generator" | ||
pluginName: "builtin:generator" | ||
settings: | ||
- name: format.type | ||
value: structured | ||
- name: format.options | ||
value: "id:int,name:string,company:string,trial:bool" | ||
- name: format.options.id | ||
value: "int" | ||
- name: format.options.name | ||
value: "string" | ||
- name: format.options.company | ||
value: "string" | ||
- name: format.options.trial | ||
value: "bool" | ||
- name: recordCount | ||
value: "3" | ||
- name: destination-connector | ||
type: destination | ||
plugin: builtin:log | ||
plugin: "builtin:log" | ||
pluginName: "builtin:log" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -231,9 +231,9 @@ func (r *ConduitReconciler) CreateOrUpdateVolume(ctx context.Context, c *v1.Cond | |
// Status conditions are set depending on the outcome of the operation. | ||
func (r *ConduitReconciler) CreateOrUpdateDeployment(ctx context.Context, c *v1.Conduit) error { | ||
var ( | ||
cm = corev1.ConfigMap{} | ||
nn = c.NamespacedName() | ||
oneReplica = int32(1) | ||
cm = corev1.ConfigMap{} | ||
nn = c.NamespacedName() | ||
replicas = r.getReplicas(c) | ||
|
||
deployment = appsv1.Deployment{ | ||
ObjectMeta: metav1.ObjectMeta{ | ||
|
@@ -271,7 +271,7 @@ func (r *ConduitReconciler) CreateOrUpdateDeployment(ctx context.Context, c *v1. | |
Strategy: appsv1.DeploymentStrategy{ | ||
Type: appsv1.RecreateDeploymentStrategyType, | ||
}, | ||
Replicas: &oneReplica, | ||
Replicas: &replicas, | ||
Selector: &metav1.LabelSelector{}, | ||
Template: corev1.PodTemplateSpec{ | ||
ObjectMeta: metav1.ObjectMeta{}, | ||
|
@@ -456,3 +456,10 @@ func (r *ConduitReconciler) SetupWithManager(mgr ctrl.Manager) error { | |
// Owns(&corev1.PersistentVolume{}). | ||
Complete(r) | ||
} | ||
|
||
func (r *ConduitReconciler) getReplicas(c *v1.Conduit) int32 { | ||
if c.Spec.Running { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is a ptr now. |
||
return 1 | ||
} | ||
return 0 | ||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
best to have these installed when the operator boots up, as it will register them automatically.
otherwise there may be discrepancy between crd and code handling the new stuff there.