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

JVM trait #1226

Merged
merged 7 commits into from
Jan 24, 2020
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: 1 addition & 2 deletions docs/modules/ROOT/nav.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,8 @@
** xref:traits/affinity.adoc[Affinity]
** xref:traits/builder.adoc[Builder]
** xref:traits/camel.adoc[Camel]
** xref:traits/classpath.adoc[Classpath]
** xref:traits/container.adoc[Container]
** xref:traits/cron.adoc[Cron]
** xref:traits/debug.adoc[Debug]
** xref:traits/dependencies.adoc[Dependencies]
** xref:traits/deployer.adoc[Deployer]
** xref:traits/deployment.adoc[Deployment]
Expand All @@ -31,6 +29,7 @@
** xref:traits/ingress.adoc[Ingress]
** xref:traits/istio.adoc[Istio]
** xref:traits/jolokia.adoc[Jolokia]
** xref:traits/jvm.adoc[Jvm]
** xref:traits/knative-service.adoc[Knative Service]
** xref:traits/knative.adoc[Knative]
** xref:traits/owner.adoc[Owner]
Expand Down
31 changes: 0 additions & 31 deletions docs/modules/ROOT/pages/traits/classpath.adoc

This file was deleted.

47 changes: 47 additions & 0 deletions docs/modules/ROOT/pages/traits/jvm.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
= Jvm Trait

// Start of autogenerated code - DO NOT EDIT! (description)
The JVM trait is used to configure the JVM that runs the integration.


This trait is available in the following profiles: **Kubernetes, Knative, OpenShift**.

WARNING: The jvm trait is a *platform trait*: disabling it may compromise the platform functionality.

// End of autogenerated code - DO NOT EDIT! (description)
// Start of autogenerated code - DO NOT EDIT! (configuration)
== Configuration

Trait properties can be specified when running any integration with the CLI:
```
kamel run --trait jvm.[key]=[value] --trait jvm.[key2]=[value2] integration.groovy
```
The following configuration options are available:

[cols="2,1,5a"]
|===
|Property | Type | Description

| jvm.enabled
| bool
| Can be used to enable or disable a trait. All traits share this common property.

| jvm.debug
| bool
| Activates remote debugging, so that a debugger can be attached to the JVM, e.g., using port-forwarding

| jvm.debug-suspend
| bool
| Suspends the target JVM immediately before the main class is loaded

| jvm.debug-address
| string
| Transport address at which to listen for the newly launched JVM

| jvm.options
| string
| A comma-separated list of JVM options

|===

