Skip to content

Commit

Permalink
Merge branch 'main' into istio-gateway-secret-controller
Browse files Browse the repository at this point in the history
  • Loading branch information
lindnerby authored Dec 12, 2024
2 parents 5eb6424 + f4b7091 commit 30724d2
Show file tree
Hide file tree
Showing 46 changed files with 1,287 additions and 160 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@ runs:
if: ${{ matrix.e2e-test == 'module-upgrade-channel-switch' ||
matrix.e2e-test == 'modulereleasemeta-module-upgrade-new-version' ||
matrix.e2e-test == 'modulereleasemeta-upgrade-under-deletion' ||
matrix.e2e-test == 'modulereleasemeta-sync'
matrix.e2e-test == 'modulereleasemeta-sync' ||
matrix.e2e-test == 'module-status-on-skr-connection-lost'
}}
shell: bash
run: |
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/test-e2e-with-modulereleasemeta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ jobs:
- rbac-privileges
- modulereleasemeta-with-obsolete-moduletemplate
- modulereleasemeta-sync
- module-status-on-skr-connection-lost
- modulereleasemeta-watch-trigger

runs-on: ubuntu-latest
Expand Down
8 changes: 4 additions & 4 deletions .run/Delete Test Clusters.run.xml
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Delete Test Clusters" type="ShConfigurationType">
<option name="SCRIPT_TEXT" value="k3d cluster rm kcp skr" />
<option name="SCRIPT_TEXT" value="" />
<option name="INDEPENDENT_SCRIPT_PATH" value="true" />
<option name="SCRIPT_PATH" value="" />
<option name="SCRIPT_PATH" value="$PROJECT_DIR$/scripts/tests/clusters_cleanup.sh" />
<option name="SCRIPT_OPTIONS" value="" />
<option name="INDEPENDENT_SCRIPT_WORKING_DIRECTORY" value="true" />
<option name="SCRIPT_WORKING_DIRECTORY" value="$PROJECT_DIR$" />
<option name="INDEPENDENT_INTERPRETER_PATH" value="true" />
<option name="INTERPRETER_PATH" value="/bin/zsh" />
<option name="INTERPRETER_PATH" value="/bin/bash" />
<option name="INTERPRETER_OPTIONS" value="" />
<option name="EXECUTE_IN_TERMINAL" value="true" />
<option name="EXECUTE_SCRIPT_FILE" value="false" />
<option name="EXECUTE_SCRIPT_FILE" value="true" />
<envs />
<method v="2" />
</configuration>
Expand Down
11 changes: 4 additions & 7 deletions .run/Deploy KLM from registry.run.xml
Original file line number Diff line number Diff line change
@@ -1,20 +1,17 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Deploy KLM from registry" type="ShConfigurationType">
<option name="SCRIPT_TEXT" value="echo $KLM_IMAGE_REGISTRY; " />
<option name="SCRIPT_TEXT" value="echo &quot;Enter KLM image registry (dev, prod):&quot;; read input_img_reg; echo &quot;Enter KLM image tag (e.g.: latest):&quot;; read input_img_tag; $PROJECT_DIR$/scripts/tests/deploy_klm_from_registry.sh --image-registry $input_img_reg --image-tag $input_img_tag" />
<option name="INDEPENDENT_SCRIPT_PATH" value="true" />
<option name="SCRIPT_PATH" value="$PROJECT_DIR$/scripts/tests/deploy_klm_from_registry.sh" />
<option name="SCRIPT_PATH" value="" />
<option name="SCRIPT_OPTIONS" value="" />
<option name="INDEPENDENT_SCRIPT_WORKING_DIRECTORY" value="true" />
<option name="SCRIPT_WORKING_DIRECTORY" value="$PROJECT_DIR$" />
<option name="INDEPENDENT_INTERPRETER_PATH" value="true" />
<option name="INTERPRETER_PATH" value="/bin/bash" />
<option name="INTERPRETER_OPTIONS" value="" />
<option name="EXECUTE_IN_TERMINAL" value="true" />
<option name="EXECUTE_SCRIPT_FILE" value="true" />
<envs>
<env name="IMG_REGISTRY_HOST" value="europe-docker.pkg.dev/kyma-project" />
<env name="IMG_NAME" value="lifecycle-manager" />
</envs>
<option name="EXECUTE_SCRIPT_FILE" value="false" />
<envs />
<method v="2" />
</configuration>
</component>
11 changes: 4 additions & 7 deletions .run/Deploy KLM from sources.run.xml
Original file line number Diff line number Diff line change
@@ -1,20 +1,17 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Deploy KLM from sources" type="ShConfigurationType">
<option name="SCRIPT_TEXT" value="export KUBECONFIG=${HOME}/.k3d/kcp-local.yaml;TAG=\&quot;$(date +%Y%m%d%H%M%S)\&quot; &amp;&amp; make docker-build IMG=${LOCAL_IMG}:${TAG}; make docker-push IMG=${LOCAL_IMG}:${TAG}; make local-deploy-with-watcher IMG=${CLUSTER_IMG}:${TAG}" />
<option name="SCRIPT_TEXT" value="" />
<option name="INDEPENDENT_SCRIPT_PATH" value="true" />
<option name="SCRIPT_PATH" value="" />
<option name="SCRIPT_PATH" value="$PROJECT_DIR$/scripts/tests/deploy_klm_from_sources.sh" />
<option name="SCRIPT_OPTIONS" value="" />
<option name="INDEPENDENT_SCRIPT_WORKING_DIRECTORY" value="true" />
<option name="SCRIPT_WORKING_DIRECTORY" value="$PROJECT_DIR$" />
<option name="INDEPENDENT_INTERPRETER_PATH" value="true" />
<option name="INTERPRETER_PATH" value="/bin/zsh" />
<option name="INTERPRETER_OPTIONS" value="" />
<option name="EXECUTE_IN_TERMINAL" value="true" />
<option name="EXECUTE_SCRIPT_FILE" value="false" />
<envs>
<env name="LOCAL_IMG" value="localhost:5111/lifecycle-manager" />
<env name="CLUSTER_IMG" value="k3d-kcp-registry.localhost:5000/lifecycle-manager"/>
</envs>
<option name="EXECUTE_SCRIPT_FILE" value="true" />
<envs />
<method v="2" />
</configuration>
</component>
3 changes: 2 additions & 1 deletion .run/Deploy kyma.run.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Deploy kyma" type="ShConfigurationType">
<option name="SCRIPT_TEXT" value="echo Enter the skr host value \(host.k3d.internal or localhost\):; read SKR_HOST; export SKR_HOST; export KUBECONFIG=$HOME/.k3d/kcp-local.yaml; $PROJECT_DIR$/scripts/tests/deploy_kyma.sh" />
<option name="SCRIPT_TEXT" value="echo Enter the skr host value \(host.k3d.internal or localhost\):; read skr_host; $PROJECT_DIR$/scripts/tests/deploy_kyma.sh $skr_host" />
<option name="INDEPENDENT_SCRIPT_PATH" value="true" />
<option name="SCRIPT_PATH" value="" />
<option name="SCRIPT_OPTIONS" value="" />
Expand All @@ -11,6 +11,7 @@
<option name="INTERPRETER_OPTIONS" value="" />
<option name="EXECUTE_IN_TERMINAL" value="true" />
<option name="EXECUTE_SCRIPT_FILE" value="false" />
<envs />
<method v="2" />
</configuration>
</component>
3 changes: 2 additions & 1 deletion .run/E2E Tests.run.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="E2E Tests" type="ShConfigurationType">
<option name="SCRIPT_TEXT" value="echo Enter the E2E test to run; read e2eTestName; export KCP_KUBECONFIG=$HOME/.k3d/kcp-local.yaml; export SKR_KUBECONFIG=$HOME/.k3d/skr-local.yaml; make -C $PROJECT_DIR$/tests/e2e $e2eTestName" />
<option name="SCRIPT_TEXT" value="echo Enter the E2E test to run:; read e2eTestName; $PROJECT_DIR$/scripts/tests/e2e.sh $e2eTestName" />
<option name="INDEPENDENT_SCRIPT_PATH" value="true" />
<option name="SCRIPT_PATH" value="" />
<option name="SCRIPT_OPTIONS" value="" />
Expand All @@ -11,6 +11,7 @@
<option name="INTERPRETER_OPTIONS" value="" />
<option name="EXECUTE_IN_TERMINAL" value="true" />
<option name="EXECUTE_SCRIPT_FILE" value="false" />
<envs />
<method v="2" />
</configuration>
</component>
7 changes: 4 additions & 3 deletions .run/Install CRDs.run.xml
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Install CRDs" type="ShConfigurationType">
<option name="SCRIPT_TEXT" value="export KUBECONFIG=$HOME/.k3d/kcp-local.yaml; make install" />
<option name="SCRIPT_TEXT" value="" />
<option name="INDEPENDENT_SCRIPT_PATH" value="true" />
<option name="SCRIPT_PATH" value="" />
<option name="SCRIPT_PATH" value="$PROJECT_DIR$/scripts/tests/install_crds.sh" />
<option name="SCRIPT_OPTIONS" value="" />
<option name="INDEPENDENT_SCRIPT_WORKING_DIRECTORY" value="true" />
<option name="SCRIPT_WORKING_DIRECTORY" value="$PROJECT_DIR$" />
<option name="INDEPENDENT_INTERPRETER_PATH" value="true" />
<option name="INTERPRETER_PATH" value="/bin/zsh" />
<option name="INTERPRETER_OPTIONS" value="" />
<option name="EXECUTE_IN_TERMINAL" value="true" />
<option name="EXECUTE_SCRIPT_FILE" value="false" />
<option name="EXECUTE_SCRIPT_FILE" value="true" />
<envs />
<method v="2" />
</configuration>
</component>
17 changes: 17 additions & 0 deletions .run/Install Watcher Resources For Local KLM.run.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Install Watcher Resources For Local KLM" type="ShConfigurationType">
<option name="SCRIPT_TEXT" value="export KUBECONFIG=$HOME/.k3d/kcp-local.yaml; kubectl apply -f &lt;(kubectl kustomize config/watcher_local_test | yq 'select(.kind != &quot;Deployment&quot;)')" />
<option name="INDEPENDENT_SCRIPT_PATH" value="true" />
<option name="SCRIPT_PATH" value="" />
<option name="SCRIPT_OPTIONS" value="" />
<option name="INDEPENDENT_SCRIPT_WORKING_DIRECTORY" value="true" />
<option name="SCRIPT_WORKING_DIRECTORY" value="$PROJECT_DIR$" />
<option name="INDEPENDENT_INTERPRETER_PATH" value="true" />
<option name="INTERPRETER_PATH" value="/bin/zsh" />
<option name="INTERPRETER_OPTIONS" value="" />
<option name="EXECUTE_IN_TERMINAL" value="true" />
<option name="EXECUTE_SCRIPT_FILE" value="false" />
<envs />
<method v="2" />
</configuration>
</component>
5 changes: 3 additions & 2 deletions .run/Launch KLM locally.run.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
<configuration default="false" name="Launch KLM locally" type="GoApplicationRunConfiguration" factoryName="Go Application">
<module name="lifecycle-manager" />
<working_directory value="$PROJECT_DIR$" />
<parameters value="KUBECONFIG=$HOME/.k3d/kcp-local.yaml --in-kcp-mode" />
<parameters value="--in-kcp-mode --enable-kcp-watcher --skr-watcher-image-tag=1.1.7" />
<envs>
<env name="ENABLE_WEBHOOKS" value="false" />
<env name="KUBECONFIG" value="$USER_HOME$/.k3d/kcp-local.yaml" />
</envs>
<kind value="FILE" />
<package value="$PROJECT_DIR$/cmd/main.go" />
Expand All @@ -13,6 +13,7 @@
<method v="2">
<option name="RunConfigurationTask" enabled="true" run_configuration_name="Create New Test Clusters" run_configuration_type="ShConfigurationType" />
<option name="RunConfigurationTask" enabled="true" run_configuration_name="Install CRDs" run_configuration_type="ShConfigurationType" />
<option name="RunConfigurationTask" enabled="true" run_configuration_name="Install Watcher Resources For Local KLM" run_configuration_type="ShConfigurationType" />
</method>
</configuration>
</component>
7 changes: 4 additions & 3 deletions .run/Un-Deploy kyma.run.xml
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Un-Deploy kyma" type="ShConfigurationType">
<option name="SCRIPT_TEXT" value="export KUBECONFIG=$HOME/.k3d/kcp-local.yaml; kubectl -n kcp-system delete kyma kyma-sample; kubectl -n kcp-system delete secret kyma-sample" />
<option name="SCRIPT_TEXT" value="" />
<option name="INDEPENDENT_SCRIPT_PATH" value="true" />
<option name="SCRIPT_PATH" value="" />
<option name="SCRIPT_PATH" value="$PROJECT_DIR$/scripts/tests/undeploy_kyma.sh" />
<option name="SCRIPT_OPTIONS" value="" />
<option name="INDEPENDENT_SCRIPT_WORKING_DIRECTORY" value="true" />
<option name="SCRIPT_WORKING_DIRECTORY" value="$PROJECT_DIR$" />
<option name="INDEPENDENT_INTERPRETER_PATH" value="true" />
<option name="INTERPRETER_PATH" value="/bin/zsh" />
<option name="INTERPRETER_OPTIONS" value="" />
<option name="EXECUTE_IN_TERMINAL" value="true" />
<option name="EXECUTE_SCRIPT_FILE" value="false" />
<option name="EXECUTE_SCRIPT_FILE" value="true" />
<envs />
<method v="2" />
</configuration>
</component>
74 changes: 17 additions & 57 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,49 +4,32 @@
"version": "2.0.0",
"tasks": [
{
"label": "Delete Test Clusters",
"label": "Create New Test Clusters",
"type": "shell",
"command": "k3d cluster rm kcp skr",
"command": "${cwd}/scripts/tests/create_test_clusters.sh",
"dependsOn": ["Delete Test Clusters"]
},
{
"label": "Ensure Test Clusters",
"label": "Delete Test Clusters",
"type": "shell",
"command": "${cwd}/scripts/tests/create_test_clusters.sh",
"command": "${cwd}/scripts/tests/clusters_cleanup.sh"
},
{
"label": "Create New Test Clusters",
"label": "Ensure Test Clusters",
"type": "shell",
"command": "${cwd}/scripts/tests/create_test_clusters.sh",
"dependsOn": [
"Delete Test Clusters"
]
"command": "${cwd}/scripts/tests/create_test_clusters.sh"
},
// re-run if encountering error that the watcher CRD is missing
{
"label": "Deploy KLM from sources",
"type": "shell",
"command": "TAG=\"$(date +%Y%m%d%H%M%S)\" && make docker-build IMG=${LOCAL_IMG}:${TAG}; make docker-push IMG=${LOCAL_IMG}:${TAG}; make local-deploy-with-watcher IMG=${CLUSTER_IMG}:${TAG}",
"options": {
"env": {
"LOCAL_IMG": "localhost:5111/lifecycle-manager",
"CLUSTER_IMG": "k3d-kcp-registry.localhost:5000/lifecycle-manager",
"KUBECONFIG": "${env:HOME}/.k3d/kcp-local.yaml"

}
}
"command": "${cwd}/scripts/tests/deploy_klm_from_sources.sh"
},
// re-run if encountering error that the watcher CRD is missing
{
"label": "Deploy KLM from registry",
"type": "shell",
"command": "make local-deploy-with-watcher IMG=${IMG_REGISTRY_HOST}/${input:klmImageRegistry}/${IMG_NAME}:${input:klmImageTag}",
"options": {
"env": {
"IMG_REGISTRY_HOST": "europe-docker.pkg.dev/kyma-project",
"IMG_NAME": "lifecycle-manager",
"KUBECONFIG": "${env:HOME}/.k3d/kcp-local.yaml",
}
}
"command": "${cwd}/scripts/tests/deploy_klm_from_registry.sh --image-registry ${input:klmImageRegistry} --image-tag ${input:klmImageTag}"
},
{
"label": "Deploy template-operator",
Expand All @@ -61,46 +44,25 @@
{
"label": "Deploy kyma",
"type": "shell",
"command": "export SKR_HOST=${input:skrHost} && ${cwd}/scripts/tests/deploy_kyma.sh",
"options": {
"env": {
"KUBECONFIG": "${env:HOME}/.k3d/kcp-local.yaml",
}
}
"command": "${cwd}/scripts/tests/deploy_kyma.sh ${input:skrHost}"
},
{
"label": "Un-Deploy kyma",
"type": "shell",
"command": "kubectl -n kcp-system delete kyma kyma-sample; kubectl -n kcp-system delete secret kyma-sample",
"options": {
"env": {
"KUBECONFIG": "${env:HOME}/.k3d/kcp-local.yaml",
}
}
"command": "${cwd}/scripts/tests/undeploy_kyma.sh"
},
{
"label": "E2E Tests",
"type": "shell",
"command": "make -C ${cwd}/tests/e2e ${input:e2eTestTarget}",
"command": "${cwd}/scripts/tests/e2e.sh ${input:e2eTestTarget}",
"group": {
"kind": "test"
},
"options": {
"env": {
"KCP_KUBECONFIG": "${env:HOME}/.k3d/kcp-local.yaml",
"SKR_KUBECONFIG": "${env:HOME}/.k3d/skr-local.yaml"
}
}
},
{
"label": "Install CRDs",
"type": "shell",
"command": "make install",
"options": {
"env": {
"KUBECONFIG": "${env:HOME}/.k3d/kcp-local.yaml",
}
}
"command": "${cwd}/scripts/tests/install_crds.sh"
}
],
"inputs": [
Expand Down Expand Up @@ -133,6 +95,7 @@
"mandatory-module-metrics",
"misconfigured-kyma-secret",
"ocm-compatible-module-template",
"modulereleasemeta-sync"
]
},
{
Expand All @@ -152,15 +115,12 @@
"id": "klmImageRegistry",
"type": "pickString",
"description": "Registry of KLM image",
"options": [
"dev",
"prod"
]
"options": ["dev", "prod"]
},
{
"id": "klmImageTag",
"type": "promptString",
"description": "Tag of the KLM image, e.g. 'latest'",
"description": "Tag of the KLM image, e.g. 'latest'"
},
{
"id": "skrHost",
Expand All @@ -172,6 +132,6 @@
// use localhost when running KLM locally on the machine
"localhost"
]
},
}
]
}
2 changes: 1 addition & 1 deletion api/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ go 1.23.4
require (
github.com/Masterminds/semver/v3 v3.3.1
k8s.io/apimachinery v0.31.3
sigs.k8s.io/controller-runtime v0.19.2
sigs.k8s.io/controller-runtime v0.19.3
)

