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

feat(api): Kamelet as static resource #4808

Merged
merged 2 commits into from
Oct 18, 2023
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
5 changes: 4 additions & 1 deletion config/crd/bases/camel.apache.org_kamelets.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -673,7 +673,10 @@ spec:
type: object
type: object
status:
description: the actual status of the resource
default:
phase: Ready
description: the actual status of the resource Deprecated no longer in
use
properties:
conditions:
description: Conditions --
Expand Down
2 changes: 2 additions & 0 deletions docs/modules/ROOT/partials/apis/camel-k-crds.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,7 @@ the desired specification


the actual status of the resource
Deprecated no longer in use


|===
Expand Down Expand Up @@ -3748,6 +3749,7 @@ Camel dependencies needed by the Kamelet
* <<#_camel_apache_org_v1_Kamelet, Kamelet>>

KameletStatus defines the observed state of Kamelet.
Required since we deprecated the parameter. Any external user can still expect a Ready status here.

[cols="2,2a",options="header"]
|===
Expand Down
3 changes: 1 addition & 2 deletions e2e/yaks/common/kamelet-beans/yaks-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ pre:
- name: installation
run: |
kubectl apply -f beans-source.kamelet.yaml -n $YAKS_NAMESPACE

kubectl wait kamelet beans-source --for=condition=Ready --timeout=10m -n $YAKS_NAMESPACE

post:
- name: print dump
if: env:CI=true && failure()
Expand Down
3 changes: 1 addition & 2 deletions e2e/yaks/common/kamelet-binding-autoload/yaks-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@ pre:
kubectl apply -f secret-specific.yaml -n $YAKS_NAMESPACE

kubectl apply -f timer-source.kamelet.yaml -n $YAKS_NAMESPACE

kubectl wait kamelet timer-source --for=condition=Ready --timeout=10m -n $YAKS_NAMESPACE

post:
- name: print dump
if: env:CI=true && failure()
Expand Down
3 changes: 0 additions & 3 deletions e2e/yaks/common/kamelet-binding-broker/yaks-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,6 @@ pre:
kubectl apply -f timer-source.kamelet.yaml -n $YAKS_NAMESPACE
kubectl apply -f logger-sink.kamelet.yaml -n $YAKS_NAMESPACE

kubectl wait kamelet timer-source --for=condition=Ready --timeout=10m -n $YAKS_NAMESPACE
kubectl wait kamelet logger-sink --for=condition=Ready --timeout=10m -n $YAKS_NAMESPACE

kubectl apply -f timer-source-binding.yaml -n $YAKS_NAMESPACE
kubectl apply -f logger-sink-binding.yaml -n $YAKS_NAMESPACE
kubectl wait kameletbinding timer-source-binding --for=condition=Ready --timeout=15m -n $YAKS_NAMESPACE
Expand Down
2 changes: 0 additions & 2 deletions e2e/yaks/common/kamelet-binding-http/yaks-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ pre:
run: |
kubectl apply -f timer-source.kamelet.yaml -n $YAKS_NAMESPACE

kubectl wait kamelet timer-source --for=condition=Ready --timeout=10m -n $YAKS_NAMESPACE

kamel run display.groovy -w -n $YAKS_NAMESPACE
cat timer-source-binding-display.yaml | sed 's/{namespace}/'"${YAKS_NAMESPACE}"'/' | kubectl apply -n $YAKS_NAMESPACE -f -
kubectl wait kameletbinding timer-source-binding-display --for=condition=Ready --timeout=15m -n $YAKS_NAMESPACE
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ pre:
- name: installation
run: |
kubectl apply -f timer-source.kamelet.yaml -n $YAKS_NAMESPACE

kubectl wait kamelet timer-source --for=condition=Ready --timeout=10m -n $YAKS_NAMESPACE

kubectl apply -f properties-binding.yaml -n $YAKS_NAMESPACE
post:
Expand Down
4 changes: 0 additions & 4 deletions e2e/yaks/common/kamelet-binding/yaks-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,8 @@ pre:
kubectl apply -f timer-source.kamelet.yaml -n $YAKS_NAMESPACE
kubectl apply -f logger-sink.kamelet.yaml -n $YAKS_NAMESPACE

kubectl wait kamelet timer-source --for=condition=Ready --timeout=10m -n $YAKS_NAMESPACE
kubectl wait kamelet logger-sink --for=condition=Ready --timeout=10m -n $YAKS_NAMESPACE

kubectl apply -f timer-source-binding.yaml -n $YAKS_NAMESPACE
kubectl apply -f logger-sink-binding.yaml -n $YAKS_NAMESPACE

