diff --git a/.github/dependabot.yaml b/.github/dependabot.yaml index 0d0d58b6..ded66059 100644 --- a/.github/dependabot.yaml +++ b/.github/dependabot.yaml @@ -1,3 +1,4 @@ +--- version: 2 updates: - package-ecosystem: github-actions diff --git a/.github/workflows/build-image.yaml b/.github/workflows/build-image.yaml index 8c1cf41b..6934ff92 100644 --- a/.github/workflows/build-image.yaml +++ b/.github/workflows/build-image.yaml @@ -1,6 +1,6 @@ --- name: Build docker image -on: +on: # yamllint disable-line rule:truthy push: branches: - main @@ -33,7 +33,7 @@ jobs: id: meta uses: docker/metadata-action@v5.7.0 with: - images: ghcr.io/${{ github.repository_owner }}/${{ env.IMAGE_NAME }} + images: ghcr.io/${{ github.repository_owner }}/${{ env.IMAGE_NAME }} tags: | # (for commits on the main branch only) generate a tag named `latest` type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', 'main') }} diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index d094006a..9d34c263 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -1,3 +1,4 @@ +--- # For most projects, this workflow file will not need changing; you simply need # to commit it to your repository. # @@ -11,11 +12,11 @@ # name: "CodeQL Advanced" -on: +on: # yamllint disable-line rule:truthy push: - branches: [ "main" ] + branches: ["main"] pull_request: - branches: [ "main" ] + branches: ["main"] schedule: - cron: '41 6 * * 1' @@ -43,58 +44,58 @@ jobs: fail-fast: false matrix: include: - - language: actions - build-mode: none - - language: go - build-mode: autobuild - # CodeQL supports the following values keywords for 'language': 'actions', 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'swift' - # Use `c-cpp` to analyze code written in C, C++ or both - # Use 'java-kotlin' to analyze code written in Java, Kotlin or both - # Use 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both - # To learn more about changing the languages that are analyzed or customizing the build mode for your analysis, - # see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning. - # If you are analyzing a compiled language, you can modify the 'build-mode' for that language to customize how - # your codebase is analyzed, see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages + - language: actions + build-mode: none + - language: go + build-mode: autobuild + # CodeQL supports the following values keywords for 'language': 'actions', 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'swift' + # Use `c-cpp` to analyze code written in C, C++ or both + # Use 'java-kotlin' to analyze code written in Java, Kotlin or both + # Use 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both + # To learn more about changing the languages that are analyzed or customizing the build mode for your analysis, + # see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning. + # If you are analyzing a compiled language, you can modify the 'build-mode' for that language to customize how + # your codebase is analyzed, see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages steps: - - name: Checkout repository - uses: actions/checkout@v4 + - name: Checkout repository + uses: actions/checkout@v4 - # Add any setup steps before running the `github/codeql-action/init` action. - # This includes steps like installing compilers or runtimes (`actions/setup-node` - # or others). This is typically only required for manual builds. - # - name: Setup runtime (example) - # uses: actions/setup-example@v1 + # Add any setup steps before running the `github/codeql-action/init` action. + # This includes steps like installing compilers or runtimes (`actions/setup-node` + # or others). This is typically only required for manual builds. + # - name: Setup runtime (example) + # uses: actions/setup-example@v1 - # Initializes the CodeQL tools for scanning. - - name: Initialize CodeQL - uses: github/codeql-action/init@v3 - with: - languages: ${{ matrix.language }} - build-mode: ${{ matrix.build-mode }} - # If you wish to specify custom queries, you can do so here or in a config file. - # By default, queries listed here will override any specified in a config file. - # Prefix the list here with "+" to use these queries and those in the config file. + # Initializes the CodeQL tools for scanning. + - name: Initialize CodeQL + uses: github/codeql-action/init@v3 + with: + languages: ${{ matrix.language }} + build-mode: ${{ matrix.build-mode }} + # If you wish to specify custom queries, you can do so here or in a config file. + # By default, queries listed here will override any specified in a config file. + # Prefix the list here with "+" to use these queries and those in the config file. - # For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs - # queries: security-extended,security-and-quality + # For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs + # queries: security-extended,security-and-quality - # If the analyze step fails for one of the languages you are analyzing with - # "We were unable to automatically build your code", modify the matrix above - # to set the build mode to "manual" for that language. Then modify this step - # to build your code. - # â„šī¸ Command-line programs to run using the OS shell. - # 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun - - if: matrix.build-mode == 'manual' - shell: bash - run: | - echo 'If you are using a "manual" build mode for one or more of the' \ - 'languages you are analyzing, replace this with the commands to build' \ - 'your code, for example:' - echo ' make bootstrap' - echo ' make release' - exit 1 + # If the analyze step fails for one of the languages you are analyzing with + # "We were unable to automatically build your code", modify the matrix above + # to set the build mode to "manual" for that language. Then modify this step + # to build your code. + # â„šī¸ Command-line programs to run using the OS shell. + # 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun + - if: matrix.build-mode == 'manual' + shell: bash + run: | + echo 'If you are using a "manual" build mode for one or more of the' \ + 'languages you are analyzing, replace this with the commands to build' \ + 'your code, for example:' + echo ' make bootstrap' + echo ' make release' + exit 1 - - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v3 - with: - category: "/language:${{matrix.language}}" + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v3 + with: + category: "/language:${{matrix.language}}" diff --git a/.github/workflows/e2e-tests.yaml b/.github/workflows/e2e-tests.yaml index bc409064..ee0c2518 100644 --- a/.github/workflows/e2e-tests.yaml +++ b/.github/workflows/e2e-tests.yaml @@ -1,8 +1,9 @@ +--- # Modified from https://github.com/prometheus-operator/prometheus-operator/blob/main/.github/workflows/e2e-feature-gated.yaml name: e2e-tests permissions: contents: read -on: +on: # yamllint disable-line rule:truthy push: branches: - main @@ -20,41 +21,41 @@ jobs: name: Against netbox version 3.7.8 runs-on: ubuntu-latest steps: - - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - - uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0 - with: - go-version: 1.24.4 - - name: Import environment variables from file - run: | - cat ".github/env" >> "$GITHUB_ENV" - - name: Run e2e tests - run: | - make test-e2e-3.7.8 + - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 + - uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0 + with: + go-version: 1.24.4 + - name: Import environment variables from file + run: | + cat ".github/env" >> "$GITHUB_ENV" + - name: Run e2e tests + run: | + make test-e2e-3.7.8 e2e-tests-4-0-11: name: Against netbox version 4.0.11 runs-on: ubuntu-latest steps: - - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - - uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0 - with: - go-version: 1.24.4 - - name: Import environment variables from file - run: | - cat ".github/env" >> "$GITHUB_ENV" - - name: Run e2e tests - run: | - make test-e2e-4.0.11 + - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 + - uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0 + with: + go-version: 1.24.4 + - name: Import environment variables from file + run: | + cat ".github/env" >> "$GITHUB_ENV" + - name: Run e2e tests + run: | + make test-e2e-4.0.11 e2e-tests-4-1-11: name: Against netbox version 4.1.11 runs-on: ubuntu-latest steps: - - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - - uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0 - with: - go-version: 1.24.4 - - name: Import environment variables from file - run: | - cat ".github/env" >> "$GITHUB_ENV" - - name: Run e2e tests - run: | - make test-e2e-4.1.11 + - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 + - uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0 + with: + go-version: 1.24.4 + - name: Import environment variables from file + run: | + cat ".github/env" >> "$GITHUB_ENV" + - name: Run e2e tests + run: |- + make test-e2e-4.1.11 diff --git a/.github/workflows/govuln.yaml b/.github/workflows/govuln.yaml index d8b4a9d9..c868fb66 100644 --- a/.github/workflows/govuln.yaml +++ b/.github/workflows/govuln.yaml @@ -1,6 +1,6 @@ --- name: Go Vulnerability Checker -on: +on: # yamllint disable-line rule:truthy push: branches: - main @@ -12,11 +12,11 @@ jobs: test: runs-on: ubuntu-latest steps: - - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - - uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0 + - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 + - uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0 with: go-version: 1.24.4 - - run: | + - run: |- set -euo pipefail make vulncheck diff --git a/.github/workflows/integration-test.yaml b/.github/workflows/integration-test.yaml index b4c7c0c1..ccaff2b0 100644 --- a/.github/workflows/integration-test.yaml +++ b/.github/workflows/integration-test.yaml @@ -1,6 +1,6 @@ --- name: Integration Tests -on: +on: # yamllint disable-line rule:truthy push: branches: - main @@ -13,11 +13,11 @@ jobs: test: runs-on: ubuntu-latest steps: - - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - - uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0 + - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 + - uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0 with: go-version: 1.24.4 - name: tests - run: | + run: |- go install github.com/onsi/ginkgo/v2/ginkgo make integration-test diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index ef03e85c..9941781b 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -1,6 +1,6 @@ --- name: Static analysis -on: +on: # yamllint disable-line rule:truthy push: branches: - main @@ -12,12 +12,12 @@ jobs: go-and-crds: runs-on: ubuntu-latest steps: - - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - - uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0 + - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 + - uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0 with: go-version: 1.24.4 - name: golangci-lint - uses: golangci/golangci-lint-action@4afd733a84b1f43292c63897423277bb7f4313a9 # v8.0.0 + uses: golangci/golangci-lint-action@4afd733a84b1f43292c63897423277bb7f4313a9 # v8.0.0 with: version: v2.1.2 args: --config tools/.golangci.yaml @@ -61,8 +61,14 @@ jobs: codespell: runs-on: ubuntu-latest steps: - - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 + - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - name: Run codespell uses: codespell-project/actions-codespell@v2 with: skip: '*.svg' + yamllint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 + - name: 'Yamllint' + uses: karancode/yamllint-github-action@master diff --git a/.github/workflows/unit-test.yaml b/.github/workflows/unit-test.yaml index 3ea95705..7cb8e48b 100644 --- a/.github/workflows/unit-test.yaml +++ b/.github/workflows/unit-test.yaml @@ -1,6 +1,6 @@ --- name: Unit tests -on: +on: # yamllint disable-line rule:truthy push: branches: - main @@ -13,10 +13,10 @@ jobs: test: runs-on: ubuntu-latest steps: - - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - - uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0 + - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 + - uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0 with: go-version: 1.24.4 - name: tests - run: | + run: |- make test diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 00000000..1a3fa183 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,33 @@ +# todo: run in CI. similar to https://scm.swisscom.com/5gdmc/misc/ci-templates/-/blob/main/stage_lint/jobs/pre-commit.yaml?ref_type=heads + +--- +repos: + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.5.0 + hooks: + - id: check-yaml + args: [--allow-multiple-documents] + - id: end-of-file-fixer + - id: mixed-line-ending + - id: trailing-whitespace + - repo: https://github.com/Lucas-C/pre-commit-hooks + rev: v1.5.5 + hooks: + - id: remove-crlf + - repo: https://github.com/google/yamlfmt + rev: v0.17.0 + hooks: + - id: yamlfmt + language: system + exclude: ^config/crd|^config/rbac|^config/manager|^config/default|^config/prometheus|^config/network-policy + - repo: "https://github.com/adrienverge/yamllint" + rev: v1.35.1 + hooks: + - id: yamllint + exclude: ^config/crd|^config/rbac|^config/manager|^config/default|^config/prometheus|^config/network-policy + - repo: https://github.com/codespell-project/codespell + rev: v2.1.0 + hooks: + - id: codespell + files: ^.*\.(py|c|h|md|rst|yml)$ + args: [--ignore-words-list, "swisscom,thor,cpbroker", "--skip", "*.svg", "--write-changes"] diff --git a/.yamlfmt b/.yamlfmt new file mode 100644 index 00000000..4883daf4 --- /dev/null +++ b/.yamlfmt @@ -0,0 +1,7 @@ +formatter: + type: basic + include_document_start: true + pad_line_comments: 2 + trim_trailing_whitespace: true + retain_line_breaks_single: true + eof_newline: true diff --git a/.yamllint b/.yamllint new file mode 100644 index 00000000..5c3e8c04 --- /dev/null +++ b/.yamllint @@ -0,0 +1,42 @@ +--- +# Don't edit this file without consulting the team! +yaml-files: + - '*.yaml' + - '*.yml' + - '.yamllint' +ignore: | + config/crd/* + config/rbac/* + config/manager/* + config/default/* + config/prometheus/* + config/network-policy/* +rules: + # anchors: enable + braces: enable + brackets: enable + colons: enable + commas: enable + comments: + level: warning + comments-indentation: + level: warning + document-end: disable + document-start: enable + empty-lines: disable + empty-values: disable + float-values: disable + hyphens: enable + indentation: + indent-sequences: whatever + spaces: 2 + key-duplicates: enable + key-ordering: disable + line-length: disable + new-line-at-end-of-file: enable + new-lines: enable + octal-values: disable + quoted-strings: disable + trailing-spaces: enable + truthy: + level: warning diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 0c7fdc22..426d7177 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,12 +1,12 @@ # How to contribute -NetBox Operator is Apache 2.0 licensed and accepts contributions via GitHub pull requests. +NetBox Operator is Apache 2.0 licensed and accepts contributions via GitHub pull requests. This document outlines the basics of contributing to NetBox Operator. ## Running and developing NetBox-Operator locally -There are several ways of deploying the NetBox operator for development. +There are several ways of deploying the NetBox operator for development. ### Running both NetBox Operator and NetBox on a local kind cluster diff --git a/ParentPrefixSelectorGuide.md b/ParentPrefixSelectorGuide.md index 3cfd4c45..47af0674 100644 --- a/ParentPrefixSelectorGuide.md +++ b/ParentPrefixSelectorGuide.md @@ -25,7 +25,7 @@ spec: comments: "your comments" preserveInNetbox: true prefixLength: "/31" - parentPrefixSelector: + parentPrefixSelector: tenant: "MY_TENANT" site: "DM-Buffalo" family: "IPv4" diff --git a/config/samples/kustomization.yaml b/config/samples/kustomization.yaml index d3f1a9ee..674e3bc8 100644 --- a/config/samples/kustomization.yaml +++ b/config/samples/kustomization.yaml @@ -1,11 +1,12 @@ +--- ## Append samples of your project ## resources: -- netbox_v1_ipaddress.yaml -- netbox_v1_ipaddressclaim.yaml -- netbox_v1_prefix.yaml -- netbox_v1_prefixclaim.yaml -- netbox_v1_prefixclaim_parentprefixselector_bool_int.yaml -- netbox_v1_prefixclaim_parentprefixselector.yaml -- netbox_v1_iprangeclaim.yaml -- netbox_v1_iprange.yaml -#+kubebuilder:scaffold:manifestskustomizesamples + - netbox_v1_ipaddress.yaml + - netbox_v1_ipaddressclaim.yaml + - netbox_v1_prefix.yaml + - netbox_v1_prefixclaim.yaml + - netbox_v1_prefixclaim_parentprefixselector_bool_int.yaml + - netbox_v1_prefixclaim_parentprefixselector.yaml + - netbox_v1_iprangeclaim.yaml + - netbox_v1_iprange.yaml + # +kubebuilder:scaffold:manifestskustomizesamples diff --git a/config/samples/netbox_v1_ipaddress.yaml b/config/samples/netbox_v1_ipaddress.yaml index 3a5935c1..4937daee 100644 --- a/config/samples/netbox_v1_ipaddress.yaml +++ b/config/samples/netbox_v1_ipaddress.yaml @@ -1,3 +1,4 @@ +--- apiVersion: netbox.dev/v1 kind: IpAddress metadata: diff --git a/config/samples/netbox_v1_ipaddressclaim.yaml b/config/samples/netbox_v1_ipaddressclaim.yaml index b067c558..8bfdee0b 100644 --- a/config/samples/netbox_v1_ipaddressclaim.yaml +++ b/config/samples/netbox_v1_ipaddressclaim.yaml @@ -1,3 +1,4 @@ +--- apiVersion: netbox.dev/v1 kind: IpAddressClaim metadata: diff --git a/config/samples/netbox_v1_iprange.yaml b/config/samples/netbox_v1_iprange.yaml index 27142d60..93ace170 100644 --- a/config/samples/netbox_v1_iprange.yaml +++ b/config/samples/netbox_v1_iprange.yaml @@ -1,3 +1,4 @@ +--- apiVersion: netbox.dev/v1 kind: IpRange metadata: diff --git a/config/samples/netbox_v1_iprangeclaim.yaml b/config/samples/netbox_v1_iprangeclaim.yaml index 75ee44ab..c6e477bd 100644 --- a/config/samples/netbox_v1_iprangeclaim.yaml +++ b/config/samples/netbox_v1_iprangeclaim.yaml @@ -1,3 +1,4 @@ +--- apiVersion: netbox.dev/v1 kind: IpRangeClaim metadata: diff --git a/config/samples/netbox_v1_prefix.yaml b/config/samples/netbox_v1_prefix.yaml index be6e3fa6..2deecff5 100644 --- a/config/samples/netbox_v1_prefix.yaml +++ b/config/samples/netbox_v1_prefix.yaml @@ -1,3 +1,4 @@ +--- apiVersion: netbox.dev/v1 kind: Prefix metadata: diff --git a/config/samples/netbox_v1_prefixclaim.yaml b/config/samples/netbox_v1_prefixclaim.yaml index b23712a4..e8534426 100644 --- a/config/samples/netbox_v1_prefixclaim.yaml +++ b/config/samples/netbox_v1_prefixclaim.yaml @@ -1,3 +1,4 @@ +--- apiVersion: netbox.dev/v1 kind: PrefixClaim metadata: diff --git a/config/samples/netbox_v1_prefixclaim_parentprefixselector.yaml b/config/samples/netbox_v1_prefixclaim_parentprefixselector.yaml index 8a9daea5..34016354 100644 --- a/config/samples/netbox_v1_prefixclaim_parentprefixselector.yaml +++ b/config/samples/netbox_v1_prefixclaim_parentprefixselector.yaml @@ -1,3 +1,4 @@ +--- apiVersion: netbox.dev/v1 kind: PrefixClaim metadata: diff --git a/config/samples/netbox_v1_prefixclaim_parentprefixselector_bool_int.yaml b/config/samples/netbox_v1_prefixclaim_parentprefixselector_bool_int.yaml index 2f954ab8..7ee833ca 100644 --- a/config/samples/netbox_v1_prefixclaim_parentprefixselector_bool_int.yaml +++ b/config/samples/netbox_v1_prefixclaim_parentprefixselector_bool_int.yaml @@ -1,3 +1,4 @@ +--- apiVersion: netbox.dev/v1 kind: PrefixClaim metadata: diff --git a/docs/examples/example1-getting-started/dynamic_prefixclaim-large-font.drawio.svg b/docs/examples/example1-getting-started/dynamic_prefixclaim-large-font.drawio.svg index 56e2c3d2..eb94ee83 100644 --- a/docs/examples/example1-getting-started/dynamic_prefixclaim-large-font.drawio.svg +++ b/docs/examples/example1-getting-started/dynamic_prefixclaim-large-font.drawio.svg @@ -529,4 +529,4 @@ - \ No newline at end of file + diff --git a/docs/examples/example1-getting-started/prefixclaim-dynamic.drawio.svg b/docs/examples/example1-getting-started/prefixclaim-dynamic.drawio.svg index 00f401cd..2d652741 100644 --- a/docs/examples/example1-getting-started/prefixclaim-dynamic.drawio.svg +++ b/docs/examples/example1-getting-started/prefixclaim-dynamic.drawio.svg @@ -466,4 +466,4 @@ - \ No newline at end of file + diff --git a/docs/examples/example1-getting-started/prefixclaim-dynamic.yaml b/docs/examples/example1-getting-started/prefixclaim-dynamic.yaml index 4a6c0d13..79d35cea 100644 --- a/docs/examples/example1-getting-started/prefixclaim-dynamic.yaml +++ b/docs/examples/example1-getting-started/prefixclaim-dynamic.yaml @@ -1,3 +1,4 @@ +--- apiVersion: netbox.dev/v1 kind: PrefixClaim metadata: diff --git a/docs/examples/example1-getting-started/prefixclaim-simple.drawio.svg b/docs/examples/example1-getting-started/prefixclaim-simple.drawio.svg index 9e28233a..455918e5 100644 --- a/docs/examples/example1-getting-started/prefixclaim-simple.drawio.svg +++ b/docs/examples/example1-getting-started/prefixclaim-simple.drawio.svg @@ -460,4 +460,4 @@ - \ No newline at end of file + diff --git a/docs/examples/example1-getting-started/prefixclaim-simple.yaml b/docs/examples/example1-getting-started/prefixclaim-simple.yaml index 483a0c3d..8c1aa937 100644 --- a/docs/examples/example1-getting-started/prefixclaim-simple.yaml +++ b/docs/examples/example1-getting-started/prefixclaim-simple.yaml @@ -1,3 +1,4 @@ +--- apiVersion: netbox.dev/v1 kind: PrefixClaim metadata: diff --git a/docs/examples/example1-getting-started/simple_prefixclaim-large-font.drawio.svg b/docs/examples/example1-getting-started/simple_prefixclaim-large-font.drawio.svg index d89c2dbe..d70174bd 100644 --- a/docs/examples/example1-getting-started/simple_prefixclaim-large-font.drawio.svg +++ b/docs/examples/example1-getting-started/simple_prefixclaim-large-font.drawio.svg @@ -482,4 +482,4 @@ - \ No newline at end of file + diff --git a/docs/examples/example2-load-balancer-ip/load-balancer-ip-pool-netbox-large-font.drawio.svg b/docs/examples/example2-load-balancer-ip/load-balancer-ip-pool-netbox-large-font.drawio.svg index ad17f4dc..25f10cb9 100644 --- a/docs/examples/example2-load-balancer-ip/load-balancer-ip-pool-netbox-large-font.drawio.svg +++ b/docs/examples/example2-load-balancer-ip/load-balancer-ip-pool-netbox-large-font.drawio.svg @@ -1,4 +1,4 @@ -
k8s cluster
k8s cluster
user namespace
user namespace
kro namespace
kro namespace
kro
kro
PrefixClaim CR
status:
  prefix: 2.0.0.0/28
