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

chore(builder): Self-defined Build spec #2688

Merged
merged 2 commits into from
Oct 14, 2021
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
21 changes: 15 additions & 6 deletions config/crd/bases/camel.apache.org_builds.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,15 @@ spec:
spec:
description: BuildSpec defines the Build to be executed
properties:
strategy:
description: The strategy that should be used to perform the Build.
enum:
- routine
- pod
type: string
tasks:
description: The sequence of Build tasks to be performed as part of
the Build execution.
items:
description: Task --
properties:
Expand All @@ -97,7 +105,8 @@ spec:
name:
type: string
registry:
description: IntegrationPlatformRegistrySpec --
description: RegistrySpec provides the configuration for
the container registry
properties:
address:
type: string
Expand Down Expand Up @@ -432,7 +441,8 @@ spec:
name:
type: string
registry:
description: IntegrationPlatformRegistrySpec --
description: RegistrySpec provides the configuration for
the container registry
properties:
address:
type: string
Expand Down Expand Up @@ -470,7 +480,8 @@ spec:
name:
type: string
registry:
description: IntegrationPlatformRegistrySpec --
description: RegistrySpec provides the configuration for
the container registry
properties:
address:
type: string
Expand Down Expand Up @@ -530,7 +541,7 @@ spec:
format: date-time
type: string
message:
description: A human readable message indicating details about
description: A human-readable message indicating details about
the transition.
type: string
reason:
Expand Down Expand Up @@ -587,8 +598,6 @@ spec:
phase:
description: BuildPhase --
type: string
platform:
type: string
startedAt:
format: date-time
type: string
Expand Down
2 changes: 1 addition & 1 deletion config/crd/bases/camel.apache.org_integrationkits.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ spec:
format: date-time
type: string
message:
description: A human readable message indicating details about
description: A human-readable message indicating details about
the transition.
type: string
reason:
Expand Down
20 changes: 13 additions & 7 deletions config/crd/bases/camel.apache.org_integrationplatforms.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,10 @@ spec:
baseImage:
type: string
buildStrategy:
description: IntegrationPlatformBuildStrategy enumerates all implemented
build strategies
description: BuildStrategy specifies how the Build should be executed
enum:
- routine
- pod
type: string
httpProxySecret:
type: string
Expand Down Expand Up @@ -222,7 +224,8 @@ spec:
all implemented publish strategies
type: string
registry:
description: IntegrationPlatformRegistrySpec --
description: RegistrySpec provides the configuration for the container
registry
properties:
address:
type: string
Expand Down Expand Up @@ -309,8 +312,10 @@ spec:
baseImage:
type: string
buildStrategy:
description: IntegrationPlatformBuildStrategy enumerates all implemented
build strategies
description: BuildStrategy specifies how the Build should be executed
enum:
- routine
- pod
type: string
httpProxySecret:
type: string
Expand Down Expand Up @@ -460,7 +465,8 @@ spec:
all implemented publish strategies
type: string
registry:
description: IntegrationPlatformRegistrySpec --
description: RegistrySpec provides the configuration for the container
registry
properties:
address:
type: string
Expand Down Expand Up @@ -500,7 +506,7 @@ spec:
format: date-time
type: string
message:
description: A human readable message indicating details about
description: A human-readable message indicating details about
the transition.
type: string
reason:
Expand Down
2 changes: 1 addition & 1 deletion config/crd/bases/camel.apache.org_integrations.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5411,7 +5411,7 @@ spec:
format: date-time
type: string
message:
description: A human readable message indicating details about
description: A human-readable message indicating details about
the transition.
type: string
reason:
Expand Down
2 changes: 1 addition & 1 deletion config/crd/bases/camel.apache.org_kamelets.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,7 @@ spec:
format: date-time
type: string
message:
description: A human readable message indicating details about
description: A human-readable message indicating details about
the transition.
type: string
reason:
Expand Down
4 changes: 2 additions & 2 deletions e2e/common/cli/install_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ func TestSkipRegistryInstallation(t *testing.T) {
WithNewTestNamespace(t, func(ns string) {
Expect(Kamel("install", "-n", ns, "--skip-registry-setup").Execute()).To(Succeed())
Eventually(Platform(ns)).ShouldNot(BeNil())
Eventually(func() v1.IntegrationPlatformRegistrySpec {
Eventually(func() v1.RegistrySpec {
return Platform(ns)().Spec.Build.Registry
}, TestTimeoutMedium).Should(Equal(v1.IntegrationPlatformRegistrySpec{}))
}, TestTimeoutMedium).Should(Equal(v1.RegistrySpec{}))
})
}
1 change: 1 addition & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1658,6 +1658,7 @@ k8s.io/code-generator v0.18.2/go.mod h1:+UHX5rSbxmR8kzS+FAv7um6dtYrZokQvjHpDSYRV
k8s.io/code-generator v0.18.6/go.mod h1:TgNEVx9hCyPGpdtCWA34olQYLkh3ok9ar7XfSsr8b6c=
k8s.io/code-generator v0.19.2/go.mod h1:moqLn7w0t9cMs4+5CQyxnfA/HV8MF6aAVENF+WZZhgk=
k8s.io/code-generator v0.21.1/go.mod h1:hUlps5+9QaTrKx+jiM4rmq7YmH8wPOIko64uZCHDh6Q=
k8s.io/code-generator v0.21.4 h1:vO8jVuEGV4UF+/2s/88Qg05MokE/1QUFi/Q2YDgz++A=
k8s.io/code-generator v0.21.4/go.mod h1:K3y0Bv9Cz2cOW2vXUrNZlFbflhuPvuadW6JdnN6gGKo=
k8s.io/component-base v0.17.4/go.mod h1:5BRqHMbbQPm2kKu35v3G+CpVq4K0RJKC7TRioF0I9lE=
k8s.io/component-base v0.18.2/go.mod h1:kqLlMuhJNHQ9lz8Z7V5bxUUtjFZnrypArGl58gmDfUM=
Expand Down
21 changes: 15 additions & 6 deletions helm/camel-k/crds/crd-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,15 @@ spec:
spec:
description: BuildSpec defines the Build to be executed
properties:
strategy:
description: The strategy that should be used to perform the Build.
enum:
- routine
- pod
type: string
tasks:
description: The sequence of Build tasks to be performed as part of
the Build execution.
items:
description: Task --
properties:
Expand All @@ -97,7 +105,8 @@ spec:
name:
type: string
registry:
description: IntegrationPlatformRegistrySpec --
description: RegistrySpec provides the configuration for
the container registry
properties:
address:
type: string
Expand Down Expand Up @@ -432,7 +441,8 @@ spec:
name:
type: string
registry:
description: IntegrationPlatformRegistrySpec --
description: RegistrySpec provides the configuration for
the container registry
properties:
address:
type: string
Expand Down Expand Up @@ -470,7 +480,8 @@ spec:
name:
type: string
registry:
description: IntegrationPlatformRegistrySpec --
description: RegistrySpec provides the configuration for
the container registry
properties:
address:
type: string
Expand Down Expand Up @@ -530,7 +541,7 @@ spec:
format: date-time
type: string
message:
description: A human readable message indicating details about
description: A human-readable message indicating details about
the transition.
type: string
reason:
Expand Down Expand Up @@ -587,8 +598,6 @@ spec:
phase:
description: BuildPhase --
type: string
platform:
type: string
startedAt:
format: date-time
type: string
Expand Down
2 changes: 1 addition & 1 deletion helm/camel-k/crds/crd-integration-kit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ spec:
format: date-time
type: string
message:
description: A human readable message indicating details about
description: A human-readable message indicating details about
the transition.
type: string
reason:
Expand Down
20 changes: 13 additions & 7 deletions helm/camel-k/crds/crd-integration-platform.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,10 @@ spec:
baseImage:
type: string
buildStrategy:
description: IntegrationPlatformBuildStrategy enumerates all implemented
build strategies
description: BuildStrategy specifies how the Build should be executed
enum:
- routine
- pod
type: string
httpProxySecret:
type: string
Expand Down Expand Up @@ -222,7 +224,8 @@ spec:
all implemented publish strategies
type: string
registry:
description: IntegrationPlatformRegistrySpec --
description: RegistrySpec provides the configuration for the container
registry
properties:
address:
type: string
Expand Down Expand Up @@ -309,8 +312,10 @@ spec:
baseImage:
type: string
buildStrategy:
description: IntegrationPlatformBuildStrategy enumerates all implemented
build strategies
description: BuildStrategy specifies how the Build should be executed
enum:
- routine
- pod
type: string
httpProxySecret:
type: string
Expand Down Expand Up @@ -460,7 +465,8 @@ spec:
all implemented publish strategies
type: string
registry:
description: IntegrationPlatformRegistrySpec --
description: RegistrySpec provides the configuration for the container
registry
properties:
address:
type: string
Expand Down Expand Up @@ -500,7 +506,7 @@ spec:
format: date-time
type: string
message:
description: A human readable message indicating details about
description: A human-readable message indicating details about
the transition.
type: string
reason:
Expand Down
2 changes: 1 addition & 1 deletion helm/camel-k/crds/crd-integration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5411,7 +5411,7 @@ spec:
format: date-time
type: string
message:
description: A human readable message indicating details about
description: A human-readable message indicating details about
the transition.
type: string
reason:
Expand Down
2 changes: 1 addition & 1 deletion helm/camel-k/crds/crd-kamelet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,7 @@ spec:
format: date-time
type: string
message:
description: A human readable message indicating details about
description: A human-readable message indicating details about
the transition.
type: string
reason:
Expand Down
37 changes: 16 additions & 21 deletions pkg/apis/camel/v1/build_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,10 @@ import (

// BuildSpec defines the Build to be executed
type BuildSpec struct {
// The sequence of Build tasks to be performed as part of the Build execution.
Tasks []Task `json:"tasks,omitempty"`
// The strategy that should be used to perform the Build.
Strategy BuildStrategy `json:"strategy,omitempty"`
// Timeout defines the Build maximum execution duration.
// The Build deadline is set to the Build start time plus the Timeout duration.
// If the Build deadline is exceeded, the Build context is canceled,
Expand All @@ -53,22 +56,22 @@ type BaseTask struct {
// BuilderTask --
type BuilderTask struct {
BaseTask `json:",inline"`
BaseImage string `json:"baseImage,omitempty"`
Runtime RuntimeSpec `json:"runtime,omitempty"`
Sources []SourceSpec `json:"sources,omitempty"`
Resources []ResourceSpec `json:"resources,omitempty"`
Dependencies []string `json:"dependencies,omitempty"`
Steps []string `json:"steps,omitempty"`
Maven MavenSpec `json:"maven,omitempty"`
BuildDir string `json:"buildDir,omitempty"`
BaseImage string `json:"baseImage,omitempty"`
Runtime RuntimeSpec `json:"runtime,omitempty"`
Sources []SourceSpec `json:"sources,omitempty"`
Resources []ResourceSpec `json:"resources,omitempty"`
Dependencies []string `json:"dependencies,omitempty"`
Steps []string `json:"steps,omitempty"`
Maven MavenSpec `json:"maven,omitempty"`
BuildDir string `json:"buildDir,omitempty"`
}

// PublishTask --
type PublishTask struct {
ContextDir string `json:"contextDir,omitempty"`
BaseImage string `json:"baseImage,omitempty"`
Image string `json:"image,omitempty"`
Registry IntegrationPlatformRegistrySpec `json:"registry,omitempty"`
ContextDir string `json:"contextDir,omitempty"`
BaseImage string `json:"baseImage,omitempty"`
Image string `json:"image,omitempty"`
Registry RegistrySpec `json:"registry,omitempty"`
}

// BuildahTask --
Expand Down Expand Up @@ -117,7 +120,6 @@ type BuildStatus struct {
Error string `json:"error,omitempty"`
Failure *Failure `json:"failure,omitempty"`
StartedAt *metav1.Time `json:"startedAt,omitempty"`
Platform string `json:"platform,omitempty"`
Conditions []BuildCondition `json:"conditions,omitempty"`
// Change to Duration / ISO 8601 when CRD uses OpenAPI spec v3
// https://github.com/OAI/OpenAPI-Specification/issues/845
Expand All @@ -138,8 +140,6 @@ const (
BuildPhaseNone BuildPhase = ""
// BuildPhaseInitialization --
BuildPhaseInitialization BuildPhase = "Initialization"
// BuildPhaseWaitingForPlatform --
BuildPhaseWaitingForPlatform BuildPhase = "Waiting For Platform"
// BuildPhaseScheduling --
BuildPhaseScheduling BuildPhase = "Scheduling"
// BuildPhasePending --
Expand All @@ -154,11 +154,6 @@ const (
BuildPhaseInterrupted = "Interrupted"
// BuildPhaseError --
BuildPhaseError BuildPhase = "Error"

// BuildConditionPlatformAvailable --
BuildConditionPlatformAvailable BuildConditionType = "IntegrationPlatformAvailable"
// BuildConditionPlatformAvailableReason --
BuildConditionPlatformAvailableReason string = "IntegrationPlatformAvailable"
)

// +genclient
Expand Down Expand Up @@ -203,6 +198,6 @@ type BuildCondition struct {
LastTransitionTime metav1.Time `json:"lastTransitionTime,omitempty"`
// The reason for the condition's last transition.
Reason string `json:"reason,omitempty"`
// A human readable message indicating details about the transition.
// A human-readable message indicating details about the transition.
Message string `json:"message,omitempty"`
}
Loading