kubectl wait kameletbinding timer-source-binding --for=condition=Ready --timeout=10m -n $YAKS_NAMESPACE
kubectl wait kameletbinding logger-sink-binding --for=condition=Ready --timeout=10m -n $YAKS_NAMESPACE
post:
Expand Down
4 changes: 0 additions & 4 deletions e2e/yaks/common/kamelet-data-types/yaks-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,6 @@ pre:
kubectl apply -f event-source.kamelet.yaml -n $YAKS_NAMESPACE
kubectl apply -f event-sink.kamelet.yaml -n $YAKS_NAMESPACE
kubectl apply -f data-type-action.kamelet.yaml -n $YAKS_NAMESPACE

kubectl wait kamelet event-source --for=condition=Ready --timeout=10m -n $YAKS_NAMESPACE
kubectl wait kamelet event-sink --for=condition=Ready --timeout=10m -n $YAKS_NAMESPACE
kubectl wait kamelet data-type-action --for=condition=Ready --timeout=10m -n $YAKS_NAMESPACE
post:
- name: print dump
if: env:CI=true && failure()
Expand Down
5 changes: 0 additions & 5 deletions e2e/yaks/common/kamelet-steps/yaks-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,7 @@ pre:
run: |
kubectl apply -f timer-source.kamelet.yaml -n $YAKS_NAMESPACE
kubectl apply -f prefix-action.kamelet.yaml -n $YAKS_NAMESPACE

kubectl wait kamelet timer-source --for=condition=Ready --timeout=10m -n $YAKS_NAMESPACE
kubectl wait kamelet prefix-action --for=condition=Ready --timeout=10m -n $YAKS_NAMESPACE

kubectl apply -f steps-binding.yaml -n $YAKS_NAMESPACE

kubectl wait kameletbinding steps-binding --for=condition=Ready --timeout=10m -n $YAKS_NAMESPACE
post:
- name: print dump
Expand Down
4 changes: 0 additions & 4 deletions e2e/yaks/common/kamelet/yaks-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,6 @@ pre:
run: |
kubectl apply -f timer-source.kamelet.yaml -n $YAKS_NAMESPACE
kubectl apply -f echo-sink.kamelet.yaml -n $YAKS_NAMESPACE

kubectl wait kamelet timer-source --for=condition=Ready --timeout=10m -n $YAKS_NAMESPACE
kubectl wait kamelet echo-sink --for=condition=Ready --timeout=10m -n $YAKS_NAMESPACE

kamel run source-sink.groovy -w -n $YAKS_NAMESPACE
post:
- name: print dump
Expand Down
5 changes: 4 additions & 1 deletion helm/camel-k/crds/crd-kamelet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -673,7 +673,10 @@ spec:
type: object
type: object
status:
description: the actual status of the resource
default:
phase: Ready
description: the actual status of the resource Deprecated no longer in
use
properties:
conditions:
description: Conditions --
Expand Down
4 changes: 3 additions & 1 deletion pkg/apis/camel/v1/kamelet_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ var (
// +kubebuilder:storageversion
// +kubebuilder:resource:path=kamelets,scope=Namespaced,shortName=kl,categories=kamel;camel
// +kubebuilder:subresource:status
// +kubebuilder:printcolumn:name="Phase",type=string,JSONPath=`.status.phase`,description="The Kamelet phase"
// +kubebuilder:printcolumn:name="Type",type=string,JSONPath=`.status.phase`,description="The Kamelet phase"

// Kamelet is the Schema for the kamelets API.
type Kamelet struct {
Expand All @@ -64,6 +64,8 @@ type Kamelet struct {
// the desired specification
Spec KameletSpec `json:"spec,omitempty"`
// the actual status of the resource
// +kubebuilder:default:={phase:"Ready"}
// Deprecated no longer in use
Status KameletStatus `json:"status,omitempty"`
}

Expand Down
3 changes: 0 additions & 3 deletions pkg/cmd/describe_kamelet.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,6 @@ func (command *describeKameletCommandOptions) describeKamelet(cmd *cobra.Command
w := indentedwriter.NewWriter(cmd.OutOrStdout())

describeObjectMeta(w, kamelet.ObjectMeta)

w.Writef(0, "Phase:\t%s\n", kamelet.Status.Phase)

// Definition
def := kamelet.Spec.Definition
if def != nil {
Expand Down
3 changes: 1 addition & 2 deletions pkg/cmd/kamelet_get.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,8 @@ func (command *kameletGetCommandOptions) run(cmd *cobra.Command) error {
continue
}

fmt.Fprintf(w, "%s\t%s\t%s\t%s\t%s\t%s\t%s\n",
fmt.Fprintf(w, "%s\t%s\t%s\t%s\t%s\t%s\n",
kl.Name,
string(kl.Status.Phase),
klType,
group,
bundled,
Expand Down
26 changes: 0 additions & 26 deletions pkg/controller/add_kamelet.go

This file was deleted.

54 changes: 0 additions & 54 deletions pkg/controller/kamelet/action.go

This file was deleted.

48 changes: 0 additions & 48 deletions pkg/controller/kamelet/initialize.go

This file was deleted.

Loading
Loading