Skip to content

Commit

Permalink
feat(kamelets): bundling from jar
Browse files Browse the repository at this point in the history
This is required to simplify the release process and leverage to distributed catalog as dependency
  • Loading branch information
squakez committed Sep 10, 2024
1 parent 67fabf7 commit 5a5b853
Show file tree
Hide file tree
Showing 25 changed files with 815 additions and 881 deletions.
5 changes: 1 addition & 4 deletions build/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -43,20 +43,17 @@ ENV MAVEN_USER_HOME="${MAVEN_HOME}"
RUN ${MVNW_DIR}/mvnw --version | grep "Maven home:" | sed 's/Maven home: //' >> ${MVNW_DIR}default \
&& cp -r /usr/share/maven/lib/. $(cat ${MVNW_DIR}default)/lib \
&& rm $(cat ${MVNW_DIR}default)/lib/maven-slf4j-provider* \
&& rm $(cat ${MVNW_DIR}default)/lib/slf4j-api-1.*
&& rm $(cat ${MVNW_DIR}default)/lib/slf4j-api-1.*

ENV MAVEN_OPTS="${MAVEN_OPTS} -Dlogback.configurationFile=${MAVEN_HOME}/conf/logback.xml"

ADD build/_maven_output ${MVN_REPO}
# Fix https://github.com/moby/moby/issues/37965
RUN true
ADD build/_kamelets /kamelets

RUN chgrp -R 0 ${MVN_REPO} \
&& chown -R 1001:0 ${MVN_REPO} \
&& chmod -R 775 ${MVN_REPO} \
&& chgrp -R 0 /kamelets \
&& chmod -R g=u /kamelets \
&& chgrp -R 0 ${MAVEN_HOME} \
&& chown -R 1001:0 ${MAVEN_HOME} \
&& chmod -R 775 ${MAVEN_HOME}
Expand Down
7 changes: 4 additions & 3 deletions pkg/apis/camel/v1/integrationplatform_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -192,19 +192,20 @@ const (
// IntegrationPlatformPhaseError when the IntegrationPlatform had some error (see Conditions).
IntegrationPlatformPhaseError IntegrationPlatformPhase = "Error"
// IntegrationPlatformPhaseCreateCatalog when the IntegrationPlatform creates a new CamelCatalog.
// Deprecated no longer in use.
IntegrationPlatformPhaseCreateCatalog IntegrationPlatformPhase = "CreateCatalog"

// IntegrationPlatformConditionReady is the condition if the IntegrationPlatform is ready.
// Deprecated: use IntegrationPlatformConditionTypeCreated.
IntegrationPlatformConditionReady = "Ready"
// IntegrationPlatformConditionTypeCreated is the condition if the IntegrationPlatform has been created.
IntegrationPlatformConditionTypeCreated IntegrationPlatformConditionType = "Created"

// IntegrationPlatformConditionTypeRegistryAvailable is the condition for the availability of a container registry.
IntegrationPlatformConditionTypeRegistryAvailable IntegrationPlatformConditionType = "RegistryAvailable"

// IntegrationPlatformConditionCamelCatalogAvailable is the condition for the availability of a container registry.
// IntegrationPlatformConditionCamelCatalogAvailable is the condition for the availability of a the CamelCatalog.
IntegrationPlatformConditionCamelCatalogAvailable IntegrationPlatformConditionType = "CamelCatalogAvailable"
// IntegrationPlatformConditionKameletCatalogAvailable is the condition for the availability of a Kamelet catalog.
IntegrationPlatformConditionKameletCatalogAvailable IntegrationPlatformConditionType = "KameletCatalogAvailable"

// IntegrationPlatformConditionCreatedReason represents the reason that the IntegrationPlatform is created.
IntegrationPlatformConditionCreatedReason = "IntegrationPlatformCreated"
Expand Down
5 changes: 5 additions & 0 deletions pkg/apis/camel/v1/kamelet_types_support.go
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,11 @@ func (k *Kamelet) SortedTypesKeys() []TypeSlot {
return res
}

// IsBundled returns true if the Kamelet is coming from a pre-bundled installation.
func (k *Kamelet) IsBundled() bool {
return k.Labels != nil && k.Labels[KameletBundledLabel] == "true"
}

func ValidKameletName(name string) bool {
return !reservedKameletNames[name]
}
Expand Down
1 change: 0 additions & 1 deletion pkg/controller/catalog/initialize.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ func (action *initializeAction) CanHandle(catalog *v1.CamelCatalog) bool {

func (action *initializeAction) Handle(ctx context.Context, catalog *v1.CamelCatalog) (*v1.CamelCatalog, error) {
action.L.Info("Initializing CamelCatalog")

platform, err := platformutil.GetForName(ctx, action.client, catalog.Namespace, defaults.OperatorID())

if err != nil {
Expand Down
84 changes: 0 additions & 84 deletions pkg/controller/integrationplatform/catalog.go

This file was deleted.

235 changes: 0 additions & 235 deletions pkg/controller/integrationplatform/catalog_test.go

This file was deleted.

Loading

0 comments on commit 5a5b853

Please sign in to comment.