PrefixClaim CR...
MetalLBIPAddress-
PoolNetBox CR
MetalLBIPAddress-...
namespace metallb-system
namespace metallb-system
IPAddressPool CR
spec: 
 ipaddresspools:
  - 2.0.0.0/28
IPAddressPool CR...
consumer
consumer
User
w/ kubectl
User...
GitOps
w/ Argo or Flux
GitOps...
and/or
and/or
create
create
NetBox REST API
NetBox REST API
namespace netbox-operator
namespace netbox-operator
create/update/delete
create/update/delete
get available prefixes
get available prefixes
NetBox Operator
NetBox Operator
Parent
Prefix
Parent...
Claimed Prefix
Claimed Prefix
Matching Prefixes
Matching Prefixes
get matching prefixes
get matching prefixes
Prefix CR
Prefix CR
create
create
reconcile
reconcile
reconcile
reconcile
create
create
read status
read status
create
create
reconcile
reconcile
Text is not SVG - cannot display
\ No newline at end of file +
k8s cluster
k8s cluster
user namespace
user namespace
kro namespace
kro namespace
kro
kro
PrefixClaim CR
status:
  prefix: 2.0.0.0/28
PrefixClaim CR...
MetalLBIPAddress-
PoolNetBox CR
MetalLBIPAddress-...
namespace metallb-system
namespace metallb-system
IPAddressPool CR
spec: 
 ipaddresspools:
  - 2.0.0.0/28
IPAddressPool CR...
consumer
consumer
User
w/ kubectl
User...
GitOps
w/ Argo or Flux
GitOps...
and/or
and/or
create
create
NetBox REST API
NetBox REST API
namespace netbox-operator
namespace netbox-operator
create/update/delete
create/update/delete
get available prefixes
get available prefixes
NetBox Operator
NetBox Operator
Parent
Prefix
Parent...
Claimed Prefix
Claimed Prefix
Matching Prefixes
Matching Prefixes
get matching prefixes
get matching prefixes
Prefix CR
Prefix CR
create
create
reconcile
reconcile
reconcile
reconcile
create
create
read status
read status
create
create
reconcile
reconcile
Text is not SVG - cannot display
diff --git a/docs/examples/example2-load-balancer-ip/load-balancer-ip-pool-netbox.yaml b/docs/examples/example2-load-balancer-ip/load-balancer-ip-pool-netbox.yaml index bc84c6ac..56590d7b 100644 --- a/docs/examples/example2-load-balancer-ip/load-balancer-ip-pool-netbox.yaml +++ b/docs/examples/example2-load-balancer-ip/load-balancer-ip-pool-netbox.yaml @@ -1,3 +1,4 @@ +--- apiVersion: kro.run/v1alpha1 kind: ResourceGraphDefinition metadata: diff --git a/docs/examples/example2-load-balancer-ip/metallb-ipaddresspool-netbox.drawio.svg b/docs/examples/example2-load-balancer-ip/metallb-ipaddresspool-netbox.drawio.svg index 5d8997e1..3cbc2e0d 100644 --- a/docs/examples/example2-load-balancer-ip/metallb-ipaddresspool-netbox.drawio.svg +++ b/docs/examples/example2-load-balancer-ip/metallb-ipaddresspool-netbox.drawio.svg @@ -650,4 +650,4 @@ - \ No newline at end of file + diff --git a/docs/examples/example2-load-balancer-ip/sample-deployment.yaml b/docs/examples/example2-load-balancer-ip/sample-deployment.yaml index 51ea0e2e..1395af8c 100644 --- a/docs/examples/example2-load-balancer-ip/sample-deployment.yaml +++ b/docs/examples/example2-load-balancer-ip/sample-deployment.yaml @@ -20,11 +20,11 @@ spec: run: my-nginx spec: containers: - - name: my-nginx - image: nginx - imagePullPolicy: Never - ports: - - containerPort: 80 + - name: my-nginx + image: nginx + imagePullPolicy: Never + ports: + - containerPort: 80 --- apiVersion: v1 kind: Service @@ -38,7 +38,7 @@ metadata: spec: type: LoadBalancer ports: - - port: 80 - protocol: TCP + - port: 80 + protocol: TCP selector: run: my-nginx diff --git a/docs/examples/example2-load-balancer-ip/zurich-pool.yaml b/docs/examples/example2-load-balancer-ip/zurich-pool.yaml index 0178ee87..01fbe3a3 100644 --- a/docs/examples/example2-load-balancer-ip/zurich-pool.yaml +++ b/docs/examples/example2-load-balancer-ip/zurich-pool.yaml @@ -1,10 +1,11 @@ +--- apiVersion: kro.run/v1alpha1 kind: LoadBalancerIPPoolNetBox metadata: name: zurich-pool spec: name: zurich-pool - tenant: "MY_TENANT" # Use the `name` value instead of the `slug` value + tenant: "MY_TENANT" # Use the `name` value instead of the `slug` value prefixLength: "/30" parentPrefixSelector: environment: prod diff --git a/docs/examples/example3-restoration/restoration-large-font.drawio.svg b/docs/examples/example3-restoration/restoration-large-font.drawio.svg index 2e5face7..848088cd 100644 --- a/docs/examples/example3-restoration/restoration-large-font.drawio.svg +++ b/docs/examples/example3-restoration/restoration-large-font.drawio.svg @@ -1,4 +1,4 @@ -
k8s cluster kind-london
k8s cluster kind-london
namespace default
namespace default
namespace "advanced"
namespace "advanced"
namespace "netbox-operator"
namespace "netbox-oper...
reconcile
reconcile
create & reconcile
create & reconcile
NetBox Operator
NetBox Operator
create
create
User
w/ kubectl
User...
NetBox REST API
NetBox REST API
2.0.0.0/32
2.0.0.0/32
2.0.0.1/32
2.0.0.1/32
2.0.0.2/32
2.0.0.2/32
restore by looking up
restoration hash
restore by looking up...
PrefixClaim
PrefixClaim
ownerReference
ownerReference
Prefix
Prefix
PrefixClaim
PrefixClaim
ownerReference
ownerReference
Prefix
Prefix
PrefixClaim
PrefixClaim
ownerReference
ownerReference
Prefix
Prefix
Text is not SVG - cannot display
\ No newline at end of file +
k8s cluster kind-london
k8s cluster kind-london
namespace default
namespace default
namespace "advanced"
namespace "advanced"
namespace "netbox-operator"
namespace "netbox-oper...
reconcile
reconcile
create & reconcile
create & reconcile
NetBox Operator
NetBox Operator
create
create
User
w/ kubectl
User...
NetBox REST API
NetBox REST API
2.0.0.0/32
2.0.0.0/32
2.0.0.1/32
2.0.0.1/32
2.0.0.2/32
2.0.0.2/32
restore by looking up
restoration hash
restore by looking up...
PrefixClaim
PrefixClaim
ownerReference
ownerReference
Prefix
Prefix
PrefixClaim
PrefixClaim
ownerReference
ownerReference
Prefix
Prefix
PrefixClaim
PrefixClaim
ownerReference
ownerReference
Prefix
Prefix
Text is not SVG - cannot display
diff --git a/docs/examples/example3-restoration/restoration.drawio.svg b/docs/examples/example3-restoration/restoration.drawio.svg index 4bcdca6c..61ed40e5 100644 --- a/docs/examples/example3-restoration/restoration.drawio.svg +++ b/docs/examples/example3-restoration/restoration.drawio.svg @@ -1,4 +1,4 @@ -
k8s cluster kind-london
k8s cluster kind-london
namespace default
namespace default
namespace "advanced"
namespace "advanced"
namespace "netbox-operator"
namespace "netbox-operator"
reconcile
reconcile
create & reconcile
create & reconcile
netbox-operator
netbox-operator
create
create
User
w/ kubectl
User...
NetBox REST API
NetBox REST API
Prefix 2.0.0.0/32
Prefix 2.0.0.0/32
Prefix 2.0.0.1/32
Prefix 2.0.0.1/32
Prefix 2.0.0.2/32
Prefix 2.0.0.2/32
restore by looking up
restoration hash
restore by looking up...
kind: PrefixClaim
spec:
  parentPrefixSelector: 
     tenant: "Dunder-Mifflin"
  prefixLength: /32
kind: PrefixClaim...
ownerReference
ownerReference
kind: Prefix
spec:
  prefix: 2.0.0.0/32
kind: Prefix...
kind: PrefixClaim
spec:
  parentPrefixSelector: 
     tenant: "Dunder-Mifflin"
  prefixLength: /32
kind: PrefixClaim...
ownerReference
ownerReference
kind: Prefix
spec:
  prefix: 2.0.0.0/32
kind: Prefix...
kind: PrefixClaim
spec:
  parentPrefixSelector: 
     tenant: "Dunder-Mifflin"
  prefixLength: /32
kind: PrefixClaim...
ownerReference
ownerReference
kind: Prefix
spec:
  prefix: 2.0.0.0/32
kind: Prefix...
Text is not SVG - cannot display
\ No newline at end of file +
k8s cluster kind-london
k8s cluster kind-london
namespace default
namespace default
namespace "advanced"
namespace "advanced"
namespace "netbox-operator"
namespace "netbox-operator"
reconcile
reconcile
create & reconcile
create & reconcile
netbox-operator
netbox-operator
create
create
User
w/ kubectl
User...
NetBox REST API
NetBox REST API
Prefix 2.0.0.0/32
Prefix 2.0.0.0/32
Prefix 2.0.0.1/32
Prefix 2.0.0.1/32
Prefix 2.0.0.2/32
Prefix 2.0.0.2/32
restore by looking up
restoration hash
restore by looking up...
kind: PrefixClaim
spec:
  parentPrefixSelector: 
     tenant: "Dunder-Mifflin"
  prefixLength: /32
kind: PrefixClaim...
ownerReference
ownerReference
kind: Prefix
spec:
  prefix: 2.0.0.0/32
kind: Prefix...
kind: PrefixClaim
spec:
  parentPrefixSelector: 
     tenant: "Dunder-Mifflin"
  prefixLength: /32
kind: PrefixClaim...
ownerReference
ownerReference
kind: Prefix
spec:
  prefix: 2.0.0.0/32
kind: Prefix...
kind: PrefixClaim
spec:
  parentPrefixSelector: 
     tenant: "Dunder-Mifflin"
  prefixLength: /32
kind: PrefixClaim...
ownerReference
ownerReference
kind: Prefix
spec:
  prefix: 2.0.0.0/32
kind: Prefix...
Text is not SVG - cannot display
diff --git a/docs/examples/example4-exhaustion/exhaustion-1-starting-point.drawio.svg b/docs/examples/example4-exhaustion/exhaustion-1-starting-point.drawio.svg index 94e9ea20..3a994c6b 100644 --- a/docs/examples/example4-exhaustion/exhaustion-1-starting-point.drawio.svg +++ b/docs/examples/example4-exhaustion/exhaustion-1-starting-point.drawio.svg @@ -1,4 +1,4 @@ -
k8s cluster kind-london
k8s cluster kind-london
namespace default
namespace default
namespace "advanced"
namespace "advanced"
namespace "netbox-operator"
namespace "netbox-operator"
netbox-operator
netbox-operator
kind: PrefixClaim
spec:
  parentPrefixSelector:
    environment: prod  prefixLength: /25
kind: PrefixClaim...
create
create
User
w/ kubectl
User...
NetBox REST API
NetBox REST API
Prefix 1.122.0.0/24
environment: prod
Usage: 0%
Prefix 1.122.0.0/24...
kind: PrefixClaim
spec:
  parentPrefixSelector:
    environment: prod  prefixLength: /25
kind: PrefixClaim...
kind: PrefixClaim
spec:
  parentPrefixSelector:
    environment: prod  prefixLength: /25
kind: PrefixClaim...
Text is not SVG - cannot display
\ No newline at end of file +
k8s cluster kind-london
k8s cluster kind-london
namespace default
namespace default
namespace "advanced"
namespace "advanced"
namespace "netbox-operator"
namespace "netbox-operator"
netbox-operator
netbox-operator
kind: PrefixClaim
spec:
  parentPrefixSelector:
    environment: prod  prefixLength: /25
kind: PrefixClaim...
create
create
User
w/ kubectl
User...
NetBox REST API
NetBox REST API
Prefix 1.122.0.0/24
environment: prod
Usage: 0%
Prefix 1.122.0.0/24...
kind: PrefixClaim
spec:
  parentPrefixSelector:
    environment: prod  prefixLength: /25
kind: PrefixClaim...
kind: PrefixClaim
spec:
  parentPrefixSelector:
    environment: prod  prefixLength: /25
kind: PrefixClaim...
Text is not SVG - cannot display
diff --git a/docs/examples/example4-exhaustion/exhaustion-2-prefix-exhausted.drawio.svg b/docs/examples/example4-exhaustion/exhaustion-2-prefix-exhausted.drawio.svg index a2377d28..07ba10d9 100644 --- a/docs/examples/example4-exhaustion/exhaustion-2-prefix-exhausted.drawio.svg +++ b/docs/examples/example4-exhaustion/exhaustion-2-prefix-exhausted.drawio.svg @@ -1,4 +1,4 @@ -
k8s cluster kind-london
k8s cluster kind-london
namespace default
namespace default
namespace "advanced"
namespace "advanced"
namespace "netbox-operator"
namespace "netbox-operator"
create & reconcile
create & reconcile
netbox-operator
netbox-operator
kind: PrefixClaim
spec:
  parentPrefixSelector:
    environment: prod  prefixLength: /25
kind: PrefixClaim...
create
create
User
w/ kubectl
User...
reconcile
reconcile
ownerReference
ownerReference
kind: Prefix
spec:
  prefix: 1.122.0.0/25
kind: Prefix...
NetBox REST API
NetBox REST API
get available prefixes
get available prefixes
Prefix 1.122.0.0/24
environment: prod
Usage: 100%
Prefix 1.122.0.0/24...
Prefix 1.122.0.0/25
Prefix 1.122.0.0/25
Prefix 1.122.0.128/25
Prefix 1.122.0.128/25
create/update/delete
create/update/delete
kind: PrefixClaim
spec:
  parentPrefixSelector:
    environment: prod  prefixLength: /25
kind: PrefixClaim...
reconcile
reconcile
ownerReference
ownerReference
kind: Prefix
spec:
  prefix: 1.122.0.128/25
kind: Prefix...
kind: PrefixClaim
spec:
  parentPrefixSelector:
    environment: prod  prefixLength: /25
kind: PrefixClaim...
reconcile
reconcile
Text is not SVG - cannot display
\ No newline at end of file +
k8s cluster kind-london
k8s cluster kind-london
namespace default
namespace default
namespace "advanced"
namespace "advanced"
namespace "netbox-operator"
namespace "netbox-operator"
create & reconcile
create & reconcile
netbox-operator
netbox-operator
kind: PrefixClaim
spec:
  parentPrefixSelector:
    environment: prod  prefixLength: /25
kind: PrefixClaim...
create
create
User
w/ kubectl
User...
reconcile
reconcile
ownerReference
ownerReference
kind: Prefix
spec:
  prefix: 1.122.0.0/25