require (
Expand Down
4 changes: 2 additions & 2 deletions api/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,8 @@ k8s.io/kube-openapi v0.0.0-20241009091222-67ed5848f094 h1:MErs8YA0abvOqJ8gIupA1T
k8s.io/kube-openapi v0.0.0-20241009091222-67ed5848f094/go.mod h1:7ioBJr1A6igWjsR2fxq2EZ0mlMwYLejazSIc2bzMp2U=
k8s.io/utils v0.0.0-20240921022957-49e7df575cb6 h1:MDF6h2H/h4tbzmtIKTuctcwZmY0tY9mD9fNT47QO6HI=
k8s.io/utils v0.0.0-20240921022957-49e7df575cb6/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0=
sigs.k8s.io/controller-runtime v0.19.2 h1:3sPrF58XQEPzbE8T81TN6selQIMGbtYwuaJ6eDssDF8=
sigs.k8s.io/controller-runtime v0.19.2/go.mod h1:iRmWllt8IlaLjvTTDLhRBXIEtkCK6hwVBJJsYS9Ajf4=
sigs.k8s.io/controller-runtime v0.19.3 h1:XO2GvC9OPftRst6xWCpTgBZO04S2cbp0Qqkj8bX1sPw=
sigs.k8s.io/controller-runtime v0.19.3/go.mod h1:j4j87DqtsThvwTv5/Tc5NFRyyF/RF0ip4+62tbTSIUM=
sigs.k8s.io/json v0.0.0-20241014173422-cfa47c3a1cc8 h1:gBQPwqORJ8d8/YNZWEjoZs7npUVDpVXUUOFfW6CgAqE=
sigs.k8s.io/json v0.0.0-20241014173422-cfa47c3a1cc8/go.mod h1:mdzfpAEoE6DHQEN0uh9ZbOCuHbLK5wOm7dK4ctXE9Tg=
sigs.k8s.io/structured-merge-diff/v4 v4.4.1 h1:150L+0vs/8DA78h1u02ooW1/fFq/Lwr+sGiqlzvrtq4=
Expand Down
16 changes: 16 additions & 0 deletions api/v1beta2/modulereleasemeta_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,14 @@ type ModuleReleaseMetaSpec struct {
// +listType=map
// +listMapKey=channel
Channels []ChannelVersionAssignment `json:"channels"`

// Beta indicates if the module is in beta state. Beta modules are only available for beta Kymas.
// +kubebuilder:default:=false
Beta bool `json:"beta,omitempty"`

// Internal indicates if the module is internal. Internal modules are only available for internal Kymas.
// +kubebuilder:default:=false
Internal bool `json:"internal,omitempty"`
}

// +kubebuilder:object:root=true
Expand Down Expand Up @@ -59,3 +67,11 @@ type ChannelVersionAssignment struct {
func init() {
SchemeBuilder.Register(&ModuleReleaseMeta{}, &ModuleReleaseMetaList{})
}

func (m ModuleReleaseMeta) IsBeta() bool {
return m.Spec.Beta
}

func (m ModuleReleaseMeta) IsInternal() bool {
return m.Spec.Internal
}
Loading

0 comments on commit 30724d2

Please sign in to comment.