squakez commented on a change in pull request #3032:
URL: https://github.com/apache/camel-k/pull/3032#discussion_r814770722
##########
File path: pkg/apis/camel/v1/integrationplatform_types_support.go
##########
@@ -178,13 +179,17 @@ func (in *IntegrationPlatformStatus)
RemoveCondition(condType IntegrationPlatfor
in.Conditions = newConditions
}
-// IsKanikoCacheEnabled tells if the KanikoCache is enabled on the integration
platform build spec
-func (b IntegrationPlatformBuildSpec) IsKanikoCacheEnabled() bool {
- if b.KanikoBuildCache == nil {
- // Cache is disabled by default
- return false
+// IsOptionEnabled tells if the KanikoCache is enabled on the integration
platform build spec
Review comment:
Still reference to Kaniko. As it now is a general purpose we should
change the comment as well
##########
File path: pkg/controller/integrationplatform/initialize.go
##########
@@ -70,7 +70,11 @@ func (action *initializeAction) Handle(ctx context.Context,
platform *v1.Integra
}
if platform.Status.Build.PublishStrategy ==
v1.IntegrationPlatformBuildPublishStrategyKaniko {
Review comment:
You can comment this block with `// nolint: staticcheck` to avoid lint
complains (due to the deprecation)
##########
File path: pkg/platform/defaults.go
##########
@@ -169,8 +173,8 @@ func setPlatformDefaults(p *v1.IntegrationPlatform, verbose
bool) error {
"-Dstyle.color=never",
}
}
- if p.Status.Build.PersistentVolumeClaim == "" {
- p.Status.Build.PersistentVolumeClaim = p.Name
+ if _, ok :=
p.Status.Build.PublishStrategyOptions["persistentVolumeClaim"]; !ok {
Review comment:
Should not better use `builder.KanikoPVCName` constant?
##########
File path: pkg/controller/integrationplatform/kaniko_cache.go
##########
@@ -40,6 +40,11 @@ func createKanikoCacheWarmerPod(ctx context.Context, client
client.Client, platf
// See:
// -
https://kubernetes.io/docs/concepts/storage/persistent-volumes/#node-affinity
// - https://kubernetes.io/docs/concepts/storage/volumes/#local
+ pvcName := platform.Status.Build.PersistentVolumeClaim
Review comment:
nolint comments as above
##########
File path: pkg/trait/builder.go
##########
@@ -113,6 +113,18 @@ func (t *builderTrait) Apply(e *Environment) error {
}})
case v1.IntegrationPlatformBuildPublishStrategyKaniko:
Review comment:
Nolint here
##########
File path: pkg/platform/defaults.go
##########
@@ -189,15 +193,15 @@ func setPlatformDefaults(p *v1.IntegrationPlatform,
verbose bool) error {
Duration: 5 * time.Minute,
}
}
-
- if p.Status.Build.PublishStrategy ==
v1.IntegrationPlatformBuildPublishStrategyKaniko &&
p.Status.Build.KanikoBuildCache == nil {
+ _, cacheEnabled :=
p.Status.Build.PublishStrategyOptions["KanikoBuildCache"]
Review comment:
Should not better use `builder.KanikoBuildCacheEnabled` constant?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]