// End of autogenerated code - DO NOT EDIT! (configuration)
3 changes: 1 addition & 2 deletions docs/modules/ROOT/pages/traits/traits.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,8 @@ See the trait description pages for more information on a specific trait:
* xref:traits/affinity.adoc[Affinity Trait]
* xref:traits/builder.adoc[Builder Trait]
* xref:traits/camel.adoc[Camel Trait]
* xref:traits/classpath.adoc[Classpath Trait]
* xref:traits/container.adoc[Container Trait]
* xref:traits/cron.adoc[Cron Trait]
* xref:traits/debug.adoc[Debug Trait]
* xref:traits/dependencies.adoc[Dependencies Trait]
* xref:traits/deployer.adoc[Deployer Trait]
* xref:traits/deployment.adoc[Deployment Trait]
Expand All @@ -49,6 +47,7 @@ See the trait description pages for more information on a specific trait:
* xref:traits/ingress.adoc[Ingress Trait]
* xref:traits/istio.adoc[Istio Trait]
* xref:traits/jolokia.adoc[Jolokia Trait]
* xref:traits/jvm.adoc[Jvm Trait]
* xref:traits/knative-service.adoc[Knative Service Trait]
* xref:traits/knative.adoc[Knative Trait]
* xref:traits/owner.adoc[Owner Trait]
Expand Down
1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ require (
github.com/stoewer/go-strcase v1.0.2
github.com/stretchr/testify v1.4.0
go.uber.org/multierr v1.1.0
gopkg.in/inf.v0 v0.9.1
gopkg.in/yaml.v2 v2.2.4
k8s.io/api v0.0.0
k8s.io/apimachinery v0.0.0
Expand Down
4 changes: 2 additions & 2 deletions pkg/apis/camel/v1/integrationkit_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@ type IntegrationKitPhase string
type IntegrationKitConditionType string

const (
// IntegrationKindKind --
IntegrationKindKind string = "IntegrationKit"
// IntegrationKitKind --
IntegrationKitKind string = "IntegrationKit"

// IntegrationKitTypePlatform --
IntegrationKitTypePlatform = "platform"
Expand Down
4 changes: 2 additions & 2 deletions pkg/apis/camel/v1/integrationkit_types_support.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ func NewIntegrationKit(namespace string, name string) IntegrationKit {
return IntegrationKit{
TypeMeta: metav1.TypeMeta{
APIVersion: SchemeGroupVersion.String(),
Kind: IntegrationKindKind,
Kind: IntegrationKitKind,
},
ObjectMeta: metav1.ObjectMeta{
Namespace: namespace,
Expand All @@ -41,7 +41,7 @@ func NewIntegrationKitList() IntegrationKitList {
return IntegrationKitList{
TypeMeta: metav1.TypeMeta{
APIVersion: SchemeGroupVersion.String(),
Kind: IntegrationKindKind,
Kind: IntegrationKitKind,
},
}
}
Expand Down
4 changes: 2 additions & 2 deletions pkg/builder/builder_steps_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ func TestListPublishedImages(t *testing.T) {
&v1.IntegrationKit{
TypeMeta: metav1.TypeMeta{
APIVersion: v1.SchemeGroupVersion.String(),
Kind: v1.IntegrationKindKind,
Kind: v1.IntegrationKitKind,
},
ObjectMeta: metav1.ObjectMeta{
Namespace: "ns",
Expand All @@ -173,7 +173,7 @@ func TestListPublishedImages(t *testing.T) {
&v1.IntegrationKit{
TypeMeta: metav1.TypeMeta{
APIVersion: v1.SchemeGroupVersion.String(),
Kind: v1.IntegrationKindKind,
Kind: v1.IntegrationKitKind,
},
ObjectMeta: metav1.ObjectMeta{
Namespace: "ns",
Expand Down
12 changes: 6 additions & 6 deletions pkg/controller/integration/util_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ func TestLookupKitForIntegration_DiscardKitsInError(t *testing.T) {
&v1.IntegrationKit{
TypeMeta: metav1.TypeMeta{
APIVersion: v1.SchemeGroupVersion.String(),
Kind: v1.IntegrationKindKind,
Kind: v1.IntegrationKitKind,
},
ObjectMeta: metav1.ObjectMeta{
Namespace: "ns",
Expand All @@ -56,7 +56,7 @@ func TestLookupKitForIntegration_DiscardKitsInError(t *testing.T) {
&v1.IntegrationKit{
TypeMeta: metav1.TypeMeta{
APIVersion: v1.SchemeGroupVersion.String(),
Kind: v1.IntegrationKindKind,
Kind: v1.IntegrationKitKind,
},
ObjectMeta: metav1.ObjectMeta{
Namespace: "ns",
Expand Down Expand Up @@ -110,7 +110,7 @@ func TestLookupKitForIntegration_DiscardKitsWithIncompatibleTraits(t *testing.T)
&v1.IntegrationKit{
TypeMeta: metav1.TypeMeta{
APIVersion: v1.SchemeGroupVersion.String(),
Kind: v1.IntegrationKindKind,
Kind: v1.IntegrationKitKind,
},
ObjectMeta: metav1.ObjectMeta{
Namespace: "ns",
Expand Down Expand Up @@ -148,7 +148,7 @@ func TestLookupKitForIntegration_DiscardKitsWithIncompatibleTraits(t *testing.T)
&v1.IntegrationKit{
TypeMeta: metav1.TypeMeta{
APIVersion: v1.SchemeGroupVersion.String(),
Kind: v1.IntegrationKindKind,
Kind: v1.IntegrationKitKind,
},
ObjectMeta: metav1.ObjectMeta{
Namespace: "ns",
Expand Down Expand Up @@ -181,7 +181,7 @@ func TestLookupKitForIntegration_DiscardKitsWithIncompatibleTraits(t *testing.T)
&v1.IntegrationKit{
TypeMeta: metav1.TypeMeta{
APIVersion: v1.SchemeGroupVersion.String(),
Kind: v1.IntegrationKindKind,
Kind: v1.IntegrationKitKind,
},
ObjectMeta: metav1.ObjectMeta{
Namespace: "ns",
Expand Down Expand Up @@ -224,7 +224,7 @@ func TestLookupKitForIntegration_DiscardKitsWithIncompatibleTraits(t *testing.T)
&v1.IntegrationKit{
TypeMeta: metav1.TypeMeta{
APIVersion: v1.SchemeGroupVersion.String(),
Kind: v1.IntegrationKindKind,
Kind: v1.IntegrationKitKind,
},
ObjectMeta: metav1.ObjectMeta{
Namespace: "ns",
Expand Down
2 changes: 1 addition & 1 deletion pkg/install/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ func RuntimeObjectOrCollect(ctx context.Context, c client.Client, namespace stri
return nil
}
// Don't recreate integration kits, platforms, etc
if obj.GetObjectKind().GroupVersionKind().Kind == v1.IntegrationKindKind {
if obj.GetObjectKind().GroupVersionKind().Kind == v1.IntegrationKitKind {
return nil
}
if obj.GetObjectKind().GroupVersionKind().Kind == v1.IntegrationPlatformKind {
Expand Down
7 changes: 3 additions & 4 deletions pkg/trait/container.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,9 @@ func (t *containerTrait) Configure(e *Environment) (bool, error) {

func (t *containerTrait) Apply(e *Environment) error {
container := corev1.Container{
Name: t.Name,
Image: e.Integration.Status.Image,
Env: make([]corev1.EnvVar, 0),
Command: []string{"java"},
Name: t.Name,
Image: e.Integration.Status.Image,
Env: make([]corev1.EnvVar, 0),
}

// combine Environment of integration with platform, kit, integration
Expand Down
58 changes: 0 additions & 58 deletions pkg/trait/debug.go

This file was deleted.

Loading