Skip to content

Commit

Permalink
chore(ci): Helm CRDs refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
squakez committed Aug 13, 2024
1 parent db7148c commit d3efe3c
Show file tree
Hide file tree
Showing 17 changed files with 38,406 additions and 38,525 deletions.
4 changes: 2 additions & 2 deletions .github/actions/build/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
# limitations under the License.
# ---------------------------------------------------------------------------

name: e2e-build
description: 'End-to-End tests for build use-cases'
name: build
description: Build and calculate coverage

inputs:
artifact-name:
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/infra-setting/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ runs:
uses: azure/setup-kubectl@v4
- id: minikube-start
name: Start minikube
uses: medyagh/setup-minikube@latest
uses: medyagh/setup-minikube@v0.0.18
with:
addons: registry
cpus: max
Expand Down
9 changes: 5 additions & 4 deletions .github/workflows/install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,15 +93,16 @@ jobs:
- name: Login to staging container registry
uses: docker/login-action@v3
with:
username: ${{ secrets.TEST_DOCKER_HUB_USERNAME }}
password: ${{ secrets.TEST_DOCKER_HUB_PASSWORD }}
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push OLM bundle
shell: bash
run: |
echo "BUNDLE_IMAGE_NAME=docker.io/testcamelk/camel-k-bundle" >> $GITHUB_ENV
echo "BUNDLE_IMAGE_NAME=ghcr.io/${{ github.actor }}/camel-k-bundle" >> $GITHUB_ENV
echo "Setting bundle image name as as $BUNDLE_IMAGE_NAME which is required by OLM tests"
BUNDLE_IMAGE_NAME=docker.io/testcamelk/camel-k-bundle make bundle-push
BUNDLE_IMAGE_NAME=ghcr.io/${{ github.actor }}/camel-k-bundle make bundle-push
- name: Run tests
shell: bash
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/nightly-latest-runtime.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
name: Nightly check against latest runtime

env:
TEST_CLUSTER: kind
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CAMEL_K_TEST_TIMEOUT_SHORT: 3m
CAMEL_K_TEST_TIMEOUT_MEDIUM: 7m
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/nightly-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
name: Nightly release

env:
TEST_CLUSTER: kind
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NEXUS_DEPLOY_USERNAME: ${{ secrets.NEXUS_USER }}
NEXUS_DEPLOY_PASSWORD: ${{ secrets.NEXUS_PW }}
Expand Down
13 changes: 6 additions & 7 deletions e2e/install/helm/setup_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,12 @@ import (
)

func TestHelmInstallation(t *testing.T) {
containerRegistry, ok := os.LookupEnv("KAMEL_INSTALL_REGISTRY")
g.Expect(ok).To(BeTrue())

WithNewTestNamespace(t, func(ctx context.Context, g *WithT, ns string) {
containerRegistry, ok := os.LookupEnv("KAMEL_INSTALL_REGISTRY")
g.Expect(ok).To(BeTrue())
// Let's make sure no CRD is yet available in the cluster
// as we must make the Helm procedure to install them accordingly
g.Eventually(CRDs(t)).Should(BeNil())
// as we must make the procedure to install them accordingly
g.Eventually(CRDs(t)).Should(BeNil(), "No Camel K CRDs should be previously installed for this test")
operatorID := "helm-ck"
os.Setenv("CAMEL_K_TEST_MAKE_DIR", "../../../")
ExpectExecSucceed(t, g,
Expand All @@ -66,14 +65,14 @@ func TestHelmInstallation(t *testing.T) {
)

g.Eventually(OperatorPod(t, ctx, ns)).ShouldNot(BeNil())
// Check if restricted security context has been applyed
// Check if restricted security context has been applied
operatorPod := OperatorPod(t, ctx, ns)()
g.Expect(operatorPod.Spec.Containers[0].SecurityContext.RunAsNonRoot).To(Equal(kubernetes.DefaultOperatorSecurityContext().RunAsNonRoot))
g.Expect(operatorPod.Spec.Containers[0].SecurityContext.Capabilities).To(Equal(kubernetes.DefaultOperatorSecurityContext().Capabilities))
g.Expect(operatorPod.Spec.Containers[0].SecurityContext.SeccompProfile).To(Equal(kubernetes.DefaultOperatorSecurityContext().SeccompProfile))
g.Expect(operatorPod.Spec.Containers[0].SecurityContext.AllowPrivilegeEscalation).To(Equal(kubernetes.DefaultOperatorSecurityContext().AllowPrivilegeEscalation))

//Test a simple route
// Test a simple route
t.Run("simple route", func(t *testing.T) {
name := RandomizedSuffixName("yaml")
g.Expect(KamelRunWithID(t, ctx, operatorID, ns, "files/yaml.yaml", "--name", name).Execute()).To(Succeed())
Expand Down
Loading

0 comments on commit d3efe3c

Please sign in to comment.