kind: Prefix...
NetBox REST API
NetBox REST API
get available prefixes
get available prefixes
Prefix 1.122.0.0/24
environment: prod
Usage: 100%
Prefix 1.122.0.0/24...
Prefix 1.122.0.0/25
Prefix 1.122.0.0/25
Prefix 1.122.0.128/25
Prefix 1.122.0.128/25
create/update/delete
create/update/delete
kind: PrefixClaim
spec:
  parentPrefixSelector:
    environment: prod  prefixLength: /25
kind: PrefixClaim...
reconcile
reconcile
ownerReference
ownerReference
kind: Prefix
spec:
  prefix: 1.122.0.128/25
kind: Prefix...
kind: PrefixClaim
spec:
  parentPrefixSelector:
    environment: prod  prefixLength: /25
kind: PrefixClaim...
reconcile
reconcile
Text is not SVG - cannot display
diff --git a/docs/examples/example4-exhaustion/exhaustion-3-after-fix.drawio.svg b/docs/examples/example4-exhaustion/exhaustion-3-after-fix.drawio.svg index 13dd249e..f2ae7e00 100644 --- a/docs/examples/example4-exhaustion/exhaustion-3-after-fix.drawio.svg +++ b/docs/examples/example4-exhaustion/exhaustion-3-after-fix.drawio.svg @@ -1,4 +1,4 @@ -
k8s cluster kind-london
k8s cluster kind-london
namespace default
namespace default
namespace "advanced"
namespace "advanced"
namespace "netbox-operator"
namespace "netbox-operator"
create & reconcile
create & reconcile
netbox-operator
netbox-operator
kind: PrefixClaim
spec:
  parentPrefixSelector:
    environment: prod  prefixLength: /25
kind: PrefixClaim...
create
create
User
w/ kubectl
User...
reconcile
reconcile
ownerReference
ownerReference
kind: Prefix
spec:
  prefix: 1.122.0.0/25
kind: Prefix...
NetBox REST API
NetBox REST API
Prefix 1.122.0.0/24
environment: prod
Usage: 100%
Prefix 1.122.0.0/24...
Prefix 1.122.0.0/25
Prefix 1.122.0.0/25
Prefix 1.122.0.128/25
Prefix 1.122.0.128/25
kind: PrefixClaim
spec:
  parentPrefixSelector:
    environment: prod  prefixLength: /25
kind: PrefixClaim...
reconcile
reconcile
ownerReference
ownerReference
kind: Prefix
spec:
  prefix: 1.122.0.128/25
kind: Prefix...
create & reconcile
create & reconcile
kind: PrefixClaim
spec:
  parentPrefixSelector:
    environment: prod  prefixLength: /25
kind: PrefixClaim...
reconcile
reconcile
ownerReference
ownerReference
kind: Prefix
spec:
  prefix: 1.100.0.0/25
kind: Prefix...
Prefix 1.100.0.0/24
environment: prod
Usage: 50%
Prefix 1.100.0.0/24...
Prefix 1.100.0.0/25
Prefix 1.100.0.0/25
create/update/delete
create/update/delete
get available prefixes
get available prefixes
Text is not SVG - cannot display
\ No newline at end of file +
k8s cluster kind-london
k8s cluster kind-london
namespace default
namespace default
namespace "advanced"
namespace "advanced"
namespace "netbox-operator"
namespace "netbox-operator"
create & reconcile
create & reconcile
netbox-operator
netbox-operator
kind: PrefixClaim
spec:
  parentPrefixSelector:
    environment: prod  prefixLength: /25
kind: PrefixClaim...
create
create
User
w/ kubectl
User...
reconcile
reconcile
ownerReference
ownerReference
kind: Prefix
spec:
  prefix: 1.122.0.0/25
kind: Prefix...
NetBox REST API
NetBox REST API
Prefix 1.122.0.0/24
environment: prod
Usage: 100%
Prefix 1.122.0.0/24...
Prefix 1.122.0.0/25
Prefix 1.122.0.0/25
Prefix 1.122.0.128/25
Prefix 1.122.0.128/25
kind: PrefixClaim
spec:
  parentPrefixSelector:
    environment: prod  prefixLength: /25
kind: PrefixClaim...
reconcile
reconcile
ownerReference
ownerReference
kind: Prefix
spec:
  prefix: 1.122.0.128/25
kind: Prefix...
create & reconcile
create & reconcile
kind: PrefixClaim
spec:
  parentPrefixSelector:
    environment: prod  prefixLength: /25
kind: PrefixClaim...
reconcile
reconcile
ownerReference
ownerReference
kind: Prefix
spec:
  prefix: 1.100.0.0/25
kind: Prefix...
Prefix 1.100.0.0/24
environment: prod
Usage: 50%
Prefix 1.100.0.0/24...
Prefix 1.100.0.0/25
Prefix 1.100.0.0/25
create/update/delete
create/update/delete
get available prefixes
get available prefixes
Text is not SVG - cannot display
diff --git a/docs/examples/example5-multicluster/README.md b/docs/examples/example5-multicluster/README.md index 7ea53c64..79459482 100644 --- a/docs/examples/example5-multicluster/README.md +++ b/docs/examples/example5-multicluster/README.md @@ -44,4 +44,4 @@ and kubectl get --context kind-zurich pxc -A ``` -![Example 2](multicluster.drawio.svg) \ No newline at end of file +![Example 2](multicluster.drawio.svg) diff --git a/docs/examples/example5-multicluster/cluster-cfg.yaml b/docs/examples/example5-multicluster/cluster-cfg.yaml index 0dafb9be..e48448f6 100644 --- a/docs/examples/example5-multicluster/cluster-cfg.yaml +++ b/docs/examples/example5-multicluster/cluster-cfg.yaml @@ -1,14 +1,15 @@ +--- apiVersion: kind.x-k8s.io/v1alpha4 kind: Cluster networking: - serviceSubnet: "10.96.0.0/20" # until 10.96.15.255 + serviceSubnet: "10.96.0.0/20" # until 10.96.15.255 apiServerAddress: "127.0.0.1" apiServerPort: 6443 nodes: -- role: control-plane - kubeadmConfigPatches: - - | - kind: InitConfiguration - nodeRegistration: - kubeletExtraArgs: - node-labels: "ingress-ready=true" + - role: control-plane + kubeadmConfigPatches: + - |- + kind: InitConfiguration + nodeRegistration: + kubeletExtraArgs: + node-labels: "ingress-ready=true" diff --git a/docs/examples/example5-multicluster/demo-setup.drawio.svg b/docs/examples/example5-multicluster/demo-setup.drawio.svg index 0c4fe028..0e2fe831 100644 --- a/docs/examples/example5-multicluster/demo-setup.drawio.svg +++ b/docs/examples/example5-multicluster/demo-setup.drawio.svg @@ -223,4 +223,4 @@ - \ No newline at end of file + diff --git a/docs/examples/example5-multicluster/kustomization.yaml b/docs/examples/example5-multicluster/kustomization.yaml index fe91fc3c..ca878af6 100644 --- a/docs/examples/example5-multicluster/kustomization.yaml +++ b/docs/examples/example5-multicluster/kustomization.yaml @@ -1,3 +1,4 @@ +--- resources: - ../../../kind diff --git a/docs/examples/example5-multicluster/london-pools.yaml b/docs/examples/example5-multicluster/london-pools.yaml index 36c9f0db..5bfe7df8 100644 --- a/docs/examples/example5-multicluster/london-pools.yaml +++ b/docs/examples/example5-multicluster/london-pools.yaml @@ -1,3 +1,4 @@ +--- apiVersion: netbox.dev/v1 kind: PrefixClaim metadata: diff --git a/docs/examples/example5-multicluster/multicluster.drawio.svg b/docs/examples/example5-multicluster/multicluster.drawio.svg index a32f6afc..49d36c3e 100644 --- a/docs/examples/example5-multicluster/multicluster.drawio.svg +++ b/docs/examples/example5-multicluster/multicluster.drawio.svg @@ -775,4 +775,4 @@ - \ No newline at end of file + diff --git a/docs/examples/example5-multicluster/netbox-svc.yaml b/docs/examples/example5-multicluster/netbox-svc.yaml index ddba7fc5..ead9f0c8 100644 --- a/docs/examples/example5-multicluster/netbox-svc.yaml +++ b/docs/examples/example5-multicluster/netbox-svc.yaml @@ -1,3 +1,4 @@ +--- apiVersion: v1 kind: Service @@ -12,15 +13,15 @@ spec: type: LoadBalancer internalTrafficPolicy: Cluster ipFamilies: - - IPv4 + - IPv4 ipFamilyPolicy: SingleStack ports: - - name: http - port: 80 - protocol: TCP - targetPort: http + - name: http + port: 80 + protocol: TCP + targetPort: http selector: app.kubernetes.io/component: netbox app.kubernetes.io/instance: netbox app.kubernetes.io/name: netbox - sessionAffinity: None \ No newline at end of file + sessionAffinity: None diff --git a/docs/examples/example5-multicluster/zurich-pools.yaml b/docs/examples/example5-multicluster/zurich-pools.yaml index 4d270d8c..e7ceaa37 100644 --- a/docs/examples/example5-multicluster/zurich-pools.yaml +++ b/docs/examples/example5-multicluster/zurich-pools.yaml @@ -1,3 +1,4 @@ +--- apiVersion: netbox.dev/v1 kind: PrefixClaim metadata: diff --git a/docs/netbox-operator-high-level-architecture.drawio.svg b/docs/netbox-operator-high-level-architecture.drawio.svg index 62fcb76f..21ea4cb1 100644 --- a/docs/netbox-operator-high-level-architecture.drawio.svg +++ b/docs/netbox-operator-high-level-architecture.drawio.svg @@ -1,4 +1,4 @@ -
k8s cluster
user namespace
consumer
NetBox REST API
namespace netbox-operator
reconcile
create/update/delete
create
reconcile
create/update/delete
get available prefixes
netbox-operator
kind: PrefixClaim
spec:
  parentPrefix: 2.0.0.0/16
  prefixLength: /28
status:
  prefix: 2.0.0.0/28
Prefix 2.0.0.0/16
User
w/ kubectl
GitOps
w/ Argo or Flux
and/or
kind: Prefix
spec:
  prefix: 2.0.0.0/16
reconcile
update status
(ownerReference)
kind: Prefix
spec:
  prefix: 2.0.0.0/28

Prefix 2.0.0.0/28
create/sync
image/svg+xml
\ No newline at end of file +
k8s cluster
user namespace
consumer
NetBox REST API
namespace netbox-operator
reconcile
create/update/delete
create
reconcile
create/update/delete
get available prefixes
netbox-operator
kind: PrefixClaim
spec:
  parentPrefix: 2.0.0.0/16
  prefixLength: /28
status:
  prefix: 2.0.0.0/28
Prefix 2.0.0.0/16
User
w/ kubectl
GitOps
w/ Argo or Flux
and/or
kind: Prefix
spec:
  prefix: 2.0.0.0/16
reconcile
update status
(ownerReference)
kind: Prefix
spec:
  prefix: 2.0.0.0/28

Prefix 2.0.0.0/28
create/sync
image/svg+xml
diff --git a/docs/operational-manual.md b/docs/operational-manual.md index b9162e5b..71aa9570 100644 --- a/docs/operational-manual.md +++ b/docs/operational-manual.md @@ -15,7 +15,7 @@ kubectl logs -n deployment/netbox-operator-controller-manager ### Check CR Status Inspect the CRs status: -```bash +```bash kubectl describe -n ``` @@ -24,7 +24,7 @@ E.g.: kubectl describe prefixclaim prefixclaim-sample -n kubectl describe ipaddressclaim ipaddressclaim-sample -n kubectl describe prefix prefix-sample -n -kubectl describe ipaddress ipaddress-sample -n +kubectl describe ipaddress ipaddress-sample -n ``` This will show you the status of the operator and any errors it may have encountered. @@ -47,4 +47,4 @@ Events might give hints about what’s going wrong: ```bash kubectl get events -n --sort-by='.lastTimestamp' -``` \ No newline at end of file +``` diff --git a/docs/prefixclaim-sample-with-netbox-running-in-cluster.drawio.svg b/docs/prefixclaim-sample-with-netbox-running-in-cluster.drawio.svg index 5118715c..400037a6 100644 --- a/docs/prefixclaim-sample-with-netbox-running-in-cluster.drawio.svg +++ b/docs/prefixclaim-sample-with-netbox-running-in-cluster.drawio.svg @@ -1,4 +1,4 @@ -
k8s cluster
namespace default
user namespace
namespace netbox-operator
create
reconcile
netbox-operator
reconcile
ownerReference
kind: Prefix
spec:
  prefix: 2.0.0.0/28
image/svg+xml
NetBox REST API
create/update/delete
get available prefixes
Prefix 2.0.0.0/16
Prefix 2.0.0.0/28
kind: MetalLBIPPoolNetBox (kro )
spec:
  parentPrefix: 2.0.0.0/16
  prefixLength: /28
kind: PrefixClaim
spec:
  parentPrefix: 2.0.0.0/16
  prefixLength: /28
status:
  ipAddress:
kind: IPAddressPool
spec:
  parentPrefix: 2.0.0.0/16
  prefixLength: /28
\ No newline at end of file +
k8s cluster
namespace default
user namespace
namespace netbox-operator
create
reconcile
netbox-operator
reconcile
ownerReference
kind: Prefix
spec:
  prefix: 2.0.0.0/28
image/svg+xml
NetBox REST API
create/update/delete
get available prefixes
Prefix 2.0.0.0/16
Prefix 2.0.0.0/28
kind: MetalLBIPPoolNetBox (kro )
spec:
  parentPrefix: 2.0.0.0/16
  prefixLength: /28
kind: PrefixClaim
spec:
  parentPrefix: 2.0.0.0/16
  prefixLength: /28
status:
  ipAddress:
kind: IPAddressPool
spec:
  parentPrefix: 2.0.0.0/16
  prefixLength: /28
diff --git a/hack/boilerplate.go.txt b/hack/boilerplate.go.txt index 6d20a430..62667577 100644 --- a/hack/boilerplate.go.txt +++ b/hack/boilerplate.go.txt @@ -12,4 +12,4 @@ distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -*/ \ No newline at end of file +*/ diff --git a/kind/job/kustomization.yaml b/kind/job/kustomization.yaml index 68fcafcd..716fe282 100644 --- a/kind/job/kustomization.yaml +++ b/kind/job/kustomization.yaml @@ -1,10 +1,11 @@ +--- resources: -- load-data-job.yaml + - load-data-job.yaml apiVersion: kustomize.config.k8s.io/v1beta1 kind: Kustomization images: -- name: ghcr.io/zalando/spilo-16 - newName: ghcr.io/zalando/spilo-16 + - name: ghcr.io/zalando/spilo-16 + newName: ghcr.io/zalando/spilo-16 patches: -- path: sql-env-patch.yaml + - path: sql-env-patch.yaml diff --git a/kind/job/load-data-job.yaml b/kind/job/load-data-job.yaml index 5d9bbea9..920da458 100644 --- a/kind/job/load-data-job.yaml +++ b/kind/job/load-data-job.yaml @@ -1,3 +1,4 @@ +--- apiVersion: batch/v1 kind: Job metadata: diff --git a/kind/kustomization.yaml b/kind/kustomization.yaml index 05ecc175..35598579 100644 --- a/kind/kustomization.yaml +++ b/kind/kustomization.yaml @@ -1,3 +1,4 @@ +--- resources: - ../config/default - secret.yaml diff --git a/kind/load-data-job/README.md b/kind/load-data-job/README.md index 40582c82..6cabeb7b 100644 --- a/kind/load-data-job/README.md +++ b/kind/load-data-job/README.md @@ -2,6 +2,6 @@ Due to database schema changes cross major/minor NetBox versions, we have to `patch` the SQL files and demo data link on-the-fly. -The default values stems from the NetBox 4.1.x version. So the patching will only happen for 3.7.x and 4.0.x versions. +The default values stems from the NetBox 4.1.x version. So the patching will only happen for 3.7.x and 4.0.x versions. Please see `../local-env.sh`, that's where all the patching happen. diff --git a/kind/load-local-data-job/main.py b/kind/load-local-data-job/main.py index bbac5497..96de148e 100644 --- a/kind/load-local-data-job/main.py +++ b/kind/load-local-data-job/main.py @@ -52,7 +52,7 @@ class Tenant: ) except pynetbox.RequestError as e: pprint(e.error) - + print("Tenants loaded") # insert Sites @@ -93,7 +93,7 @@ class Site: ) except pynetbox.RequestError as e: pprint(e.error) - + print("Sites loaded") # create custom fields and associate custom fields with IP/IPRange/Prefix @@ -186,7 +186,7 @@ class CustomField: ) except pynetbox.RequestError as e: pprint(e.error) - + print("Custom fields loaded") # for debugging @@ -264,8 +264,8 @@ class Prefix: }, status="active", custom_fields={ - "environment": "Production", - "poolName": "Pool 1", + "environment": "Production", + "poolName": "Pool 1", "cfDataTypeBool": True, "cfDataTypeInteger": 1, }, @@ -287,8 +287,8 @@ class Prefix: }, status="active", custom_fields={ - "environment": "Production", - "poolName": "Pool 1", + "environment": "Production", + "poolName": "Pool 1", "cfDataTypeBool": True, "cfDataTypeInteger": 1, }, @@ -303,8 +303,8 @@ class Prefix: }, status="active", custom_fields={ - "environment": "Development", - "poolName": "Pool 1", + "environment": "Development", + "poolName": "Pool 1", "cfDataTypeBool": False, "cfDataTypeInteger": 2, }, @@ -319,8 +319,8 @@ class Prefix: }, status="active", custom_fields={ - "environment": "Production", - "poolName": "Pool 2", + "environment": "Production", + "poolName": "Pool 2", "cfDataTypeBool": True, "cfDataTypeInteger": 3, }, @@ -342,8 +342,8 @@ class Prefix: }, status="active", custom_fields={ - "environment": "Production", - "poolName": "Pool 2", + "environment": "Production", + "poolName": "Pool 2", "cfDataTypeBool": True, "cfDataTypeInteger": 3, }, @@ -358,8 +358,8 @@ class Prefix: }, status="active", custom_fields={ - "environment": "Development", - "poolName": "Pool 2", + "environment": "Development", + "poolName": "Pool 2", "cfDataTypeBool": False, "cfDataTypeInteger": 4, }, @@ -374,8 +374,8 @@ class Prefix: }, status="active", custom_fields={ - "environment": "production", - "poolName": "pool 3", + "environment": "production", + "poolName": "pool 3", "cfDataTypeBool": True, "cfDataTypeInteger": 5, }, @@ -397,8 +397,8 @@ class Prefix: }, status="active", custom_fields={ - "environment": "production", - "poolName": "pool 3", + "environment": "production", + "poolName": "pool 3", "cfDataTypeBool": True, "cfDataTypeInteger": 5, }, @@ -941,5 +941,5 @@ class Prefix: ) except pynetbox.RequestError as e: pprint(e.error) - + print("Prefixes loaded") diff --git a/kind/load-local-data-job/netbox-load-local-data-job.yaml b/kind/load-local-data-job/netbox-load-local-data-job.yaml index b9ce511b..5a4e1279 100644 --- a/kind/load-local-data-job/netbox-load-local-data-job.yaml +++ b/kind/load-local-data-job/netbox-load-local-data-job.yaml @@ -1,3 +1,4 @@ +--- apiVersion: batch/v1 kind: Job metadata: diff --git a/kind/netbox-db.yaml b/kind/netbox-db.yaml index ead11131..a28e54db 100644 --- a/kind/netbox-db.yaml +++ b/kind/netbox-db.yaml @@ -1,3 +1,4 @@ +--- apiVersion: "acid.zalan.do/v1" kind: postgresql metadata: @@ -14,7 +15,7 @@ spec: - superuser - createdb - #databases: name->owner + # databases: name->owner databases: netbox: netbox postgresql: diff --git a/kind/netbox-db/kustomization.yaml b/kind/netbox-db/kustomization.yaml index 80910a9e..f3edbc14 100644 --- a/kind/netbox-db/kustomization.yaml +++ b/kind/netbox-db/kustomization.yaml @@ -1,3 +1,4 @@ +--- resources: - netbox-db.yaml diff --git a/kind/netbox-db/netbox-db-patch.tmpl.yaml b/kind/netbox-db/netbox-db-patch.tmpl.yaml index de2cc4ea..a8d947a7 100644 --- a/kind/netbox-db/netbox-db-patch.tmpl.yaml +++ b/kind/netbox-db/netbox-db-patch.tmpl.yaml @@ -1,3 +1,4 @@ +--- # spilo-image-patch.yaml # This is used to allow the patch of the spec.postgresql.image based on the env variable IMAGE_REGISTRY apiVersion: "acid.zalan.do/v1" diff --git a/kind/netbox-db/netbox-db.yaml b/kind/netbox-db/netbox-db.yaml index 69575f19..3ec864d0 100644 --- a/kind/netbox-db/netbox-db.yaml +++ b/kind/netbox-db/netbox-db.yaml @@ -1,3 +1,4 @@ +--- apiVersion: "acid.zalan.do/v1" kind: postgresql metadata: @@ -14,7 +15,7 @@ spec: - superuser - createdb - #databases: name->owner + # databases: name->owner databases: netbox: netbox postgresql: diff --git a/kind/nginx-unit-config.yaml b/kind/nginx-unit-config.yaml index b393ea40..a2b9eb6a 100644 --- a/kind/nginx-unit-config.yaml +++ b/kind/nginx-unit-config.yaml @@ -1,9 +1,10 @@ +--- apiVersion: v1 kind: ConfigMap metadata: name: nginx-unit-config data: - nginx-unit.json: | + nginx-unit.json: |- { "listeners": { "0.0.0.0:8080": { "pass": "routes/main" }, diff --git a/kind/secret.yaml b/kind/secret.yaml index afa03d1c..b3adf2f1 100644 --- a/kind/secret.yaml +++ b/kind/secret.yaml @@ -1,8 +1,9 @@ +--- apiVersion: v1 kind: Secret metadata: name: netbox-auth namespace: netbox-operator-system data: - #local netbox instance token, not a real secret + # local netbox instance token, not a real secret config.env: QVVUSF9UT0tFTj0wMTIzNDU2Nzg5YWJjZGVmMDEyMzQ1Njc4OWFiY2RlZjAxMjM0NTY3Cg== diff --git a/tests/e2e/Prefix/IPv4/prefixclaim-ipv4-invalid-parentprefixselector/chainsaw-test.yaml b/tests/e2e/Prefix/IPv4/prefixclaim-ipv4-invalid-parentprefixselector/chainsaw-test.yaml index 8ddabfdd..ab378f4b 100644 --- a/tests/e2e/Prefix/IPv4/prefixclaim-ipv4-invalid-parentprefixselector/chainsaw-test.yaml +++ b/tests/e2e/Prefix/IPv4/prefixclaim-ipv4-invalid-parentprefixselector/chainsaw-test.yaml @@ -1,3 +1,4 @@ +--- apiVersion: chainsaw.kyverno.io/v1alpha1 kind: Test metadata: @@ -19,16 +20,16 @@ spec: metadata: name: prefixclaim-ipv4-invalid-parentprefixselector spec: - tenant: "MY_TENANT_2" # Use the `name` value instead of the `slug` value - site: "MY_SITE_2" # Use the `name` value instead of the `slug` value + tenant: "MY_TENANT_2" # Use the `name` value instead of the `slug` value + site: "MY_SITE_2" # Use the `name` value instead of the `slug` value description: "some description" comments: "your comments" preserveInNetbox: true prefixLength: "/31" - parentPrefixSelector: # The keys and values are case-sensitive - tenant: "niltenant" # Use the `name` value instead of the `slug` value - site: "nilsite" # Use the `name` value instead of the `slug` value - family: "IPv4" # Can only be either IPv4 or IPv6" + parentPrefixSelector: # The keys and values are case-sensitive + tenant: "niltenant" # Use the `name` value instead of the `slug` value + site: "nilsite" # Use the `name` value instead of the `slug` value + family: "IPv4" # Can only be either IPv4 or IPv6" # custom fields of your interest environment: "nilenv" poolName: "nilpool" @@ -52,5 +53,5 @@ spec: description: Events cleanup required to fix issues with failing tests that assert the wrong Error resource cleanup: - script: - content: | + content: |- kubectl delete events --field-selector involvedObject.name=prefixclaim-ipv4-invalid-parentprefixselector -n $NAMESPACE diff --git a/tests/e2e/Prefix/IPv4/prefixclaim-ipv4-invalid-parentprefixselector/netbox_v1_prefixclaim.yaml b/tests/e2e/Prefix/IPv4/prefixclaim-ipv4-invalid-parentprefixselector/netbox_v1_prefixclaim.yaml index 68b5600d..2030e88e 100644 --- a/tests/e2e/Prefix/IPv4/prefixclaim-ipv4-invalid-parentprefixselector/netbox_v1_prefixclaim.yaml +++ b/tests/e2e/Prefix/IPv4/prefixclaim-ipv4-invalid-parentprefixselector/netbox_v1_prefixclaim.yaml @@ -1,3 +1,4 @@ +--- apiVersion: netbox.dev/v1 kind: PrefixClaim metadata: @@ -6,16 +7,16 @@ metadata: app.kubernetes.io/managed-by: kustomize name: prefixclaim-ipv4-invalid-parentprefixselector spec: - tenant: "MY_TENANT_2" # Use the `name` value instead of the `slug` value - site: "MY_SITE_2" # Use the `name` value instead of the `slug` value + tenant: "MY_TENANT_2" # Use the `name` value instead of the `slug` value + site: "MY_SITE_2" # Use the `name` value instead of the `slug` value description: "some description" comments: "your comments" preserveInNetbox: true prefixLength: "/31" - parentPrefixSelector: # The keys and values are case-sensitive - tenant: "niltenant" # Use the `name` value instead of the `slug` value - site: "nilsite" # Use the `name` value instead of the `slug` value - family: "IPv4" # Can only be either IPv4 or IPv6" + parentPrefixSelector: # The keys and values are case-sensitive + tenant: "niltenant" # Use the `name` value instead of the `slug` value + site: "nilsite" # Use the `name` value instead of the `slug` value + family: "IPv4" # Can only be either IPv4 or IPv6" # custom fields of your interest environment: "nilenv" poolName: "nilpool" diff --git a/tests/e2e/Prefix/IPv4/prefixclaim-ipv4-parentprefix-apply-update/chainsaw-test.yaml b/tests/e2e/Prefix/IPv4/prefixclaim-ipv4-parentprefix-apply-update/chainsaw-test.yaml index a8c05074..9ac1a559 100644 --- a/tests/e2e/Prefix/IPv4/prefixclaim-ipv4-parentprefix-apply-update/chainsaw-test.yaml +++ b/tests/e2e/Prefix/IPv4/prefixclaim-ipv4-parentprefix-apply-update/chainsaw-test.yaml @@ -1,3 +1,4 @@ +--- apiVersion: chainsaw.kyverno.io/v1alpha1 kind: Test metadata: @@ -82,5 +83,5 @@ spec: description: Events cleanup required to fix issues with failing tests that assert the wrong Error resource cleanup: - script: - content: | + content: |- kubectl delete events --field-selector involvedObject.name=prefixclaim-ipv4-parentprefix-apply-update -n $NAMESPACE diff --git a/tests/e2e/Prefix/IPv4/prefixclaim-ipv4-parentprefix-apply-update/netbox_v1_prefixclaim-update.yaml b/tests/e2e/Prefix/IPv4/prefixclaim-ipv4-parentprefix-apply-update/netbox_v1_prefixclaim-update.yaml index d51789f8..bb12a2d4 100644 --- a/tests/e2e/Prefix/IPv4/prefixclaim-ipv4-parentprefix-apply-update/netbox_v1_prefixclaim-update.yaml +++ b/tests/e2e/Prefix/IPv4/prefixclaim-ipv4-parentprefix-apply-update/netbox_v1_prefixclaim-update.yaml @@ -1,3 +1,4 @@ +--- apiVersion: netbox.dev/v1 kind: PrefixClaim metadata: diff --git a/tests/e2e/Prefix/IPv4/prefixclaim-ipv4-parentprefix-apply-update/netbox_v1_prefixclaim.yaml b/tests/e2e/Prefix/IPv4/prefixclaim-ipv4-parentprefix-apply-update/netbox_v1_prefixclaim.yaml index 8fe50871..8eada6a0 100644 --- a/tests/e2e/Prefix/IPv4/prefixclaim-ipv4-parentprefix-apply-update/netbox_v1_prefixclaim.yaml +++ b/tests/e2e/Prefix/IPv4/prefixclaim-ipv4-parentprefix-apply-update/netbox_v1_prefixclaim.yaml @@ -1,3 +1,4 @@ +--- apiVersion: netbox.dev/v1 kind: PrefixClaim metadata: diff --git a/tests/e2e/Prefix/IPv4/prefixclaim-ipv4-parentprefix-restore/chainsaw-test.yaml b/tests/e2e/Prefix/IPv4/prefixclaim-ipv4-parentprefix-restore/chainsaw-test.yaml index ece8693f..c95ebc45 100644 --- a/tests/e2e/Prefix/IPv4/prefixclaim-ipv4-parentprefix-restore/chainsaw-test.yaml +++ b/tests/e2e/Prefix/IPv4/prefixclaim-ipv4-parentprefix-restore/chainsaw-test.yaml @@ -1,3 +1,4 @@ +--- apiVersion: chainsaw.kyverno.io/v1alpha1 kind: Test metadata: @@ -223,6 +224,6 @@ spec: description: Events cleanup required to fix issues with failing tests that assert the wrong Error resource cleanup: - script: - content: | + content: |- kubectl delete events --field-selector involvedObject.name=prefixclaim-ipv4-parentprefix-restore-1 -n $NAMESPACE kubectl delete events --field-selector involvedObject.name=prefixclaim-ipv4-parentprefix-restore-2 -n $NAMESPACE diff --git a/tests/e2e/Prefix/IPv4/prefixclaim-ipv4-parentprefix-restore/netbox_v1_prefix_3-wrong-length.yaml b/tests/e2e/Prefix/IPv4/prefixclaim-ipv4-parentprefix-restore/netbox_v1_prefix_3-wrong-length.yaml index 47f0c164..cef188f5 100644 --- a/tests/e2e/Prefix/IPv4/prefixclaim-ipv4-parentprefix-restore/netbox_v1_prefix_3-wrong-length.yaml +++ b/tests/e2e/Prefix/IPv4/prefixclaim-ipv4-parentprefix-restore/netbox_v1_prefix_3-wrong-length.yaml @@ -1,3 +1,4 @@ +--- apiVersion: netbox.dev/v1 kind: Prefix metadata: diff --git a/tests/e2e/Prefix/IPv4/prefixclaim-ipv4-parentprefix-restore/netbox_v1_prefixclaim_1.yaml b/tests/e2e/Prefix/IPv4/prefixclaim-ipv4-parentprefix-restore/netbox_v1_prefixclaim_1.yaml index 0c052d67..9e5ca433 100644 --- a/tests/e2e/Prefix/IPv4/prefixclaim-ipv4-parentprefix-restore/netbox_v1_prefixclaim_1.yaml +++ b/tests/e2e/Prefix/IPv4/prefixclaim-ipv4-parentprefix-restore/netbox_v1_prefixclaim_1.yaml @@ -1,3 +1,4 @@ +--- apiVersion: netbox.dev/v1 kind: PrefixClaim metadata: diff --git a/tests/e2e/Prefix/IPv4/prefixclaim-ipv4-parentprefix-restore/netbox_v1_prefixclaim_2.yaml b/tests/e2e/Prefix/IPv4/prefixclaim-ipv4-parentprefix-restore/netbox_v1_prefixclaim_2.yaml index f2d8fa17..b4040243 100644 --- a/tests/e2e/Prefix/IPv4/prefixclaim-ipv4-parentprefix-restore/netbox_v1_prefixclaim_2.yaml +++ b/tests/e2e/Prefix/IPv4/prefixclaim-ipv4-parentprefix-restore/netbox_v1_prefixclaim_2.yaml @@ -1,3 +1,4 @@ +--- apiVersion: netbox.dev/v1 kind: PrefixClaim metadata: diff --git a/tests/e2e/Prefix/IPv4/prefixclaim-ipv4-parentprefix-restore/netbox_v1_prefixclaim_3.yaml b/tests/e2e/Prefix/IPv4/prefixclaim-ipv4-parentprefix-restore/netbox_v1_prefixclaim_3.yaml index 6324fa8b..a34af89f 100644 --- a/tests/e2e/Prefix/IPv4/prefixclaim-ipv4-parentprefix-restore/netbox_v1_prefixclaim_3.yaml +++ b/tests/e2e/Prefix/IPv4/prefixclaim-ipv4-parentprefix-restore/netbox_v1_prefixclaim_3.yaml @@ -1,3 +1,4 @@ +--- apiVersion: netbox.dev/v1 kind: PrefixClaim metadata: diff --git a/tests/e2e/Prefix/IPv4/prefixclaim-ipv4-parentprefixselector-nonexisingcustomfield/chainsaw-test.yaml b/tests/e2e/Prefix/IPv4/prefixclaim-ipv4-parentprefixselector-nonexisingcustomfield/chainsaw-test.yaml index c45d8aa3..980e0fc2 100644 --- a/tests/e2e/Prefix/IPv4/prefixclaim-ipv4-parentprefixselector-nonexisingcustomfield/chainsaw-test.yaml +++ b/tests/e2e/Prefix/IPv4/prefixclaim-ipv4-parentprefixselector-nonexisingcustomfield/chainsaw-test.yaml @@ -1,3 +1,4 @@ +--- apiVersion: chainsaw.kyverno.io/v1alpha1 kind: Test metadata: @@ -21,7 +22,7 @@ spec: spec: comments: your comments description: some description - parentPrefixSelector: # The keys and values are case-sensitive + parentPrefixSelector: # The keys and values are case-sensitive tenant: "MY_TENANT" site: "MY_SITE" family: "IPv4" @@ -61,5 +62,5 @@ spec: description: Events cleanup required to fix issues with failing tests that assert the wrong Error resource cleanup: - script: - content: | + content: |- kubectl delete events --field-selector involvedObject.name=prefixclaim-ipv4-parentprefixselector-nonexisingcustomfield -n $NAMESPACE diff --git a/tests/e2e/Prefix/IPv4/prefixclaim-ipv4-parentprefixselector-nonexisingcustomfield/netbox_v1_prefixclaim.yaml b/tests/e2e/Prefix/IPv4/prefixclaim-ipv4-parentprefixselector-nonexisingcustomfield/netbox_v1_prefixclaim.yaml index 8df2e862..7f1ce8f4 100644 --- a/tests/e2e/Prefix/IPv4/prefixclaim-ipv4-parentprefixselector-nonexisingcustomfield/netbox_v1_prefixclaim.yaml +++ b/tests/e2e/Prefix/IPv4/prefixclaim-ipv4-parentprefixselector-nonexisingcustomfield/netbox_v1_prefixclaim.yaml @@ -1,3 +1,4 @@ +--- apiVersion: netbox.dev/v1 kind: PrefixClaim metadata: @@ -6,16 +7,16 @@ metadata: app.kubernetes.io/managed-by: kustomize name: prefixclaim-ipv4-parentprefixselector-nonexisingcustomfield spec: - tenant: "MY_TENANT_2" # Use the `name` value instead of the `slug` value - site: "MY_SITE_2" # Use the `name` value instead of the `slug` value + tenant: "MY_TENANT_2" # Use the `name` value instead of the `slug` value + site: "MY_SITE_2" # Use the `name` value instead of the `slug` value description: "some description" comments: "your comments" preserveInNetbox: false prefixLength: "/31" - parentPrefixSelector: # The keys and values are case-sensitive - tenant: "MY_TENANT" # Use the `name` value instead of the `slug` value - site: "MY_SITE" # Use the `name` value instead of the `slug` value - family: "IPv4" # Can only be either IPv4 or IPv6" + parentPrefixSelector: # The keys and values are case-sensitive + tenant: "MY_TENANT" # Use the `name` value instead of the `slug` value + site: "MY_SITE" # Use the `name` value instead of the `slug` value + family: "IPv4" # Can only be either IPv4 or IPv6" # custom fields of your interest environment: "Production" poolName: "Pool 1" diff --git a/tests/e2e/Prefix/IPv4/prefixclaim-ipv4-parentprefixselector-restore/chainsaw-test.yaml b/tests/e2e/Prefix/IPv4/prefixclaim-ipv4-parentprefixselector-restore/chainsaw-test.yaml index 03b61eb9..48876438 100644 --- a/tests/e2e/Prefix/IPv4/prefixclaim-ipv4-parentprefixselector-restore/chainsaw-test.yaml +++ b/tests/e2e/Prefix/IPv4/prefixclaim-ipv4-parentprefixselector-restore/chainsaw-test.yaml @@ -1,3 +1,4 @@ +--- apiVersion: chainsaw.kyverno.io/v1alpha1 kind: Test metadata: @@ -167,6 +168,6 @@ spec: description: Events cleanup required to fix issues with failing tests that assert the wrong Error resource cleanup: - script: - content: | + content: |- kubectl delete events --field-selector involvedObject.name=prefixclaim-ipv4-parentprefixselector-restore-1 -n $NAMESPACE kubectl delete events --field-selector involvedObject.name=prefixclaim-ipv4-parentprefixselector-restore-2 -n $NAMESPACE diff --git a/tests/e2e/Prefix/IPv4/prefixclaim-ipv4-parentprefixselector-restore/netbox_v1_prefixclaim_1.yaml b/tests/e2e/Prefix/IPv4/prefixclaim-ipv4-parentprefixselector-restore/netbox_v1_prefixclaim_1.yaml index f25d8a25..2758a2b9 100644 --- a/tests/e2e/Prefix/IPv4/prefixclaim-ipv4-parentprefixselector-restore/netbox_v1_prefixclaim_1.yaml +++ b/tests/e2e/Prefix/IPv4/prefixclaim-ipv4-parentprefixselector-restore/netbox_v1_prefixclaim_1.yaml @@ -1,3 +1,4 @@ +--- apiVersion: netbox.dev/v1 kind: PrefixClaim metadata: @@ -12,10 +13,10 @@ spec: comments: "your comments" preserveInNetbox: true prefixLength: "/28" - parentPrefixSelector: # The keys and values are case-sensitive - tenant: "MY_TENANT" # Use the `name` value instead of the `slug` value - site: "MY_SITE" # Use the `name` value instead of the `slug` value - family: "IPv4" # Can only be either IPv4 or IPv6" + parentPrefixSelector: # The keys and values are case-sensitive + tenant: "MY_TENANT" # Use the `name` value instead of the `slug` value + site: "MY_SITE" # Use the `name` value instead of the `slug` value + family: "IPv4" # Can only be either IPv4 or IPv6" # custom fields of your interest environment: "Production" poolName: "Pool 2" diff --git a/tests/e2e/Prefix/IPv4/prefixclaim-ipv4-parentprefixselector-restore/netbox_v1_prefixclaim_2.yaml b/tests/e2e/Prefix/IPv4/prefixclaim-ipv4-parentprefixselector-restore/netbox_v1_prefixclaim_2.yaml index d8239404..92a9fa6b 100644 --- a/tests/e2e/Prefix/IPv4/prefixclaim-ipv4-parentprefixselector-restore/netbox_v1_prefixclaim_2.yaml +++ b/tests/e2e/Prefix/IPv4/prefixclaim-ipv4-parentprefixselector-restore/netbox_v1_prefixclaim_2.yaml @@ -1,3 +1,4 @@ +--- apiVersion: netbox.dev/v1 kind: PrefixClaim metadata: @@ -12,10 +13,10 @@ spec: comments: "your comments" preserveInNetbox: false prefixLength: "/28" - parentPrefixSelector: # The keys and values are case-sensitive - tenant: "MY_TENANT" # Use the `name` value instead of the `slug` value - site: "MY_SITE" # Use the `name` value instead of the `slug` value - family: "IPv4" # Can only be either IPv4 or IPv6" + parentPrefixSelector: # The keys and values are case-sensitive + tenant: "MY_TENANT" # Use the `name` value instead of the `slug` value + site: "MY_SITE" # Use the `name` value instead of the `slug` value + family: "IPv4" # Can only be either IPv4 or IPv6" # custom fields of your interest environment: "Production" poolName: "Pool 2" diff --git a/tests/e2e/Prefix/IPv4/prefixclaim-ipv4-parentprefixselector/chainsaw-test.yaml b/tests/e2e/Prefix/IPv4/prefixclaim-ipv4-parentprefixselector/chainsaw-test.yaml index 0c554c03..2ddd15cf 100644 --- a/tests/e2e/Prefix/IPv4/prefixclaim-ipv4-parentprefixselector/chainsaw-test.yaml +++ b/tests/e2e/Prefix/IPv4/prefixclaim-ipv4-parentprefixselector/chainsaw-test.yaml @@ -1,3 +1,4 @@ +--- apiVersion: chainsaw.kyverno.io/v1alpha1 kind: Test metadata: @@ -74,5 +75,5 @@ spec: description: Events cleanup required to fix issues with failing tests that assert the wrong Error resource cleanup: - script: - content: | + content: |- kubectl delete events --field-selector involvedObject.name=prefixclaim-ipv4-parentprefixselector-apply -n $NAMESPACE diff --git a/tests/e2e/Prefix/IPv4/prefixclaim-ipv4-parentprefixselector/netbox_v1_prefixclaim.yaml b/tests/e2e/Prefix/IPv4/prefixclaim-ipv4-parentprefixselector/netbox_v1_prefixclaim.yaml index 9511071f..68fa69e2 100644 --- a/tests/e2e/Prefix/IPv4/prefixclaim-ipv4-parentprefixselector/netbox_v1_prefixclaim.yaml +++ b/tests/e2e/Prefix/IPv4/prefixclaim-ipv4-parentprefixselector/netbox_v1_prefixclaim.yaml @@ -1,3 +1,4 @@ +--- apiVersion: netbox.dev/v1 kind: PrefixClaim metadata: @@ -6,16 +7,16 @@ metadata: app.kubernetes.io/managed-by: kustomize name: prefixclaim-ipv4-parentprefixselector-apply spec: - tenant: "MY_TENANT_2" # Use the `name` value instead of the `slug` value - site: "MY_SITE_2" # Use the `name` value instead of the `slug` value + tenant: "MY_TENANT_2" # Use the `name` value instead of the `slug` value + site: "MY_SITE_2" # Use the `name` value instead of the `slug` value description: "some description" comments: "your comments" preserveInNetbox: true prefixLength: "/31" - parentPrefixSelector: # The keys and values are case-sensitive - tenant: "MY_TENANT" # Use the `name` value instead of the `slug` value - site: "MY_SITE" # Use the `name` value instead of the `slug` value - family: "IPv4" # Can only be either IPv4 or IPv6" + parentPrefixSelector: # The keys and values are case-sensitive + tenant: "MY_TENANT" # Use the `name` value instead of the `slug` value + site: "MY_SITE" # Use the `name` value instead of the `slug` value + family: "IPv4" # Can only be either IPv4 or IPv6" # custom fields of your interest environment: "Production" poolName: "Pool 1" diff --git a/tests/e2e/Prefix/IPv4/prefixclaim-ipv4-prefixexhausted/chainsaw-test.yaml b/tests/e2e/Prefix/IPv4/prefixclaim-ipv4-prefixexhausted/chainsaw-test.yaml index d687f60f..9c832dcf 100644 --- a/tests/e2e/Prefix/IPv4/prefixclaim-ipv4-prefixexhausted/chainsaw-test.yaml +++ b/tests/e2e/Prefix/IPv4/prefixclaim-ipv4-prefixexhausted/chainsaw-test.yaml @@ -1,3 +1,4 @@ +--- apiVersion: chainsaw.kyverno.io/v1alpha1 kind: Test metadata: @@ -101,7 +102,7 @@ spec: description: Events cleanup required to fix issues with failing tests that assert the wrong Error resource cleanup: - script: - content: | + content: |- kubectl delete events --field-selector involvedObject.name=prefixclaim-ipv4-prefixexhausted-1 -n $NAMESPACE kubectl delete events --field-selector involvedObject.name=prefixclaim-ipv4-prefixexhausted-2 -n $NAMESPACE kubectl delete events --field-selector involvedObject.name=prefixclaim-ipv4-prefixexhausted-3 -n $NAMESPACE diff --git a/tests/e2e/Prefix/IPv4/prefixclaim-ipv4-prefixexhausted/netbox_v1_prefixclaim_1.yaml b/tests/e2e/Prefix/IPv4/prefixclaim-ipv4-prefixexhausted/netbox_v1_prefixclaim_1.yaml index e28b0cc4..a25f44c3 100644 --- a/tests/e2e/Prefix/IPv4/prefixclaim-ipv4-prefixexhausted/netbox_v1_prefixclaim_1.yaml +++ b/tests/e2e/Prefix/IPv4/prefixclaim-ipv4-prefixexhausted/netbox_v1_prefixclaim_1.yaml @@ -1,3 +1,4 @@ +--- apiVersion: netbox.dev/v1 kind: PrefixClaim metadata: diff --git a/tests/e2e/Prefix/IPv4/prefixclaim-ipv4-prefixexhausted/netbox_v1_prefixclaim_2.yaml b/tests/e2e/Prefix/IPv4/prefixclaim-ipv4-prefixexhausted/netbox_v1_prefixclaim_2.yaml index 394b1b1e..1039c86b 100644 --- a/tests/e2e/Prefix/IPv4/prefixclaim-ipv4-prefixexhausted/netbox_v1_prefixclaim_2.yaml +++ b/tests/e2e/Prefix/IPv4/prefixclaim-ipv4-prefixexhausted/netbox_v1_prefixclaim_2.yaml @@ -1,3 +1,4 @@ +--- apiVersion: netbox.dev/v1 kind: PrefixClaim metadata: diff --git a/tests/e2e/Prefix/IPv4/prefixclaim-ipv4-prefixexhausted/netbox_v1_prefixclaim_3.yaml b/tests/e2e/Prefix/IPv4/prefixclaim-ipv4-prefixexhausted/netbox_v1_prefixclaim_3.yaml index ffa12595..7ac517eb 100644 --- a/tests/e2e/Prefix/IPv4/prefixclaim-ipv4-prefixexhausted/netbox_v1_prefixclaim_3.yaml +++ b/tests/e2e/Prefix/IPv4/prefixclaim-ipv4-prefixexhausted/netbox_v1_prefixclaim_3.yaml @@ -1,3 +1,4 @@ +--- apiVersion: netbox.dev/v1 kind: PrefixClaim metadata: diff --git a/tests/e2e/Prefix/IPv4/prefixclaim-ipv4-update-ownerreference/chainsaw-test.yaml b/tests/e2e/Prefix/IPv4/prefixclaim-ipv4-update-ownerreference/chainsaw-test.yaml index 9936b25b..dc260c9b 100644 --- a/tests/e2e/Prefix/IPv4/prefixclaim-ipv4-update-ownerreference/chainsaw-test.yaml +++ b/tests/e2e/Prefix/IPv4/prefixclaim-ipv4-update-ownerreference/chainsaw-test.yaml @@ -1,3 +1,4 @@ +--- apiVersion: chainsaw.kyverno.io/v1alpha1 kind: Test metadata: @@ -74,5 +75,5 @@ spec: description: Events cleanup required to fix issues with failing tests that assert the wrong Error resource cleanup: - script: - content: | + content: |- kubectl delete events --field-selector involvedObject.name=prefixclaim-ipv4-update-ownerreference-1 -n $NAMESPACE diff --git a/tests/e2e/Prefix/IPv4/prefixclaim-ipv4-update-ownerreference/netbox_v1_prefix_1.yaml b/tests/e2e/Prefix/IPv4/prefixclaim-ipv4-update-ownerreference/netbox_v1_prefix_1.yaml index 28384041..5fc88662 100644 --- a/tests/e2e/Prefix/IPv4/prefixclaim-ipv4-update-ownerreference/netbox_v1_prefix_1.yaml +++ b/tests/e2e/Prefix/IPv4/prefixclaim-ipv4-update-ownerreference/netbox_v1_prefix_1.yaml @@ -1,3 +1,4 @@ +--- apiVersion: netbox.dev/v1 kind: Prefix metadata: diff --git a/tests/e2e/Prefix/IPv4/prefixclaim-ipv4-update-ownerreference/netbox_v1_prefixclaim_1.yaml b/tests/e2e/Prefix/IPv4/prefixclaim-ipv4-update-ownerreference/netbox_v1_prefixclaim_1.yaml index 62f80a05..d3c1a32d 100644 --- a/tests/e2e/Prefix/IPv4/prefixclaim-ipv4-update-ownerreference/netbox_v1_prefixclaim_1.yaml +++ b/tests/e2e/Prefix/IPv4/prefixclaim-ipv4-update-ownerreference/netbox_v1_prefixclaim_1.yaml @@ -1,3 +1,4 @@ +--- apiVersion: netbox.dev/v1 kind: PrefixClaim metadata: diff --git a/tests/e2e/Prefix/IPv6/prefixclaim-ipv6-apply-update/chainsaw-test.yaml b/tests/e2e/Prefix/IPv6/prefixclaim-ipv6-apply-update/chainsaw-test.yaml index d4037f53..f2914c1f 100644 --- a/tests/e2e/Prefix/IPv6/prefixclaim-ipv6-apply-update/chainsaw-test.yaml +++ b/tests/e2e/Prefix/IPv6/prefixclaim-ipv6-apply-update/chainsaw-test.yaml @@ -1,3 +1,4 @@ +--- apiVersion: chainsaw.kyverno.io/v1alpha1 kind: Test metadata: @@ -111,5 +112,5 @@ spec: description: Events cleanup required to fix issues with failing tests that assert the wrong Error resource cleanup: - script: - content: | + content: |- kubectl delete events --field-selector involvedObject.name=prefixclaim-ipv6-apply-update -n $NAMESPACE diff --git a/tests/e2e/Prefix/IPv6/prefixclaim-ipv6-apply-update/netbox_v1_prefixclaim-update.yaml b/tests/e2e/Prefix/IPv6/prefixclaim-ipv6-apply-update/netbox_v1_prefixclaim-update.yaml index 44520e0a..6c2db0ff 100644 --- a/tests/e2e/Prefix/IPv6/prefixclaim-ipv6-apply-update/netbox_v1_prefixclaim-update.yaml +++ b/tests/e2e/Prefix/IPv6/prefixclaim-ipv6-apply-update/netbox_v1_prefixclaim-update.yaml @@ -1,3 +1,4 @@ +--- apiVersion: netbox.dev/v1 kind: PrefixClaim metadata: @@ -6,14 +7,14 @@ metadata: app.kubernetes.io/managed-by: kustomize name: prefixclaim-ipv6-apply-update spec: - tenant: "MY_TENANT_2" # Use the `name` value instead of the `slug` value + tenant: "MY_TENANT_2" # Use the `name` value instead of the `slug` value description: "new description" comments: "new comments" preserveInNetbox: true prefixLength: "/124" - parentPrefixSelector: # The keys and values are case-sensitive + parentPrefixSelector: # The keys and values are case-sensitive # if the entry for tenant or site is missing, it will *not* inherit from the tenant and site from the Spec - tenant: "MY_TENANT" # Use the `name` value instead of the `slug` value - family: "IPv6" # Can only be either IPv4 or IPv6" + tenant: "MY_TENANT" # Use the `name` value instead of the `slug` value + family: "IPv6" # Can only be either IPv4 or IPv6" environment: "production" poolName: "pool 4" diff --git a/tests/e2e/Prefix/IPv6/prefixclaim-ipv6-apply-update/netbox_v1_prefixclaim.yaml b/tests/e2e/Prefix/IPv6/prefixclaim-ipv6-apply-update/netbox_v1_prefixclaim.yaml index 05aa6e0e..830a8238 100644 --- a/tests/e2e/Prefix/IPv6/prefixclaim-ipv6-apply-update/netbox_v1_prefixclaim.yaml +++ b/tests/e2e/Prefix/IPv6/prefixclaim-ipv6-apply-update/netbox_v1_prefixclaim.yaml @@ -1,3 +1,4 @@ +--- apiVersion: netbox.dev/v1 kind: PrefixClaim metadata: @@ -6,14 +7,14 @@ metadata: app.kubernetes.io/managed-by: kustomize name: prefixclaim-ipv6-apply-update spec: - tenant: "MY_TENANT_2" # Use the `name` value instead of the `slug` value + tenant: "MY_TENANT_2" # Use the `name` value instead of the `slug` value description: "some description" comments: "your comments" preserveInNetbox: true prefixLength: "/124" - parentPrefixSelector: # The keys and values are case-sensitive + parentPrefixSelector: # The keys and values are case-sensitive # if the entry for tenant or site is missing, it will *not* inherit from the tenant and site from the Spec - tenant: "MY_TENANT" # Use the `name` value instead of the `slug` value - family: "IPv6" # Can only be either IPv4 or IPv6" + tenant: "MY_TENANT" # Use the `name` value instead of the `slug` value + family: "IPv6" # Can only be either IPv4 or IPv6" environment: "production" poolName: "pool 4" diff --git a/tests/e2e/README.md b/tests/e2e/README.md index 1459beb5..87aee5bd 100644 --- a/tests/e2e/README.md +++ b/tests/e2e/README.md @@ -14,7 +14,7 @@ - Backup: `kubectl exec pod/netbox-db-0 -- bash -c "pg_dump --clean -U postgres netbox" > database.sql` - The simplest test case is `tests/e2e/prefix/ipv4/prefixclaim-ipv4-apply-update` - We always need a `chainsaw-test.yaml` -- Perform a clean run by resetting the database first, then execute the test +- Perform a clean run by resetting the database first, then execute the test - Reset database `cat database.sql | kubectl exec -i pod/netbox-db-0 -- psql -U postgres -d netbox` - Make sure that in the `e2e` namespace, no leftover CRs are there - Execute the entire e2e test `make test-e2e` diff --git a/tests/e2e/ipaddress/ipv4/ipaddressclaim-ipv4-apply-update/chainsaw-test.yaml b/tests/e2e/ipaddress/ipv4/ipaddressclaim-ipv4-apply-update/chainsaw-test.yaml index 3225d16d..60595009 100644 --- a/tests/e2e/ipaddress/ipv4/ipaddressclaim-ipv4-apply-update/chainsaw-test.yaml +++ b/tests/e2e/ipaddress/ipv4/ipaddressclaim-ipv4-apply-update/chainsaw-test.yaml @@ -1,3 +1,4 @@ +--- apiVersion: chainsaw.kyverno.io/v1alpha1 kind: Test metadata: @@ -110,5 +111,5 @@ spec: description: Events cleanup required to fix issues with failing tests that assert the wrong Error resource cleanup: - script: - content: | + content: |- kubectl delete events --field-selector involvedObject.name=ipaddressclaim-ipv4-apply-update -n $NAMESPACE diff --git a/tests/e2e/ipaddress/ipv4/ipaddressclaim-ipv4-apply-update/netbox_v1_ipaddressclaim-update.yaml b/tests/e2e/ipaddress/ipv4/ipaddressclaim-ipv4-apply-update/netbox_v1_ipaddressclaim-update.yaml index 526268fd..e7f830dc 100644 --- a/tests/e2e/ipaddress/ipv4/ipaddressclaim-ipv4-apply-update/netbox_v1_ipaddressclaim-update.yaml +++ b/tests/e2e/ipaddress/ipv4/ipaddressclaim-ipv4-apply-update/netbox_v1_ipaddressclaim-update.yaml @@ -1,3 +1,4 @@ +--- apiVersion: netbox.dev/v1 kind: IpAddressClaim metadata: diff --git a/tests/e2e/ipaddress/ipv4/ipaddressclaim-ipv4-apply-update/netbox_v1_ipaddressclaim.yaml b/tests/e2e/ipaddress/ipv4/ipaddressclaim-ipv4-apply-update/netbox_v1_ipaddressclaim.yaml index 0dcc0175..3d04bf32 100644 --- a/tests/e2e/ipaddress/ipv4/ipaddressclaim-ipv4-apply-update/netbox_v1_ipaddressclaim.yaml +++ b/tests/e2e/ipaddress/ipv4/ipaddressclaim-ipv4-apply-update/netbox_v1_ipaddressclaim.yaml @@ -1,3 +1,4 @@ +--- apiVersion: netbox.dev/v1 kind: IpAddressClaim metadata: diff --git a/tests/e2e/ipaddress/ipv4/ipaddressclaim-ipv4-prefixexhausted/chainsaw-test.yaml b/tests/e2e/ipaddress/ipv4/ipaddressclaim-ipv4-prefixexhausted/chainsaw-test.yaml index 68fe6b91..580ce860 100644 --- a/tests/e2e/ipaddress/ipv4/ipaddressclaim-ipv4-prefixexhausted/chainsaw-test.yaml +++ b/tests/e2e/ipaddress/ipv4/ipaddressclaim-ipv4-prefixexhausted/chainsaw-test.yaml @@ -1,3 +1,4 @@ +--- apiVersion: chainsaw.kyverno.io/v1alpha1 kind: Test metadata: @@ -117,7 +118,7 @@ spec: preserveInNetbox: false tenant: MY_TENANT status: - (conditions[?type == 'IPAssigned']): # TODO(jstudler): Change this to Ready, will need change in SetConditionAndCreateEvent to also update Ready condition + (conditions[?type == 'IPAssigned']): # TODO(jstudler): Change this to Ready, will need change in SetConditionAndCreateEvent to also update Ready condition - status: 'False' - assert: resource: @@ -136,7 +137,7 @@ spec: description: Events cleanup required to fix issues with failing tests that assert the wrong Error resource cleanup: - script: - content: | + content: |- kubectl delete events --field-selector involvedObject.name=ipaddressclaim-ipv4-prefixexhausted-1 -n $NAMESPACE kubectl delete events --field-selector involvedObject.name=ipaddressclaim-ipv4-prefixexhausted-2 -n $NAMESPACE kubectl delete events --field-selector involvedObject.name=ipaddressclaim-ipv4-prefixexhausted-3 -n $NAMESPACE diff --git a/tests/e2e/ipaddress/ipv4/ipaddressclaim-ipv4-prefixexhausted/netbox_v1_ipaddressclaim_1.yaml b/tests/e2e/ipaddress/ipv4/ipaddressclaim-ipv4-prefixexhausted/netbox_v1_ipaddressclaim_1.yaml index 74bb7fe9..ba5f8575 100644 --- a/tests/e2e/ipaddress/ipv4/ipaddressclaim-ipv4-prefixexhausted/netbox_v1_ipaddressclaim_1.yaml +++ b/tests/e2e/ipaddress/ipv4/ipaddressclaim-ipv4-prefixexhausted/netbox_v1_ipaddressclaim_1.yaml @@ -1,3 +1,4 @@ +--- apiVersion: netbox.dev/v1 kind: IpAddressClaim metadata: diff --git a/tests/e2e/ipaddress/ipv4/ipaddressclaim-ipv4-prefixexhausted/netbox_v1_ipaddressclaim_2.yaml b/tests/e2e/ipaddress/ipv4/ipaddressclaim-ipv4-prefixexhausted/netbox_v1_ipaddressclaim_2.yaml index 446ec4ba..320b643b 100644 --- a/tests/e2e/ipaddress/ipv4/ipaddressclaim-ipv4-prefixexhausted/netbox_v1_ipaddressclaim_2.yaml +++ b/tests/e2e/ipaddress/ipv4/ipaddressclaim-ipv4-prefixexhausted/netbox_v1_ipaddressclaim_2.yaml @@ -1,3 +1,4 @@ +--- apiVersion: netbox.dev/v1 kind: IpAddressClaim metadata: diff --git a/tests/e2e/ipaddress/ipv4/ipaddressclaim-ipv4-prefixexhausted/netbox_v1_ipaddressclaim_3.yaml b/tests/e2e/ipaddress/ipv4/ipaddressclaim-ipv4-prefixexhausted/netbox_v1_ipaddressclaim_3.yaml index bdf702c2..e2bef0c7 100644 --- a/tests/e2e/ipaddress/ipv4/ipaddressclaim-ipv4-prefixexhausted/netbox_v1_ipaddressclaim_3.yaml +++ b/tests/e2e/ipaddress/ipv4/ipaddressclaim-ipv4-prefixexhausted/netbox_v1_ipaddressclaim_3.yaml @@ -1,3 +1,4 @@ +--- apiVersion: netbox.dev/v1 kind: IpAddressClaim metadata: diff --git a/tests/e2e/ipaddress/ipv4/ipaddressclaim-ipv4-restore/chainsaw-test.yaml b/tests/e2e/ipaddress/ipv4/ipaddressclaim-ipv4-restore/chainsaw-test.yaml index a202d558..59b33bdf 100644 --- a/tests/e2e/ipaddress/ipv4/ipaddressclaim-ipv4-restore/chainsaw-test.yaml +++ b/tests/e2e/ipaddress/ipv4/ipaddressclaim-ipv4-restore/chainsaw-test.yaml @@ -1,3 +1,4 @@ +--- apiVersion: chainsaw.kyverno.io/v1alpha1 kind: Test metadata: @@ -45,7 +46,7 @@ spec: spec: comments: your comments customFields: - netboxOperatorRestorationHash: c7113eab8a61aad6a7618acb510622555d75d0c3 # note that this will require the tests to run in the e2e namespace! + netboxOperatorRestorationHash: c7113eab8a61aad6a7618acb510622555d75d0c3 # note that this will require the tests to run in the e2e namespace! description: some description ipAddress: 3.1.2.1/32 preserveInNetbox: true @@ -146,7 +147,7 @@ spec: spec: comments: your comments customFields: - netboxOperatorRestorationHash: c7113eab8a61aad6a7618acb510622555d75d0c3 # note that this will require the tests to run in the e2e namespace! + netboxOperatorRestorationHash: c7113eab8a61aad6a7618acb510622555d75d0c3 # note that this will require the tests to run in the e2e namespace! description: some description ipAddress: 3.1.2.1/32 preserveInNetbox: true @@ -179,6 +180,6 @@ spec: description: Events cleanup required to fix issues with failing tests that assert the wrong Error resource cleanup: - script: - content: | + content: |- kubectl delete events --field-selector involvedObject.name=ipaddressclaim-ipv4-restore-1 -n $NAMESPACE kubectl delete events --field-selector involvedObject.name=ipaddressclaim-ipv4-restore-2 -n $NAMESPACE diff --git a/tests/e2e/ipaddress/ipv4/ipaddressclaim-ipv4-restore/netbox_v1_ipaddressclaim_1.yaml b/tests/e2e/ipaddress/ipv4/ipaddressclaim-ipv4-restore/netbox_v1_ipaddressclaim_1.yaml index c6aa4db3..2b412e94 100644 --- a/tests/e2e/ipaddress/ipv4/ipaddressclaim-ipv4-restore/netbox_v1_ipaddressclaim_1.yaml +++ b/tests/e2e/ipaddress/ipv4/ipaddressclaim-ipv4-restore/netbox_v1_ipaddressclaim_1.yaml @@ -1,3 +1,4 @@ +--- apiVersion: netbox.dev/v1 kind: IpAddressClaim metadata: diff --git a/tests/e2e/ipaddress/ipv4/ipaddressclaim-ipv4-restore/netbox_v1_ipaddressclaim_2.yaml b/tests/e2e/ipaddress/ipv4/ipaddressclaim-ipv4-restore/netbox_v1_ipaddressclaim_2.yaml index 51e79035..aedbbaa4 100644 --- a/tests/e2e/ipaddress/ipv4/ipaddressclaim-ipv4-restore/netbox_v1_ipaddressclaim_2.yaml +++ b/tests/e2e/ipaddress/ipv4/ipaddressclaim-ipv4-restore/netbox_v1_ipaddressclaim_2.yaml @@ -1,3 +1,4 @@ +--- apiVersion: netbox.dev/v1 kind: IpAddressClaim metadata: diff --git a/tests/e2e/ipaddress/ipv4/ipaddressclaim-ipv4-update-ownerreference/chainsaw-test.yaml b/tests/e2e/ipaddress/ipv4/ipaddressclaim-ipv4-update-ownerreference/chainsaw-test.yaml index 2ed28394..82da008e 100644 --- a/tests/e2e/ipaddress/ipv4/ipaddressclaim-ipv4-update-ownerreference/chainsaw-test.yaml +++ b/tests/e2e/ipaddress/ipv4/ipaddressclaim-ipv4-update-ownerreference/chainsaw-test.yaml @@ -1,3 +1,4 @@ +--- apiVersion: chainsaw.kyverno.io/v1alpha1 kind: Test metadata: @@ -61,7 +62,7 @@ spec: spec: comments: your comments customFields: - netboxOperatorRestorationHash: e93f42d53e5114c6ef44ba878893856411596bbf # note that this will require the tests to run in the e2e namespace! + netboxOperatorRestorationHash: e93f42d53e5114c6ef44ba878893856411596bbf # note that this will require the tests to run in the e2e namespace! description: some description ipAddress: 3.1.3.1/32 tenant: MY_TENANT @@ -72,5 +73,5 @@ spec: description: Events cleanup required to fix issues with failing tests that assert the wrong Error resource cleanup: - script: - content: | + content: |- kubectl delete events --field-selector involvedObject.name=ipaddressclaim-ipv4-update-ownerreference-1 -n $NAMESPACE diff --git a/tests/e2e/ipaddress/ipv4/ipaddressclaim-ipv4-update-ownerreference/netbox_v1_ipaddress_1.yaml b/tests/e2e/ipaddress/ipv4/ipaddressclaim-ipv4-update-ownerreference/netbox_v1_ipaddress_1.yaml index 0c50e4be..3ed7d6c0 100644 --- a/tests/e2e/ipaddress/ipv4/ipaddressclaim-ipv4-update-ownerreference/netbox_v1_ipaddress_1.yaml +++ b/tests/e2e/ipaddress/ipv4/ipaddressclaim-ipv4-update-ownerreference/netbox_v1_ipaddress_1.yaml @@ -1,3 +1,4 @@ +--- apiVersion: netbox.dev/v1 kind: IpAddress metadata: diff --git a/tests/e2e/ipaddress/ipv4/ipaddressclaim-ipv4-update-ownerreference/netbox_v1_ipaddressclaim_1.yaml b/tests/e2e/ipaddress/ipv4/ipaddressclaim-ipv4-update-ownerreference/netbox_v1_ipaddressclaim_1.yaml index 52231de8..dc8ad3f7 100644 --- a/tests/e2e/ipaddress/ipv4/ipaddressclaim-ipv4-update-ownerreference/netbox_v1_ipaddressclaim_1.yaml +++ b/tests/e2e/ipaddress/ipv4/ipaddressclaim-ipv4-update-ownerreference/netbox_v1_ipaddressclaim_1.yaml @@ -1,3 +1,4 @@ +--- apiVersion: netbox.dev/v1 kind: IpAddressClaim metadata: diff --git a/tests/e2e/ipaddress/ipv6/ipaddressclaim-ipv6-apply-update/chainsaw-test.yaml b/tests/e2e/ipaddress/ipv6/ipaddressclaim-ipv6-apply-update/chainsaw-test.yaml index 0e45758c..4bee494c 100644 --- a/tests/e2e/ipaddress/ipv6/ipaddressclaim-ipv6-apply-update/chainsaw-test.yaml +++ b/tests/e2e/ipaddress/ipv6/ipaddressclaim-ipv6-apply-update/chainsaw-test.yaml @@ -1,3 +1,4 @@ +--- apiVersion: chainsaw.kyverno.io/v1alpha1 kind: Test metadata: @@ -110,5 +111,5 @@ spec: description: Events cleanup required to fix issues with failing tests that assert the wrong Error resource cleanup: - script: - content: | + content: |- kubectl delete events --field-selector involvedObject.name=ipaddressclaim-ipv6-apply-update -n $NAMESPACE diff --git a/tests/e2e/ipaddress/ipv6/ipaddressclaim-ipv6-apply-update/netbox_v1_ipaddressclaim-update.yaml b/tests/e2e/ipaddress/ipv6/ipaddressclaim-ipv6-apply-update/netbox_v1_ipaddressclaim-update.yaml index b992e7d9..cc9fc2bb 100644 --- a/tests/e2e/ipaddress/ipv6/ipaddressclaim-ipv6-apply-update/netbox_v1_ipaddressclaim-update.yaml +++ b/tests/e2e/ipaddress/ipv6/ipaddressclaim-ipv6-apply-update/netbox_v1_ipaddressclaim-update.yaml @@ -1,3 +1,4 @@ +--- apiVersion: netbox.dev/v1 kind: IpAddressClaim metadata: diff --git a/tests/e2e/ipaddress/ipv6/ipaddressclaim-ipv6-apply-update/netbox_v1_ipaddressclaim.yaml b/tests/e2e/ipaddress/ipv6/ipaddressclaim-ipv6-apply-update/netbox_v1_ipaddressclaim.yaml index 86aa6562..1c0ca241 100644 --- a/tests/e2e/ipaddress/ipv6/ipaddressclaim-ipv6-apply-update/netbox_v1_ipaddressclaim.yaml +++ b/tests/e2e/ipaddress/ipv6/ipaddressclaim-ipv6-apply-update/netbox_v1_ipaddressclaim.yaml @@ -1,3 +1,4 @@ +--- apiVersion: netbox.dev/v1 kind: IpAddressClaim metadata: diff --git a/tests/e2e/ipaddress/ipv6/ipaddressclaim-ipv6-prefixexhausted/chainsaw-test.yaml b/tests/e2e/ipaddress/ipv6/ipaddressclaim-ipv6-prefixexhausted/chainsaw-test.yaml index 8874d64c..581708bd 100644 --- a/tests/e2e/ipaddress/ipv6/ipaddressclaim-ipv6-prefixexhausted/chainsaw-test.yaml +++ b/tests/e2e/ipaddress/ipv6/ipaddressclaim-ipv6-prefixexhausted/chainsaw-test.yaml @@ -1,3 +1,4 @@ +--- apiVersion: chainsaw.kyverno.io/v1alpha1 kind: Test metadata: @@ -117,7 +118,7 @@ spec: preserveInNetbox: false tenant: MY_TENANT status: - (conditions[?type == 'IPAssigned']): # TODO(jstudler): Change this to Ready, will need change in SetConditionAndCreateEvent to also update Ready condition + (conditions[?type == 'IPAssigned']): # TODO(jstudler): Change this to Ready, will need change in SetConditionAndCreateEvent to also update Ready condition - status: 'False' - assert: resource: @@ -136,7 +137,7 @@ spec: description: Events cleanup required to fix issues with failing tests that assert the wrong Error resource cleanup: - script: - content: | + content: |- kubectl delete events --field-selector involvedObject.name=ipaddressclaim-ipv6-prefixexhausted-1 -n $NAMESPACE kubectl delete events --field-selector involvedObject.name=ipaddressclaim-ipv6-prefixexhausted-2 -n $NAMESPACE kubectl delete events --field-selector involvedObject.name=ipaddressclaim-ipv6-prefixexhausted-3 -n $NAMESPACE diff --git a/tests/e2e/ipaddress/ipv6/ipaddressclaim-ipv6-prefixexhausted/netbox_v1_ipaddressclaim_1.yaml b/tests/e2e/ipaddress/ipv6/ipaddressclaim-ipv6-prefixexhausted/netbox_v1_ipaddressclaim_1.yaml index 8f6c850f..f0b5f555 100644 --- a/tests/e2e/ipaddress/ipv6/ipaddressclaim-ipv6-prefixexhausted/netbox_v1_ipaddressclaim_1.yaml +++ b/tests/e2e/ipaddress/ipv6/ipaddressclaim-ipv6-prefixexhausted/netbox_v1_ipaddressclaim_1.yaml @@ -1,3 +1,4 @@ +--- apiVersion: netbox.dev/v1 kind: IpAddressClaim metadata: diff --git a/tests/e2e/ipaddress/ipv6/ipaddressclaim-ipv6-prefixexhausted/netbox_v1_ipaddressclaim_2.yaml b/tests/e2e/ipaddress/ipv6/ipaddressclaim-ipv6-prefixexhausted/netbox_v1_ipaddressclaim_2.yaml index 149cb176..5ee6677f 100644 --- a/tests/e2e/ipaddress/ipv6/ipaddressclaim-ipv6-prefixexhausted/netbox_v1_ipaddressclaim_2.yaml +++ b/tests/e2e/ipaddress/ipv6/ipaddressclaim-ipv6-prefixexhausted/netbox_v1_ipaddressclaim_2.yaml @@ -1,3 +1,4 @@ +--- apiVersion: netbox.dev/v1 kind: IpAddressClaim metadata: diff --git a/tests/e2e/ipaddress/ipv6/ipaddressclaim-ipv6-prefixexhausted/netbox_v1_ipaddressclaim_3.yaml b/tests/e2e/ipaddress/ipv6/ipaddressclaim-ipv6-prefixexhausted/netbox_v1_ipaddressclaim_3.yaml index c0e44c97..02619580 100644 --- a/tests/e2e/ipaddress/ipv6/ipaddressclaim-ipv6-prefixexhausted/netbox_v1_ipaddressclaim_3.yaml +++ b/tests/e2e/ipaddress/ipv6/ipaddressclaim-ipv6-prefixexhausted/netbox_v1_ipaddressclaim_3.yaml @@ -1,3 +1,4 @@ +--- apiVersion: netbox.dev/v1 kind: IpAddressClaim metadata: diff --git a/tests/e2e/ipaddress/ipv6/ipaddressclaim-ipv6-restore/chainsaw-test.yaml b/tests/e2e/ipaddress/ipv6/ipaddressclaim-ipv6-restore/chainsaw-test.yaml index 29af423f..1126c35e 100644 --- a/tests/e2e/ipaddress/ipv6/ipaddressclaim-ipv6-restore/chainsaw-test.yaml +++ b/tests/e2e/ipaddress/ipv6/ipaddressclaim-ipv6-restore/chainsaw-test.yaml @@ -1,3 +1,4 @@ +--- apiVersion: chainsaw.kyverno.io/v1alpha1 kind: Test metadata: @@ -45,7 +46,7 @@ spec: spec: comments: your comments customFields: - netboxOperatorRestorationHash: bf12294d295d4dadec934bc511dfaa78a87e171b # note that this will require the tests to run in the e2e namespace! + netboxOperatorRestorationHash: bf12294d295d4dadec934bc511dfaa78a87e171b # note that this will require the tests to run in the e2e namespace! description: some description ipAddress: 3:1:2::1/128 preserveInNetbox: true @@ -146,7 +147,7 @@ spec: spec: comments: your comments customFields: - netboxOperatorRestorationHash: bf12294d295d4dadec934bc511dfaa78a87e171b # note that this will require the tests to run in the e2e namespace! + netboxOperatorRestorationHash: bf12294d295d4dadec934bc511dfaa78a87e171b # note that this will require the tests to run in the e2e namespace! description: some description ipAddress: 3:1:2::1/128 preserveInNetbox: true @@ -179,6 +180,6 @@ spec: description: Events cleanup required to fix issues with failing tests that assert the wrong Error resource cleanup: - script: - content: | + content: |- kubectl delete events --field-selector involvedObject.name=ipaddressclaim-ipv6-restore-1 -n $NAMESPACE kubectl delete events --field-selector involvedObject.name=ipaddressclaim-ipv6-restore-2 -n $NAMESPACE diff --git a/tests/e2e/ipaddress/ipv6/ipaddressclaim-ipv6-restore/netbox_v1_ipaddressclaim_1.yaml b/tests/e2e/ipaddress/ipv6/ipaddressclaim-ipv6-restore/netbox_v1_ipaddressclaim_1.yaml index 0b5c0046..a50a52ec 100644 --- a/tests/e2e/ipaddress/ipv6/ipaddressclaim-ipv6-restore/netbox_v1_ipaddressclaim_1.yaml +++ b/tests/e2e/ipaddress/ipv6/ipaddressclaim-ipv6-restore/netbox_v1_ipaddressclaim_1.yaml @@ -1,3 +1,4 @@ +--- apiVersion: netbox.dev/v1 kind: IpAddressClaim metadata: diff --git a/tests/e2e/ipaddress/ipv6/ipaddressclaim-ipv6-restore/netbox_v1_ipaddressclaim_2.yaml b/tests/e2e/ipaddress/ipv6/ipaddressclaim-ipv6-restore/netbox_v1_ipaddressclaim_2.yaml index e82b5a34..9b7f4b9b 100644 --- a/tests/e2e/ipaddress/ipv6/ipaddressclaim-ipv6-restore/netbox_v1_ipaddressclaim_2.yaml +++ b/tests/e2e/ipaddress/ipv6/ipaddressclaim-ipv6-restore/netbox_v1_ipaddressclaim_2.yaml @@ -1,3 +1,4 @@ +--- apiVersion: netbox.dev/v1 kind: IpAddressClaim metadata: diff --git a/tests/e2e/iprange/ipv4/iprangeclaim-ipv4-apply-update/chainsaw-test.yaml b/tests/e2e/iprange/ipv4/iprangeclaim-ipv4-apply-update/chainsaw-test.yaml index 167fc90e..71b7bb85 100644 --- a/tests/e2e/iprange/ipv4/iprangeclaim-ipv4-apply-update/chainsaw-test.yaml +++ b/tests/e2e/iprange/ipv4/iprangeclaim-ipv4-apply-update/chainsaw-test.yaml @@ -1,3 +1,4 @@ +--- apiVersion: chainsaw.kyverno.io/v1alpha1 kind: Test metadata: @@ -120,7 +121,7 @@ spec: description: Events cleanup required to fix issues with failing tests that assert the wrong Error resource and lease cleanup for preventing delays when using the same prefixes (e.g. with "invalid" tests) cleanup: - script: - content: | + content: |- LEASES=$(kubectl -n netbox-operator-system get lease -oname | grep -v netbox) # to be enhanced in usage of leaselocker if [ -n "$LEASES" ]; then echo "$LEASES" | xargs -n1 kubectl -n netbox-operator-system delete diff --git a/tests/e2e/iprange/ipv4/iprangeclaim-ipv4-apply-update/netbox_v1_iprangeclaim-update.yaml b/tests/e2e/iprange/ipv4/iprangeclaim-ipv4-apply-update/netbox_v1_iprangeclaim-update.yaml index 028a21b2..dfe3d77f 100644 --- a/tests/e2e/iprange/ipv4/iprangeclaim-ipv4-apply-update/netbox_v1_iprangeclaim-update.yaml +++ b/tests/e2e/iprange/ipv4/iprangeclaim-ipv4-apply-update/netbox_v1_iprangeclaim-update.yaml @@ -1,3 +1,4 @@ +--- apiVersion: netbox.dev/v1 kind: IpRangeClaim metadata: diff --git a/tests/e2e/iprange/ipv4/iprangeclaim-ipv4-apply-update/netbox_v1_iprangeclaim.yaml b/tests/e2e/iprange/ipv4/iprangeclaim-ipv4-apply-update/netbox_v1_iprangeclaim.yaml index 1a6d3fba..b2e06eb5 100644 --- a/tests/e2e/iprange/ipv4/iprangeclaim-ipv4-apply-update/netbox_v1_iprangeclaim.yaml +++ b/tests/e2e/iprange/ipv4/iprangeclaim-ipv4-apply-update/netbox_v1_iprangeclaim.yaml @@ -1,3 +1,4 @@ +--- apiVersion: netbox.dev/v1 kind: IpRangeClaim metadata: diff --git a/tests/e2e/iprange/ipv4/iprangeclaim-ipv4-invalid-cidr/chainsaw-test.yaml b/tests/e2e/iprange/ipv4/iprangeclaim-ipv4-invalid-cidr/chainsaw-test.yaml index 67ec8af4..20e19641 100644 --- a/tests/e2e/iprange/ipv4/iprangeclaim-ipv4-invalid-cidr/chainsaw-test.yaml +++ b/tests/e2e/iprange/ipv4/iprangeclaim-ipv4-invalid-cidr/chainsaw-test.yaml @@ -1,3 +1,4 @@ +--- apiVersion: chainsaw.kyverno.io/v1alpha1 kind: Test metadata: @@ -17,7 +18,7 @@ spec: description: Events cleanup required to fix issues with failing tests that assert the wrong Error resource and lease cleanup for preventing delays when using the same prefixes (e.g. with "invalid" tests) cleanup: - script: - content: | + content: |- LEASES=$(kubectl -n netbox-operator-system get lease -oname | grep -v netbox) # to be enhanced in usage of leaselocker if [ -n "$LEASES" ]; then echo "$LEASES" | xargs -n1 kubectl -n netbox-operator-system delete diff --git a/tests/e2e/iprange/ipv4/iprangeclaim-ipv4-invalid-cidr/netbox_v1_iprangeclaim.yaml b/tests/e2e/iprange/ipv4/iprangeclaim-ipv4-invalid-cidr/netbox_v1_iprangeclaim.yaml index fa1aa7c2..9994b7d1 100644 --- a/tests/e2e/iprange/ipv4/iprangeclaim-ipv4-invalid-cidr/netbox_v1_iprangeclaim.yaml +++ b/tests/e2e/iprange/ipv4/iprangeclaim-ipv4-invalid-cidr/netbox_v1_iprangeclaim.yaml @@ -1,3 +1,4 @@ +--- apiVersion: netbox.dev/v1 kind: IpRangeClaim metadata: diff --git a/tests/e2e/iprange/ipv4/iprangeclaim-ipv4-invalid-customfieldnotexisting/chainsaw-test.yaml b/tests/e2e/iprange/ipv4/iprangeclaim-ipv4-invalid-customfieldnotexisting/chainsaw-test.yaml index d2aa444d..449dc58d 100644 --- a/tests/e2e/iprange/ipv4/iprangeclaim-ipv4-invalid-customfieldnotexisting/chainsaw-test.yaml +++ b/tests/e2e/iprange/ipv4/iprangeclaim-ipv4-invalid-customfieldnotexisting/chainsaw-test.yaml @@ -1,3 +1,4 @@ +--- apiVersion: chainsaw.kyverno.io/v1alpha1 kind: Test metadata: @@ -63,7 +64,7 @@ spec: description: Events cleanup required to fix issues with failing tests that assert the wrong Error resource and lease cleanup for preventing delays when using the same prefixes (e.g. with "invalid" tests) cleanup: - script: - content: | + content: |- LEASES=$(kubectl -n netbox-operator-system get lease -oname | grep -v netbox) # to be enhanced in usage of leaselocker if [ -n "$LEASES" ]; then echo "$LEASES" | xargs -n1 kubectl -n netbox-operator-system delete diff --git a/tests/e2e/iprange/ipv4/iprangeclaim-ipv4-invalid-customfieldnotexisting/netbox_v1_iprangeclaim.yaml b/tests/e2e/iprange/ipv4/iprangeclaim-ipv4-invalid-customfieldnotexisting/netbox_v1_iprangeclaim.yaml index 6a5c953c..9997d8f7 100644 --- a/tests/e2e/iprange/ipv4/iprangeclaim-ipv4-invalid-customfieldnotexisting/netbox_v1_iprangeclaim.yaml +++ b/tests/e2e/iprange/ipv4/iprangeclaim-ipv4-invalid-customfieldnotexisting/netbox_v1_iprangeclaim.yaml @@ -1,3 +1,4 @@ +--- apiVersion: netbox.dev/v1 kind: IpRangeClaim metadata: diff --git a/tests/e2e/iprange/ipv4/iprangeclaim-ipv4-invalid-customfieldwrongdatatype/chainsaw-test.yaml b/tests/e2e/iprange/ipv4/iprangeclaim-ipv4-invalid-customfieldwrongdatatype/chainsaw-test.yaml index 499aaeec..296f0b51 100644 --- a/tests/e2e/iprange/ipv4/iprangeclaim-ipv4-invalid-customfieldwrongdatatype/chainsaw-test.yaml +++ b/tests/e2e/iprange/ipv4/iprangeclaim-ipv4-invalid-customfieldwrongdatatype/chainsaw-test.yaml @@ -1,3 +1,4 @@ +--- apiVersion: chainsaw.kyverno.io/v1alpha1 kind: Test metadata: @@ -63,7 +64,7 @@ spec: description: Events cleanup required to fix issues with failing tests that assert the wrong Error resource and lease cleanup for preventing delays when using the same prefixes (e.g. with "invalid" tests) cleanup: - script: - content: | + content: |- LEASES=$(kubectl -n netbox-operator-system get lease -oname | grep -v netbox) # to be enhanced in usage of leaselocker if [ -n "$LEASES" ]; then echo "$LEASES" | xargs -n1 kubectl -n netbox-operator-system delete diff --git a/tests/e2e/iprange/ipv4/iprangeclaim-ipv4-invalid-customfieldwrongdatatype/netbox_v1_iprangeclaim.yaml b/tests/e2e/iprange/ipv4/iprangeclaim-ipv4-invalid-customfieldwrongdatatype/netbox_v1_iprangeclaim.yaml index fc668892..6eb17aa1 100644 --- a/tests/e2e/iprange/ipv4/iprangeclaim-ipv4-invalid-customfieldwrongdatatype/netbox_v1_iprangeclaim.yaml +++ b/tests/e2e/iprange/ipv4/iprangeclaim-ipv4-invalid-customfieldwrongdatatype/netbox_v1_iprangeclaim.yaml @@ -1,3 +1,4 @@ +--- apiVersion: netbox.dev/v1 kind: IpRangeClaim metadata: diff --git a/tests/e2e/iprange/ipv4/iprangeclaim-ipv4-invalid-parentprefix/chainsaw-test.yaml b/tests/e2e/iprange/ipv4/iprangeclaim-ipv4-invalid-parentprefix/chainsaw-test.yaml index 24ad0f99..5f04d2e9 100644 --- a/tests/e2e/iprange/ipv4/iprangeclaim-ipv4-invalid-parentprefix/chainsaw-test.yaml +++ b/tests/e2e/iprange/ipv4/iprangeclaim-ipv4-invalid-parentprefix/chainsaw-test.yaml @@ -1,3 +1,4 @@ +--- apiVersion: chainsaw.kyverno.io/v1alpha1 kind: Test metadata: @@ -37,7 +38,7 @@ spec: description: Events cleanup required to fix issues with failing tests that assert the wrong Error resource and lease cleanup for preventing delays when using the same prefixes (e.g. with "invalid" tests) cleanup: - script: - content: | + content: |- LEASES=$(kubectl -n netbox-operator-system get lease -oname | grep -v netbox) # to be enhanced in usage of leaselocker if [ -n "$LEASES" ]; then echo "$LEASES" | xargs -n1 kubectl -n netbox-operator-system delete diff --git a/tests/e2e/iprange/ipv4/iprangeclaim-ipv4-invalid-parentprefix/netbox_v1_iprangeclaim.yaml b/tests/e2e/iprange/ipv4/iprangeclaim-ipv4-invalid-parentprefix/netbox_v1_iprangeclaim.yaml index e7095fbf..dd494e1e 100644 --- a/tests/e2e/iprange/ipv4/iprangeclaim-ipv4-invalid-parentprefix/netbox_v1_iprangeclaim.yaml +++ b/tests/e2e/iprange/ipv4/iprangeclaim-ipv4-invalid-parentprefix/netbox_v1_iprangeclaim.yaml @@ -1,3 +1,4 @@ +--- apiVersion: netbox.dev/v1 kind: IpRangeClaim metadata: diff --git a/tests/e2e/iprange/ipv4/iprangeclaim-ipv4-invalid-size/chainsaw-test.yaml b/tests/e2e/iprange/ipv4/iprangeclaim-ipv4-invalid-size/chainsaw-test.yaml index b7099608..6f3221ae 100644 --- a/tests/e2e/iprange/ipv4/iprangeclaim-ipv4-invalid-size/chainsaw-test.yaml +++ b/tests/e2e/iprange/ipv4/iprangeclaim-ipv4-invalid-size/chainsaw-test.yaml @@ -1,3 +1,4 @@ +--- apiVersion: chainsaw.kyverno.io/v1alpha1 kind: Test metadata: @@ -17,7 +18,7 @@ spec: description: Events cleanup required to fix issues with failing tests that assert the wrong Error resource and lease cleanup for preventing delays when using the same prefixes (e.g. with "invalid" tests) cleanup: - script: - content: | + content: |- LEASES=$(kubectl -n netbox-operator-system get lease -oname | grep -v netbox) # to be enhanced in usage of leaselocker if [ -n "$LEASES" ]; then echo "$LEASES" | xargs -n1 kubectl -n netbox-operator-system delete diff --git a/tests/e2e/iprange/ipv4/iprangeclaim-ipv4-invalid-size/netbox_v1_iprangeclaim.yaml b/tests/e2e/iprange/ipv4/iprangeclaim-ipv4-invalid-size/netbox_v1_iprangeclaim.yaml index 5bcdcb9c..afb78a0c 100644 --- a/tests/e2e/iprange/ipv4/iprangeclaim-ipv4-invalid-size/netbox_v1_iprangeclaim.yaml +++ b/tests/e2e/iprange/ipv4/iprangeclaim-ipv4-invalid-size/netbox_v1_iprangeclaim.yaml @@ -1,3 +1,4 @@ +--- apiVersion: netbox.dev/v1 kind: IpRangeClaim metadata: diff --git a/tests/e2e/iprange/ipv4/iprangeclaim-ipv4-invalid-tenant/chainsaw-test.yaml b/tests/e2e/iprange/ipv4/iprangeclaim-ipv4-invalid-tenant/chainsaw-test.yaml index 56de3a02..5e43055b 100644 --- a/tests/e2e/iprange/ipv4/iprangeclaim-ipv4-invalid-tenant/chainsaw-test.yaml +++ b/tests/e2e/iprange/ipv4/iprangeclaim-ipv4-invalid-tenant/chainsaw-test.yaml @@ -1,3 +1,4 @@ +--- apiVersion: chainsaw.kyverno.io/v1alpha1 kind: Test metadata: @@ -43,7 +44,7 @@ spec: description: Events cleanup required to fix issues with failing tests that assert the wrong Error resource and lease cleanup for preventing delays when using the same prefixes (e.g. with "invalid" tests) cleanup: - script: - content: | + content: |- LEASES=$(kubectl -n netbox-operator-system get lease -oname | grep -v netbox) # to be enhanced in usage of leaselocker if [ -n "$LEASES" ]; then echo "$LEASES" | xargs -n1 kubectl -n netbox-operator-system delete diff --git a/tests/e2e/iprange/ipv4/iprangeclaim-ipv4-invalid-tenant/netbox_v1_iprangeclaim.yaml b/tests/e2e/iprange/ipv4/iprangeclaim-ipv4-invalid-tenant/netbox_v1_iprangeclaim.yaml index c5331315..9329b407 100644 --- a/tests/e2e/iprange/ipv4/iprangeclaim-ipv4-invalid-tenant/netbox_v1_iprangeclaim.yaml +++ b/tests/e2e/iprange/ipv4/iprangeclaim-ipv4-invalid-tenant/netbox_v1_iprangeclaim.yaml @@ -1,3 +1,4 @@ +--- apiVersion: netbox.dev/v1 kind: IpRangeClaim metadata: diff --git a/tests/e2e/iprange/ipv4/iprangeclaim-ipv4-prefixexhausted/chainsaw-test.yaml b/tests/e2e/iprange/ipv4/iprangeclaim-ipv4-prefixexhausted/chainsaw-test.yaml index 594ff8b0..2c7ae2bc 100644 --- a/tests/e2e/iprange/ipv4/iprangeclaim-ipv4-prefixexhausted/chainsaw-test.yaml +++ b/tests/e2e/iprange/ipv4/iprangeclaim-ipv4-prefixexhausted/chainsaw-test.yaml @@ -1,3 +1,4 @@ +--- apiVersion: chainsaw.kyverno.io/v1alpha1 kind: Test metadata: @@ -126,7 +127,7 @@ spec: size: 30 tenant: MY_TENANT status: - (conditions[?type == 'IPRangeAssigned']): # TODO(jstudler): Change this to Ready, will need change in SetConditionAndCreateEvent to also update Ready condition + (conditions[?type == 'IPRangeAssigned']): # TODO(jstudler): Change this to Ready, will need change in SetConditionAndCreateEvent to also update Ready condition - status: 'False' - assert: resource: @@ -145,7 +146,7 @@ spec: description: Events cleanup required to fix issues with failing tests that assert the wrong Error resource and lease cleanup for preventing delays when using the same prefixes (e.g. with "invalid" tests) cleanup: - script: - content: | + content: |- LEASES=$(kubectl -n netbox-operator-system get lease -oname | grep -v netbox) # to be enhanced in usage of leaselocker if [ -n "$LEASES" ]; then echo "$LEASES" | xargs -n1 kubectl -n netbox-operator-system delete diff --git a/tests/e2e/iprange/ipv4/iprangeclaim-ipv4-prefixexhausted/netbox_v1_iprangeclaim_1.yaml b/tests/e2e/iprange/ipv4/iprangeclaim-ipv4-prefixexhausted/netbox_v1_iprangeclaim_1.yaml index e1f8cd07..54625b7f 100644 --- a/tests/e2e/iprange/ipv4/iprangeclaim-ipv4-prefixexhausted/netbox_v1_iprangeclaim_1.yaml +++ b/tests/e2e/iprange/ipv4/iprangeclaim-ipv4-prefixexhausted/netbox_v1_iprangeclaim_1.yaml @@ -1,3 +1,4 @@ +--- apiVersion: netbox.dev/v1 kind: IpRangeClaim metadata: diff --git a/tests/e2e/iprange/ipv4/iprangeclaim-ipv4-prefixexhausted/netbox_v1_iprangeclaim_2.yaml b/tests/e2e/iprange/ipv4/iprangeclaim-ipv4-prefixexhausted/netbox_v1_iprangeclaim_2.yaml index 3eee358a..4665d00a 100644 --- a/tests/e2e/iprange/ipv4/iprangeclaim-ipv4-prefixexhausted/netbox_v1_iprangeclaim_2.yaml +++ b/tests/e2e/iprange/ipv4/iprangeclaim-ipv4-prefixexhausted/netbox_v1_iprangeclaim_2.yaml @@ -1,3 +1,4 @@ +--- apiVersion: netbox.dev/v1 kind: IpRangeClaim metadata: diff --git a/tests/e2e/iprange/ipv4/iprangeclaim-ipv4-prefixexhausted/netbox_v1_iprangeclaim_3.yaml b/tests/e2e/iprange/ipv4/iprangeclaim-ipv4-prefixexhausted/netbox_v1_iprangeclaim_3.yaml index 7d6d3542..58a4df99 100644 --- a/tests/e2e/iprange/ipv4/iprangeclaim-ipv4-prefixexhausted/netbox_v1_iprangeclaim_3.yaml +++ b/tests/e2e/iprange/ipv4/iprangeclaim-ipv4-prefixexhausted/netbox_v1_iprangeclaim_3.yaml @@ -1,3 +1,4 @@ +--- apiVersion: netbox.dev/v1 kind: IpRangeClaim metadata: diff --git a/tests/e2e/iprange/ipv4/iprangeclaim-ipv4-restore/chainsaw-test.yaml b/tests/e2e/iprange/ipv4/iprangeclaim-ipv4-restore/chainsaw-test.yaml index 9542419f..962bd36a 100644 --- a/tests/e2e/iprange/ipv4/iprangeclaim-ipv4-restore/chainsaw-test.yaml +++ b/tests/e2e/iprange/ipv4/iprangeclaim-ipv4-restore/chainsaw-test.yaml @@ -1,3 +1,4 @@ +--- apiVersion: chainsaw.kyverno.io/v1alpha1 kind: Test metadata: @@ -50,7 +51,7 @@ spec: spec: comments: your comments customFields: - netboxOperatorRestorationHash: 86776d57746f3262ef6f450b58c375e835bd914c # note that this will require the tests to run in the e2e namespace! + netboxOperatorRestorationHash: 86776d57746f3262ef6f450b58c375e835bd914c # note that this will require the tests to run in the e2e namespace! description: some description startAddress: 3.2.2.1/32 endAddress: 3.2.2.30/32 @@ -162,7 +163,7 @@ spec: spec: comments: your comments customFields: - netboxOperatorRestorationHash: 86776d57746f3262ef6f450b58c375e835bd914c # note that this will require the tests to run in the e2e namespace! + netboxOperatorRestorationHash: 86776d57746f3262ef6f450b58c375e835bd914c # note that this will require the tests to run in the e2e namespace! description: some description startAddress: 3.2.2.1/32 endAddress: 3.2.2.30/32 @@ -196,7 +197,7 @@ spec: description: Events cleanup required to fix issues with failing tests that assert the wrong Error resource and lease cleanup for preventing delays when using the same prefixes (e.g. with "invalid" tests) cleanup: - script: - content: | + content: |- LEASES=$(kubectl -n netbox-operator-system get lease -oname | grep -v netbox) # to be enhanced in usage of leaselocker if [ -n "$LEASES" ]; then echo "$LEASES" | xargs -n1 kubectl -n netbox-operator-system delete diff --git a/tests/e2e/iprange/ipv4/iprangeclaim-ipv4-restore/netbox_v1_iprangeclaim_1.yaml b/tests/e2e/iprange/ipv4/iprangeclaim-ipv4-restore/netbox_v1_iprangeclaim_1.yaml index c150e949..34babb25 100644 --- a/tests/e2e/iprange/ipv4/iprangeclaim-ipv4-restore/netbox_v1_iprangeclaim_1.yaml +++ b/tests/e2e/iprange/ipv4/iprangeclaim-ipv4-restore/netbox_v1_iprangeclaim_1.yaml @@ -1,3 +1,4 @@ +--- apiVersion: netbox.dev/v1 kind: IpRangeClaim metadata: diff --git a/tests/e2e/iprange/ipv4/iprangeclaim-ipv4-restore/netbox_v1_iprangeclaim_2.yaml b/tests/e2e/iprange/ipv4/iprangeclaim-ipv4-restore/netbox_v1_iprangeclaim_2.yaml index 1f062c7e..5045aadc 100644 --- a/tests/e2e/iprange/ipv4/iprangeclaim-ipv4-restore/netbox_v1_iprangeclaim_2.yaml +++ b/tests/e2e/iprange/ipv4/iprangeclaim-ipv4-restore/netbox_v1_iprangeclaim_2.yaml @@ -1,3 +1,4 @@ +--- apiVersion: netbox.dev/v1 kind: IpRangeClaim metadata: diff --git a/tests/e2e/iprange/ipv4/iprangeclaim-ipv4-update-ownerreference/chainsaw-test.yaml b/tests/e2e/iprange/ipv4/iprangeclaim-ipv4-update-ownerreference/chainsaw-test.yaml index 3ce686b7..434d50ef 100644 --- a/tests/e2e/iprange/ipv4/iprangeclaim-ipv4-update-ownerreference/chainsaw-test.yaml +++ b/tests/e2e/iprange/ipv4/iprangeclaim-ipv4-update-ownerreference/chainsaw-test.yaml @@ -1,3 +1,4 @@ +--- apiVersion: chainsaw.kyverno.io/v1alpha1 kind: Test metadata: @@ -78,5 +79,5 @@ spec: description: Events cleanup required to fix issues with failing tests that assert the wrong Error resource cleanup: - script: - content: | + content: |- kubectl delete events --field-selector involvedObject.name=iprangeclaim-ipv4-update-ownerreference-1 -n $NAMESPACE diff --git a/tests/e2e/iprange/ipv4/iprangeclaim-ipv4-update-ownerreference/netbox_v1_iprange_1.yaml b/tests/e2e/iprange/ipv4/iprangeclaim-ipv4-update-ownerreference/netbox_v1_iprange_1.yaml index b5a92911..1ca43e3e 100644 --- a/tests/e2e/iprange/ipv4/iprangeclaim-ipv4-update-ownerreference/netbox_v1_iprange_1.yaml +++ b/tests/e2e/iprange/ipv4/iprangeclaim-ipv4-update-ownerreference/netbox_v1_iprange_1.yaml @@ -1,3 +1,4 @@ +--- apiVersion: netbox.dev/v1 kind: IpRange metadata: diff --git a/tests/e2e/iprange/ipv4/iprangeclaim-ipv4-update-ownerreference/netbox_v1_iprangeclaim_1.yaml b/tests/e2e/iprange/ipv4/iprangeclaim-ipv4-update-ownerreference/netbox_v1_iprangeclaim_1.yaml index af8b6fba..0ad1ca46 100644 --- a/tests/e2e/iprange/ipv4/iprangeclaim-ipv4-update-ownerreference/netbox_v1_iprangeclaim_1.yaml +++ b/tests/e2e/iprange/ipv4/iprangeclaim-ipv4-update-ownerreference/netbox_v1_iprangeclaim_1.yaml @@ -1,3 +1,4 @@ +--- apiVersion: netbox.dev/v1 kind: IpRangeClaim metadata: diff --git a/tests/e2e/iprange/ipv6/iprangeclaim-ipv6-apply-update/chainsaw-test.yaml b/tests/e2e/iprange/ipv6/iprangeclaim-ipv6-apply-update/chainsaw-test.yaml index 108b7076..8657b581 100644 --- a/tests/e2e/iprange/ipv6/iprangeclaim-ipv6-apply-update/chainsaw-test.yaml +++ b/tests/e2e/iprange/ipv6/iprangeclaim-ipv6-apply-update/chainsaw-test.yaml @@ -1,3 +1,4 @@ +--- apiVersion: chainsaw.kyverno.io/v1alpha1 kind: Test metadata: @@ -120,7 +121,7 @@ spec: description: Events cleanup required to fix issues with failing tests that assert the wrong Error resource and lease cleanup for preventing delays when using the same prefixes (e.g. with "invalid" tests) cleanup: - script: - content: | + content: |- LEASES=$(kubectl -n netbox-operator-system get lease -oname | grep -v netbox) # to be enhanced in usage of leaselocker if [ -n "$LEASES" ]; then echo "$LEASES" | xargs -n1 kubectl -n netbox-operator-system delete diff --git a/tests/e2e/iprange/ipv6/iprangeclaim-ipv6-apply-update/netbox_v1_iprangeclaim-update.yaml b/tests/e2e/iprange/ipv6/iprangeclaim-ipv6-apply-update/netbox_v1_iprangeclaim-update.yaml index 24aa7f31..402d1e2b 100644 --- a/tests/e2e/iprange/ipv6/iprangeclaim-ipv6-apply-update/netbox_v1_iprangeclaim-update.yaml +++ b/tests/e2e/iprange/ipv6/iprangeclaim-ipv6-apply-update/netbox_v1_iprangeclaim-update.yaml @@ -1,3 +1,4 @@ +--- apiVersion: netbox.dev/v1 kind: IpRangeClaim metadata: diff --git a/tests/e2e/iprange/ipv6/iprangeclaim-ipv6-apply-update/netbox_v1_iprangeclaim.yaml b/tests/e2e/iprange/ipv6/iprangeclaim-ipv6-apply-update/netbox_v1_iprangeclaim.yaml index 369e771b..a9b0431c 100644 --- a/tests/e2e/iprange/ipv6/iprangeclaim-ipv6-apply-update/netbox_v1_iprangeclaim.yaml +++ b/tests/e2e/iprange/ipv6/iprangeclaim-ipv6-apply-update/netbox_v1_iprangeclaim.yaml @@ -1,3 +1,4 @@ +--- apiVersion: netbox.dev/v1 kind: IpRangeClaim metadata: diff --git a/tests/e2e/iprange/ipv6/iprangeclaim-ipv6-prefixexhausted/chainsaw-test.yaml b/tests/e2e/iprange/ipv6/iprangeclaim-ipv6-prefixexhausted/chainsaw-test.yaml index 82dc3a01..69c2fff0 100644 --- a/tests/e2e/iprange/ipv6/iprangeclaim-ipv6-prefixexhausted/chainsaw-test.yaml +++ b/tests/e2e/iprange/ipv6/iprangeclaim-ipv6-prefixexhausted/chainsaw-test.yaml @@ -1,3 +1,4 @@ +--- apiVersion: chainsaw.kyverno.io/v1alpha1 kind: Test metadata: @@ -127,7 +128,7 @@ spec: size: 30 tenant: MY_TENANT status: - (conditions[?type == 'IPRangeAssigned']): # TODO(jstudler): Change this to Ready, will need change in SetConditionAndCreateEvent to also update Ready condition + (conditions[?type == 'IPRangeAssigned']): # TODO(jstudler): Change this to Ready, will need change in SetConditionAndCreateEvent to also update Ready condition - status: 'False' - assert: resource: @@ -146,7 +147,7 @@ spec: description: Events cleanup required to fix issues with failing tests that assert the wrong Error resource and lease cleanup for preventing delays when using the same prefixes (e.g. with "invalid" tests) cleanup: - script: - content: | + content: |- LEASES=$(kubectl -n netbox-operator-system get lease -oname | grep -v netbox) # to be enhanced in usage of leaselocker if [ -n "$LEASES" ]; then echo "$LEASES" | xargs -n1 kubectl -n netbox-operator-system delete diff --git a/tests/e2e/iprange/ipv6/iprangeclaim-ipv6-prefixexhausted/netbox_v1_iprangeclaim_1.yaml b/tests/e2e/iprange/ipv6/iprangeclaim-ipv6-prefixexhausted/netbox_v1_iprangeclaim_1.yaml index af3bf2f7..8a8320e6 100644 --- a/tests/e2e/iprange/ipv6/iprangeclaim-ipv6-prefixexhausted/netbox_v1_iprangeclaim_1.yaml +++ b/tests/e2e/iprange/ipv6/iprangeclaim-ipv6-prefixexhausted/netbox_v1_iprangeclaim_1.yaml @@ -1,3 +1,4 @@ +--- apiVersion: netbox.dev/v1 kind: IpRangeClaim metadata: diff --git a/tests/e2e/iprange/ipv6/iprangeclaim-ipv6-prefixexhausted/netbox_v1_iprangeclaim_2.yaml b/tests/e2e/iprange/ipv6/iprangeclaim-ipv6-prefixexhausted/netbox_v1_iprangeclaim_2.yaml index 19bd62ea..ed30ba38 100644 --- a/tests/e2e/iprange/ipv6/iprangeclaim-ipv6-prefixexhausted/netbox_v1_iprangeclaim_2.yaml +++ b/tests/e2e/iprange/ipv6/iprangeclaim-ipv6-prefixexhausted/netbox_v1_iprangeclaim_2.yaml @@ -1,3 +1,4 @@ +--- apiVersion: netbox.dev/v1 kind: IpRangeClaim metadata: diff --git a/tests/e2e/iprange/ipv6/iprangeclaim-ipv6-prefixexhausted/netbox_v1_iprangeclaim_3.yaml b/tests/e2e/iprange/ipv6/iprangeclaim-ipv6-prefixexhausted/netbox_v1_iprangeclaim_3.yaml index c734ff84..555a2c4c 100644 --- a/tests/e2e/iprange/ipv6/iprangeclaim-ipv6-prefixexhausted/netbox_v1_iprangeclaim_3.yaml +++ b/tests/e2e/iprange/ipv6/iprangeclaim-ipv6-prefixexhausted/netbox_v1_iprangeclaim_3.yaml @@ -1,3 +1,4 @@ +--- apiVersion: netbox.dev/v1 kind: IpRangeClaim metadata: diff --git a/tests/e2e/iprange/ipv6/iprangeclaim-ipv6-restore/chainsaw-test.yaml b/tests/e2e/iprange/ipv6/iprangeclaim-ipv6-restore/chainsaw-test.yaml index aa3c07c3..04bf0bc7 100644 --- a/tests/e2e/iprange/ipv6/iprangeclaim-ipv6-restore/chainsaw-test.yaml +++ b/tests/e2e/iprange/ipv6/iprangeclaim-ipv6-restore/chainsaw-test.yaml @@ -1,3 +1,4 @@ +--- apiVersion: chainsaw.kyverno.io/v1alpha1 kind: Test metadata: @@ -50,7 +51,7 @@ spec: spec: comments: your comments customFields: - netboxOperatorRestorationHash: 63e120bdabdb0f18598573f1c7f068e03bfcae62 # note that this will require the tests to run in the e2e namespace! + netboxOperatorRestorationHash: 63e120bdabdb0f18598573f1c7f068e03bfcae62 # note that this will require the tests to run in the e2e namespace! description: some description startAddress: 3:2:2::1/128 endAddress: 3:2:2::1e/128 @@ -162,7 +163,7 @@ spec: spec: comments: your comments customFields: - netboxOperatorRestorationHash: 63e120bdabdb0f18598573f1c7f068e03bfcae62 # note that this will require the tests to run in the e2e namespace! + netboxOperatorRestorationHash: 63e120bdabdb0f18598573f1c7f068e03bfcae62 # note that this will require the tests to run in the e2e namespace! description: some description startAddress: 3:2:2::1/128 endAddress: 3:2:2::1e/128 @@ -196,7 +197,7 @@ spec: description: Events cleanup required to fix issues with failing tests that assert the wrong Error resource and lease cleanup for preventing delays when using the same prefixes (e.g. with "invalid" tests) cleanup: - script: - content: | + content: |- LEASES=$(kubectl -n netbox-operator-system get lease -oname | grep -v netbox) # to be enhanced in usage of leaselocker if [ -n "$LEASES" ]; then echo "$LEASES" | xargs -n1 kubectl -n netbox-operator-system delete diff --git a/tests/e2e/iprange/ipv6/iprangeclaim-ipv6-restore/netbox_v1_iprangeclaim_1.yaml b/tests/e2e/iprange/ipv6/iprangeclaim-ipv6-restore/netbox_v1_iprangeclaim_1.yaml index 6175ca54..7c9b8c3a 100644 --- a/tests/e2e/iprange/ipv6/iprangeclaim-ipv6-restore/netbox_v1_iprangeclaim_1.yaml +++ b/tests/e2e/iprange/ipv6/iprangeclaim-ipv6-restore/netbox_v1_iprangeclaim_1.yaml @@ -1,3 +1,4 @@ +--- apiVersion: netbox.dev/v1 kind: IpRangeClaim metadata: diff --git a/tests/e2e/iprange/ipv6/iprangeclaim-ipv6-restore/netbox_v1_iprangeclaim_2.yaml b/tests/e2e/iprange/ipv6/iprangeclaim-ipv6-restore/netbox_v1_iprangeclaim_2.yaml index 7a378141..fe04b36e 100644 --- a/tests/e2e/iprange/ipv6/iprangeclaim-ipv6-restore/netbox_v1_iprangeclaim_2.yaml +++ b/tests/e2e/iprange/ipv6/iprangeclaim-ipv6-restore/netbox_v1_iprangeclaim_2.yaml @@ -1,3 +1,4 @@ +--- apiVersion: netbox.dev/v1 kind: IpRangeClaim metadata: diff --git a/tests/e2e/kind-config.yaml b/tests/e2e/kind-config.yaml index eb2557ce..e199b514 100644 --- a/tests/e2e/kind-config.yaml +++ b/tests/e2e/kind-config.yaml @@ -1,3 +1,4 @@ +--- # See https://kind.sigs.k8s.io/docs/user/configuration/ kind: Cluster apiVersion: kind.x-k8s.io/v1alpha4 diff --git a/tools/.golangci.yaml b/tools/.golangci.yaml index dfcd2b6e..8542f39b 100644 --- a/tools/.golangci.yaml +++ b/tools/.golangci.yaml @@ -1,3 +1,4 @@ +--- version: "2" linters: default: none