From c282141477fe1aa89e18bd9f709c79dd6e6dfc81 Mon Sep 17 00:00:00 2001 From: Joel Studler Date: Thu, 17 Jul 2025 12:42:11 +0200 Subject: [PATCH 01/13] Add yamlfmt, yamllint and pre-commit configs --- .pre-commit-config.yaml | 33 +++++++++++++++++++++++++++++++++ .yamlfmt | 7 +++++++ .yamllint | 37 +++++++++++++++++++++++++++++++++++++ 3 files changed, 77 insertions(+) create mode 100644 .pre-commit-config.yaml create mode 100644 .yamlfmt create mode 100644 .yamllint diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 00000000..69e6be6c --- /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 + - repo: "https://github.com/adrienverge/yamllint" + rev: v1.35.1 + hooks: + - id: yamllint + exclude: ^config/crd + - 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..8967a451 --- /dev/null +++ b/.yamllint @@ -0,0 +1,37 @@ +--- +# Don't edit this file without consulting the team! +yaml-files: + - '*.yaml' + - '*.yml' + - '.yamllint' +ignore: | + config/crd/* +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 From a9c886dcdfdefbb3835bf2a53ac29b6b7f9a50c9 Mon Sep 17 00:00:00 2001 From: Joel Studler Date: Thu, 17 Jul 2025 12:46:47 +0200 Subject: [PATCH 02/13] Add yamllint github action --- .github/workflows/lint.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index ef03e85c..5fa64f19 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -66,3 +66,9 @@ jobs: 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 From 5fa43ec88d6e5679f78bf2e29948da023dbeef91 Mon Sep 17 00:00:00 2001 From: Joel Studler Date: Thu, 17 Jul 2025 12:49:38 +0200 Subject: [PATCH 03/13] pre-commit run --files $(find .) --- .github/dependabot.yaml | 1 + .github/workflows/build-image.yaml | 2 +- .github/workflows/codeql.yml | 103 +++++++++--------- .github/workflows/e2e-tests.yaml | 61 ++++++----- .github/workflows/govuln.yaml | 6 +- .github/workflows/integration-test.yaml | 6 +- .github/workflows/lint.yaml | 10 +- .github/workflows/unit-test.yaml | 6 +- CONTRIBUTING.md | 4 +- ParentPrefixSelectorGuide.md | 2 +- config/default/kustomization.yaml | 35 +++--- config/default/manager_metrics_patch.yaml | 1 + config/default/metrics_service.yaml | 9 +- config/manager/kustomization.yaml | 3 +- config/manager/manager.yaml | 74 ++++++------- .../network-policy/allow-metrics-traffic.yaml | 7 +- config/network-policy/kustomization.yaml | 3 +- config/prometheus/kustomization.yaml | 3 +- config/prometheus/monitor.yaml | 3 +- config/rbac/ipaddress_editor_role.yaml | 37 ++++--- config/rbac/ipaddress_viewer_role.yaml | 29 ++--- config/rbac/ipaddressclaim_editor_role.yaml | 37 ++++--- config/rbac/ipaddressclaim_viewer_role.yaml | 29 ++--- config/rbac/iprange_editor_role.yaml | 37 ++++--- config/rbac/iprange_viewer_role.yaml | 29 ++--- config/rbac/iprangeclaim_editor_role.yaml | 37 ++++--- config/rbac/iprangeclaim_viewer_role.yaml | 29 ++--- config/rbac/kustomization.yaml | 55 +++++----- config/rbac/leader_election_role.yaml | 63 +++++------ config/rbac/leader_election_role_binding.yaml | 7 +- config/rbac/metrics_auth_role.yaml | 25 +++-- config/rbac/metrics_auth_role_binding.yaml | 7 +- config/rbac/metrics_reader_role.yaml | 9 +- config/rbac/prefix_editor_role.yaml | 37 ++++--- config/rbac/prefix_viewer_role.yaml | 29 ++--- config/rbac/prefixclaim_editor_role.yaml | 37 ++++--- config/rbac/prefixclaim_viewer_role.yaml | 29 ++--- config/rbac/role.yaml | 96 ++++++++-------- config/rbac/role_binding.yaml | 7 +- config/rbac/service_account.yaml | 1 + config/samples/kustomization.yaml | 19 ++-- config/samples/netbox_v1_ipaddress.yaml | 1 + config/samples/netbox_v1_ipaddressclaim.yaml | 1 + config/samples/netbox_v1_iprange.yaml | 1 + config/samples/netbox_v1_iprangeclaim.yaml | 1 + config/samples/netbox_v1_prefix.yaml | 1 + config/samples/netbox_v1_prefixclaim.yaml | 1 + ...x_v1_prefixclaim_parentprefixselector.yaml | 1 + ...ixclaim_parentprefixselector_bool_int.yaml | 1 + .../dynamic_prefixclaim-large-font.drawio.svg | 2 +- .../prefixclaim-dynamic.drawio.svg | 2 +- .../prefixclaim-dynamic.yaml | 1 + .../prefixclaim-simple.drawio.svg | 2 +- .../prefixclaim-simple.yaml | 1 + .../simple_prefixclaim-large-font.drawio.svg | 2 +- ...ancer-ip-pool-netbox-large-font.drawio.svg | 2 +- .../load-balancer-ip-pool-netbox.yaml | 1 + .../metallb-ipaddresspool-netbox.drawio.svg | 2 +- .../sample-deployment.yaml | 14 +-- .../zurich-pool.yaml | 3 +- .../restoration-large-font.drawio.svg | 2 +- .../restoration.drawio.svg | 2 +- .../exhaustion-1-starting-point.drawio.svg | 2 +- .../exhaustion-2-prefix-exhausted.drawio.svg | 2 +- .../exhaustion-3-after-fix.drawio.svg | 2 +- docs/examples/example5-multicluster/README.md | 2 +- .../example5-multicluster/cluster-cfg.yaml | 17 +-- .../demo-setup.drawio.svg | 2 +- .../example5-multicluster/kustomization.yaml | 1 + .../example5-multicluster/london-pools.yaml | 1 + .../multicluster.drawio.svg | 2 +- .../example5-multicluster/netbox-svc.yaml | 13 ++- .../example5-multicluster/zurich-pools.yaml | 1 + ...perator-high-level-architecture.drawio.svg | 2 +- docs/operational-manual.md | 6 +- ...-with-netbox-running-in-cluster.drawio.svg | 2 +- hack/boilerplate.go.txt | 2 +- kind/job/kustomization.yaml | 9 +- kind/job/load-data-job.yaml | 1 + kind/kustomization.yaml | 1 + kind/load-data-job/README.md | 2 +- kind/load-local-data-job/main.py | 40 +++---- .../netbox-load-local-data-job.yaml | 1 + kind/netbox-db.yaml | 1 + kind/netbox-db/kustomization.yaml | 1 + kind/netbox-db/netbox-db-patch.tmpl.yaml | 1 + kind/netbox-db/netbox-db.yaml | 1 + kind/nginx-unit-config.yaml | 3 +- kind/secret.yaml | 1 + .../chainsaw-test.yaml | 15 +-- .../netbox_v1_prefixclaim.yaml | 13 ++- .../chainsaw-test.yaml | 3 +- .../netbox_v1_prefixclaim-update.yaml | 1 + .../netbox_v1_prefixclaim.yaml | 1 + .../chainsaw-test.yaml | 3 +- .../netbox_v1_prefix_3-wrong-length.yaml | 1 + .../netbox_v1_prefixclaim_1.yaml | 1 + .../netbox_v1_prefixclaim_2.yaml | 1 + .../netbox_v1_prefixclaim_3.yaml | 1 + .../chainsaw-test.yaml | 5 +- .../netbox_v1_prefixclaim.yaml | 13 ++- .../chainsaw-test.yaml | 3 +- .../netbox_v1_prefixclaim_1.yaml | 9 +- .../netbox_v1_prefixclaim_2.yaml | 9 +- .../chainsaw-test.yaml | 3 +- .../netbox_v1_prefixclaim.yaml | 13 ++- .../chainsaw-test.yaml | 3 +- .../netbox_v1_prefixclaim_1.yaml | 1 + .../netbox_v1_prefixclaim_2.yaml | 1 + .../netbox_v1_prefixclaim_3.yaml | 1 + .../chainsaw-test.yaml | 3 +- .../netbox_v1_prefix_1.yaml | 1 + .../netbox_v1_prefixclaim_1.yaml | 1 + .../chainsaw-test.yaml | 3 +- .../netbox_v1_prefixclaim-update.yaml | 9 +- .../netbox_v1_prefixclaim.yaml | 9 +- tests/e2e/README.md | 2 +- .../chainsaw-test.yaml | 3 +- .../netbox_v1_ipaddressclaim-update.yaml | 1 + .../netbox_v1_ipaddressclaim.yaml | 1 + .../chainsaw-test.yaml | 5 +- .../netbox_v1_ipaddressclaim_1.yaml | 1 + .../netbox_v1_ipaddressclaim_2.yaml | 1 + .../netbox_v1_ipaddressclaim_3.yaml | 1 + .../chainsaw-test.yaml | 7 +- .../netbox_v1_ipaddressclaim_1.yaml | 1 + .../netbox_v1_ipaddressclaim_2.yaml | 1 + .../chainsaw-test.yaml | 5 +- .../netbox_v1_ipaddress_1.yaml | 1 + .../netbox_v1_ipaddressclaim_1.yaml | 1 + .../chainsaw-test.yaml | 3 +- .../netbox_v1_ipaddressclaim-update.yaml | 1 + .../netbox_v1_ipaddressclaim.yaml | 1 + .../chainsaw-test.yaml | 5 +- .../netbox_v1_ipaddressclaim_1.yaml | 1 + .../netbox_v1_ipaddressclaim_2.yaml | 1 + .../netbox_v1_ipaddressclaim_3.yaml | 1 + .../chainsaw-test.yaml | 7 +- .../netbox_v1_ipaddressclaim_1.yaml | 1 + .../netbox_v1_ipaddressclaim_2.yaml | 1 + .../chainsaw-test.yaml | 3 +- .../netbox_v1_iprangeclaim-update.yaml | 1 + .../netbox_v1_iprangeclaim.yaml | 1 + .../chainsaw-test.yaml | 3 +- .../netbox_v1_iprangeclaim.yaml | 1 + .../chainsaw-test.yaml | 3 +- .../netbox_v1_iprangeclaim.yaml | 1 + .../chainsaw-test.yaml | 3 +- .../netbox_v1_iprangeclaim.yaml | 1 + .../chainsaw-test.yaml | 3 +- .../netbox_v1_iprangeclaim.yaml | 1 + .../chainsaw-test.yaml | 3 +- .../netbox_v1_iprangeclaim.yaml | 1 + .../chainsaw-test.yaml | 3 +- .../netbox_v1_iprangeclaim.yaml | 1 + .../chainsaw-test.yaml | 5 +- .../netbox_v1_iprangeclaim_1.yaml | 1 + .../netbox_v1_iprangeclaim_2.yaml | 1 + .../netbox_v1_iprangeclaim_3.yaml | 1 + .../chainsaw-test.yaml | 7 +- .../netbox_v1_iprangeclaim_1.yaml | 1 + .../netbox_v1_iprangeclaim_2.yaml | 1 + .../chainsaw-test.yaml | 3 +- .../netbox_v1_iprange_1.yaml | 1 + .../netbox_v1_iprangeclaim_1.yaml | 1 + .../chainsaw-test.yaml | 3 +- .../netbox_v1_iprangeclaim-update.yaml | 1 + .../netbox_v1_iprangeclaim.yaml | 1 + .../chainsaw-test.yaml | 5 +- .../netbox_v1_iprangeclaim_1.yaml | 1 + .../netbox_v1_iprangeclaim_2.yaml | 1 + .../netbox_v1_iprangeclaim_3.yaml | 1 + .../chainsaw-test.yaml | 7 +- .../netbox_v1_iprangeclaim_1.yaml | 1 + .../netbox_v1_iprangeclaim_2.yaml | 1 + tests/e2e/kind-config.yaml | 1 + tools/.golangci.yaml | 1 + 177 files changed, 794 insertions(+), 648 deletions(-) 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..f191cd94 100644 --- a/.github/workflows/build-image.yaml +++ b/.github/workflows/build-image.yaml @@ -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..2183ad25 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. # @@ -13,9 +14,9 @@ name: "CodeQL Advanced" on: 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..61fbff9e 100644 --- a/.github/workflows/e2e-tests.yaml +++ b/.github/workflows/e2e-tests.yaml @@ -1,3 +1,4 @@ +--- # Modified from https://github.com/prometheus-operator/prometheus-operator/blob/main/.github/workflows/e2e-feature-gated.yaml name: e2e-tests permissions: @@ -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..6249568a 100644 --- a/.github/workflows/govuln.yaml +++ b/.github/workflows/govuln.yaml @@ -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..455e11a8 100644 --- a/.github/workflows/integration-test.yaml +++ b/.github/workflows/integration-test.yaml @@ -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 5fa64f19..77e198c1 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -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,7 +61,7 @@ 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: @@ -69,6 +69,6 @@ jobs: yamllint: runs-on: ubuntu-latest steps: - - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 + - 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..2f5581b6 100644 --- a/.github/workflows/unit-test.yaml +++ b/.github/workflows/unit-test.yaml @@ -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/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/default/kustomization.yaml b/config/default/kustomization.yaml index d8b33ff1..9a20b56a 100644 --- a/config/default/kustomization.yaml +++ b/config/default/kustomization.yaml @@ -1,3 +1,4 @@ +--- # Adds namespace to all resources. namespace: netbox-operator-system @@ -15,18 +16,18 @@ namePrefix: netbox-operator- # someName: someValue resources: -- ../crd -- ../rbac -- ../manager -# [WEBHOOK] To enable webhook, uncomment all the sections with [WEBHOOK] prefix including the one in -# crd/kustomization.yaml -#- ../webhook -# [CERTMANAGER] To enable cert-manager, uncomment all sections with 'CERTMANAGER'. 'WEBHOOK' components are required. -#- ../certmanager -# [PROMETHEUS] To enable prometheus monitor, uncomment all sections with 'PROMETHEUS'. -#- ../prometheus -# [METRICS] Expose the controller manager metrics service. -- metrics_service.yaml + - ../crd + - ../rbac + - ../manager + # [WEBHOOK] To enable webhook, uncomment all the sections with [WEBHOOK] prefix including the one in + # crd/kustomization.yaml + #- ../webhook + # [CERTMANAGER] To enable cert-manager, uncomment all sections with 'CERTMANAGER'. 'WEBHOOK' components are required. + #- ../certmanager + # [PROMETHEUS] To enable prometheus monitor, uncomment all sections with 'PROMETHEUS'. + #- ../prometheus + # [METRICS] Expose the controller manager metrics service. + - metrics_service.yaml # [NETWORK POLICY] Protect the /metrics endpoint and Webhook Server with NetworkPolicy. # Only Pod(s) running a namespace labeled with 'metrics: enabled' will be able to gather the metrics. # Only CR(s) which requires webhooks and are applied on namespaces labeled with 'webhooks: enabled' will @@ -35,11 +36,11 @@ resources: # Uncomment the patches line if you enable Metrics, and/or are using webhooks and cert-manager patches: -# [METRICS] The following patch will enable the metrics endpoint using HTTPS and the port :8443. -# More info: https://book.kubebuilder.io/reference/metrics -- path: manager_metrics_patch.yaml - target: - kind: Deployment + # [METRICS] The following patch will enable the metrics endpoint using HTTPS and the port :8443. + # More info: https://book.kubebuilder.io/reference/metrics + - path: manager_metrics_patch.yaml + target: + kind: Deployment # [WEBHOOK] To enable webhook, uncomment all the sections with [WEBHOOK] prefix including the one in # crd/kustomization.yaml diff --git a/config/default/manager_metrics_patch.yaml b/config/default/manager_metrics_patch.yaml index 2aaef653..8d2c94e4 100644 --- a/config/default/manager_metrics_patch.yaml +++ b/config/default/manager_metrics_patch.yaml @@ -1,3 +1,4 @@ +--- # This patch adds the args to allow exposing the metrics endpoint using HTTPS - op: add path: /spec/template/spec/containers/0/args/0 diff --git a/config/default/metrics_service.yaml b/config/default/metrics_service.yaml index 694b9dfd..5fb6cca7 100644 --- a/config/default/metrics_service.yaml +++ b/config/default/metrics_service.yaml @@ -1,3 +1,4 @@ +--- apiVersion: v1 kind: Service metadata: @@ -9,10 +10,10 @@ metadata: namespace: system spec: ports: - - name: https - port: 8443 - protocol: TCP - targetPort: 8443 + - name: https + port: 8443 + protocol: TCP + targetPort: 8443 selector: control-plane: controller-manager app.kubernetes.io/part-of: netbox-operator diff --git a/config/manager/kustomization.yaml b/config/manager/kustomization.yaml index 5c5f0b84..59639615 100644 --- a/config/manager/kustomization.yaml +++ b/config/manager/kustomization.yaml @@ -1,2 +1,3 @@ +--- resources: -- manager.yaml + - manager.yaml diff --git a/config/manager/manager.yaml b/config/manager/manager.yaml index aeaf352b..f0f31d02 100644 --- a/config/manager/manager.yaml +++ b/config/manager/manager.yaml @@ -55,42 +55,42 @@ spec: # seccompProfile: # type: RuntimeDefault containers: - - command: - - /manager - args: - - --leader-elect - image: controller:latest - name: manager - env: - - name: POD_NAMESPACE - valueFrom: - fieldRef: - fieldPath: metadata.namespace - securityContext: - allowPrivilegeEscalation: false - capabilities: - drop: - - "ALL" - livenessProbe: - httpGet: - path: /healthz - port: 8081 - initialDelaySeconds: 15 - periodSeconds: 20 - readinessProbe: - httpGet: - path: /readyz - port: 8081 - initialDelaySeconds: 5 - periodSeconds: 10 - # TODO(user): Configure the resources accordingly based on the project requirements. - # More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ - resources: - limits: - cpu: 500m - memory: 128Mi - requests: - cpu: 10m - memory: 64Mi + - command: + - /manager + args: + - --leader-elect + image: controller:latest + name: manager + env: + - name: POD_NAMESPACE + valueFrom: + fieldRef: + fieldPath: metadata.namespace + securityContext: + allowPrivilegeEscalation: false + capabilities: + drop: + - "ALL" + livenessProbe: + httpGet: + path: /healthz + port: 8081 + initialDelaySeconds: 15 + periodSeconds: 20 + readinessProbe: + httpGet: + path: /readyz + port: 8081 + initialDelaySeconds: 5 + periodSeconds: 10 + # TODO(user): Configure the resources accordingly based on the project requirements. + # More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ + resources: + limits: + cpu: 500m + memory: 128Mi + requests: + cpu: 10m + memory: 64Mi serviceAccountName: controller-manager terminationGracePeriodSeconds: 10 diff --git a/config/network-policy/allow-metrics-traffic.yaml b/config/network-policy/allow-metrics-traffic.yaml index 2aaa7fdd..9e7e0996 100644 --- a/config/network-policy/allow-metrics-traffic.yaml +++ b/config/network-policy/allow-metrics-traffic.yaml @@ -1,3 +1,4 @@ +--- # This NetworkPolicy allows ingress traffic # with Pods running on namespaces labeled with 'metrics: enabled'. Only Pods on those # namespaces are able to gathering data from the metrics endpoint. @@ -18,9 +19,9 @@ spec: ingress: # This allows ingress traffic from any namespace with the label metrics: enabled - from: - - namespaceSelector: - matchLabels: - metrics: enabled # Only from namespaces with this label + - namespaceSelector: + matchLabels: + metrics: enabled # Only from namespaces with this label ports: - port: 8443 protocol: TCP diff --git a/config/network-policy/kustomization.yaml b/config/network-policy/kustomization.yaml index ec0fb5e5..b9c733ff 100644 --- a/config/network-policy/kustomization.yaml +++ b/config/network-policy/kustomization.yaml @@ -1,2 +1,3 @@ +--- resources: -- allow-metrics-traffic.yaml + - allow-metrics-traffic.yaml diff --git a/config/prometheus/kustomization.yaml b/config/prometheus/kustomization.yaml index ed137168..c4aaaee0 100644 --- a/config/prometheus/kustomization.yaml +++ b/config/prometheus/kustomization.yaml @@ -1,2 +1,3 @@ +--- resources: -- monitor.yaml + - monitor.yaml diff --git a/config/prometheus/monitor.yaml b/config/prometheus/monitor.yaml index fe512d22..37080eb7 100644 --- a/config/prometheus/monitor.yaml +++ b/config/prometheus/monitor.yaml @@ -1,3 +1,4 @@ +--- # Prometheus Monitor Service (Metrics) apiVersion: monitoring.coreos.com/v1 kind: ServiceMonitor @@ -12,7 +13,7 @@ metadata: spec: endpoints: - path: /metrics - port: https # Ensure this is the name of the port that exposes HTTPS metrics + port: https # Ensure this is the name of the port that exposes HTTPS metrics scheme: https bearerTokenFile: /var/run/secrets/kubernetes.io/serviceaccount/token tlsConfig: diff --git a/config/rbac/ipaddress_editor_role.yaml b/config/rbac/ipaddress_editor_role.yaml index 75da2578..9735e42a 100644 --- a/config/rbac/ipaddress_editor_role.yaml +++ b/config/rbac/ipaddress_editor_role.yaml @@ -1,3 +1,4 @@ +--- # permissions for end users to edit ipaddresses. apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole @@ -11,21 +12,21 @@ metadata: app.kubernetes.io/managed-by: kustomize name: ipaddress-editor-role rules: -- apiGroups: - - netbox.dev - resources: - - ipaddresses - verbs: - - create - - delete - - get - - list - - patch - - update - - watch -- apiGroups: - - netbox.dev - resources: - - ipaddresses/status - verbs: - - get + - apiGroups: + - netbox.dev + resources: + - ipaddresses + verbs: + - create + - delete + - get + - list + - patch + - update + - watch + - apiGroups: + - netbox.dev + resources: + - ipaddresses/status + verbs: + - get diff --git a/config/rbac/ipaddress_viewer_role.yaml b/config/rbac/ipaddress_viewer_role.yaml index c5f1bf22..bf56702e 100644 --- a/config/rbac/ipaddress_viewer_role.yaml +++ b/config/rbac/ipaddress_viewer_role.yaml @@ -1,3 +1,4 @@ +--- # permissions for end users to view ipaddresses. apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole @@ -11,17 +12,17 @@ metadata: app.kubernetes.io/managed-by: kustomize name: ipaddress-viewer-role rules: -- apiGroups: - - netbox.dev - resources: - - ipaddresses - verbs: - - get - - list - - watch -- apiGroups: - - netbox.dev - resources: - - ipaddresses/status - verbs: - - get + - apiGroups: + - netbox.dev + resources: + - ipaddresses + verbs: + - get + - list + - watch + - apiGroups: + - netbox.dev + resources: + - ipaddresses/status + verbs: + - get diff --git a/config/rbac/ipaddressclaim_editor_role.yaml b/config/rbac/ipaddressclaim_editor_role.yaml index b05f6592..eba5baa3 100644 --- a/config/rbac/ipaddressclaim_editor_role.yaml +++ b/config/rbac/ipaddressclaim_editor_role.yaml @@ -1,3 +1,4 @@ +--- # permissions for end users to edit ipaddressclaims. apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole @@ -11,21 +12,21 @@ metadata: app.kubernetes.io/managed-by: kustomize name: ipaddressclaim-editor-role rules: -- apiGroups: - - netbox.dev - resources: - - ipaddressclaims - verbs: - - create - - delete - - get - - list - - patch - - update - - watch -- apiGroups: - - netbox.dev - resources: - - ipaddressclaims/status - verbs: - - get + - apiGroups: + - netbox.dev + resources: + - ipaddressclaims + verbs: + - create + - delete + - get + - list + - patch + - update + - watch + - apiGroups: + - netbox.dev + resources: + - ipaddressclaims/status + verbs: + - get diff --git a/config/rbac/ipaddressclaim_viewer_role.yaml b/config/rbac/ipaddressclaim_viewer_role.yaml index 5421fc7c..bfa2466f 100644 --- a/config/rbac/ipaddressclaim_viewer_role.yaml +++ b/config/rbac/ipaddressclaim_viewer_role.yaml @@ -1,3 +1,4 @@ +--- # permissions for end users to view ipaddressclaims. apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole @@ -11,17 +12,17 @@ metadata: app.kubernetes.io/managed-by: kustomize name: ipaddressclaim-viewer-role rules: -- apiGroups: - - netbox.dev - resources: - - ipaddressclaims - verbs: - - get - - list - - watch -- apiGroups: - - netbox.dev - resources: - - ipaddressclaims/status - verbs: - - get + - apiGroups: + - netbox.dev + resources: + - ipaddressclaims + verbs: + - get + - list + - watch + - apiGroups: + - netbox.dev + resources: + - ipaddressclaims/status + verbs: + - get diff --git a/config/rbac/iprange_editor_role.yaml b/config/rbac/iprange_editor_role.yaml index bf55807d..6775cffc 100644 --- a/config/rbac/iprange_editor_role.yaml +++ b/config/rbac/iprange_editor_role.yaml @@ -1,3 +1,4 @@ +--- # permissions for end users to edit ipranges. apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole @@ -11,21 +12,21 @@ metadata: app.kubernetes.io/managed-by: kustomize name: iprange-editor-role rules: -- apiGroups: - - netbox.dev - resources: - - ipranges - verbs: - - create - - delete - - get - - list - - patch - - update - - watch -- apiGroups: - - netbox.dev - resources: - - ipranges/status - verbs: - - get + - apiGroups: + - netbox.dev + resources: + - ipranges + verbs: + - create + - delete + - get + - list + - patch + - update + - watch + - apiGroups: + - netbox.dev + resources: + - ipranges/status + verbs: + - get diff --git a/config/rbac/iprange_viewer_role.yaml b/config/rbac/iprange_viewer_role.yaml index 73ac9ab6..2839df90 100644 --- a/config/rbac/iprange_viewer_role.yaml +++ b/config/rbac/iprange_viewer_role.yaml @@ -1,3 +1,4 @@ +--- # permissions for end users to view ipranges. apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole @@ -11,17 +12,17 @@ metadata: app.kubernetes.io/managed-by: kustomize name: iprange-viewer-role rules: -- apiGroups: - - netbox.dev - resources: - - ipranges - verbs: - - get - - list - - watch -- apiGroups: - - netbox.dev - resources: - - ipranges/status - verbs: - - get + - apiGroups: + - netbox.dev + resources: + - ipranges + verbs: + - get + - list + - watch + - apiGroups: + - netbox.dev + resources: + - ipranges/status + verbs: + - get diff --git a/config/rbac/iprangeclaim_editor_role.yaml b/config/rbac/iprangeclaim_editor_role.yaml index 4be0b278..09819d46 100644 --- a/config/rbac/iprangeclaim_editor_role.yaml +++ b/config/rbac/iprangeclaim_editor_role.yaml @@ -1,3 +1,4 @@ +--- # permissions for end users to edit iprangeclaims. apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole @@ -11,21 +12,21 @@ metadata: app.kubernetes.io/managed-by: kustomize name: iprangeclaim-editor-role rules: -- apiGroups: - - netbox.dev - resources: - - iprangeclaims - verbs: - - create - - delete - - get - - list - - patch - - update - - watch -- apiGroups: - - netbox.dev - resources: - - iprangeclaims/status - verbs: - - get + - apiGroups: + - netbox.dev + resources: + - iprangeclaims + verbs: + - create + - delete + - get + - list + - patch + - update + - watch + - apiGroups: + - netbox.dev + resources: + - iprangeclaims/status + verbs: + - get diff --git a/config/rbac/iprangeclaim_viewer_role.yaml b/config/rbac/iprangeclaim_viewer_role.yaml index b81cf354..276cffba 100644 --- a/config/rbac/iprangeclaim_viewer_role.yaml +++ b/config/rbac/iprangeclaim_viewer_role.yaml @@ -1,3 +1,4 @@ +--- # permissions for end users to view iprangeclaims. apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole @@ -11,17 +12,17 @@ metadata: app.kubernetes.io/managed-by: kustomize name: iprangeclaim-viewer-role rules: -- apiGroups: - - netbox.dev - resources: - - iprangeclaims - verbs: - - get - - list - - watch -- apiGroups: - - netbox.dev - resources: - - iprangeclaims/status - verbs: - - get + - apiGroups: + - netbox.dev + resources: + - iprangeclaims + verbs: + - get + - list + - watch + - apiGroups: + - netbox.dev + resources: + - iprangeclaims/status + verbs: + - get diff --git a/config/rbac/kustomization.yaml b/config/rbac/kustomization.yaml index 5e7297eb..8d27f987 100644 --- a/config/rbac/kustomization.yaml +++ b/config/rbac/kustomization.yaml @@ -1,28 +1,29 @@ +--- resources: -# All RBAC will be applied under this service account in -# the deployment namespace. You may comment out this resource -# if your manager will use a service account that exists at -# runtime. Be sure to update RoleBinding and ClusterRoleBinding -# subjects if changing service account names. -- service_account.yaml -- role.yaml -- role_binding.yaml -- leader_election_role.yaml -- leader_election_role_binding.yaml -# The following RBAC configurations are used to protect -# the metrics endpoint with authn/authz. These configurations -# ensure that only authorized users and service accounts -# can access the metrics endpoint. Comment the following -# permissions if you want to disable this protection. -# More info: https://book.kubebuilder.io/reference/metrics.html -- metrics_auth_role.yaml -- metrics_auth_role_binding.yaml -- metrics_reader_role.yaml -# For each CRD, "Editor" and "Viewer" roles are scaffolded by -# default, aiding admins in cluster management. Those roles are -# not used by the Project itself. You can comment the following lines -# if you do not want those helpers be installed with your Project. -- prefixclaim_editor_role.yaml -- prefixclaim_viewer_role.yaml -- prefix_editor_role.yaml -- prefix_viewer_role.yaml + # All RBAC will be applied under this service account in + # the deployment namespace. You may comment out this resource + # if your manager will use a service account that exists at + # runtime. Be sure to update RoleBinding and ClusterRoleBinding + # subjects if changing service account names. + - service_account.yaml + - role.yaml + - role_binding.yaml + - leader_election_role.yaml + - leader_election_role_binding.yaml + # The following RBAC configurations are used to protect + # the metrics endpoint with authn/authz. These configurations + # ensure that only authorized users and service accounts + # can access the metrics endpoint. Comment the following + # permissions if you want to disable this protection. + # More info: https://book.kubebuilder.io/reference/metrics.html + - metrics_auth_role.yaml + - metrics_auth_role_binding.yaml + - metrics_reader_role.yaml + # For each CRD, "Editor" and "Viewer" roles are scaffolded by + # default, aiding admins in cluster management. Those roles are + # not used by the Project itself. You can comment the following lines + # if you do not want those helpers be installed with your Project. + - prefixclaim_editor_role.yaml + - prefixclaim_viewer_role.yaml + - prefix_editor_role.yaml + - prefix_viewer_role.yaml diff --git a/config/rbac/leader_election_role.yaml b/config/rbac/leader_election_role.yaml index f7acd40f..4d6417da 100644 --- a/config/rbac/leader_election_role.yaml +++ b/config/rbac/leader_election_role.yaml @@ -1,3 +1,4 @@ +--- # permissions to do leader election. apiVersion: rbac.authorization.k8s.io/v1 kind: Role @@ -11,34 +12,34 @@ metadata: app.kubernetes.io/managed-by: kustomize name: leader-election-role rules: -- apiGroups: - - "" - resources: - - configmaps - verbs: - - get - - list - - watch - - create - - update - - patch - - delete -- apiGroups: - - coordination.k8s.io - resources: - - leases - verbs: - - get - - list - - watch - - create - - update - - patch - - delete -- apiGroups: - - "" - resources: - - events - verbs: - - create - - patch + - apiGroups: + - "" + resources: + - configmaps + verbs: + - get + - list + - watch + - create + - update + - patch + - delete + - apiGroups: + - coordination.k8s.io + resources: + - leases + verbs: + - get + - list + - watch + - create + - update + - patch + - delete + - apiGroups: + - "" + resources: + - events + verbs: + - create + - patch diff --git a/config/rbac/leader_election_role_binding.yaml b/config/rbac/leader_election_role_binding.yaml index 64ac99d7..59638111 100644 --- a/config/rbac/leader_election_role_binding.yaml +++ b/config/rbac/leader_election_role_binding.yaml @@ -1,3 +1,4 @@ +--- apiVersion: rbac.authorization.k8s.io/v1 kind: RoleBinding metadata: @@ -14,6 +15,6 @@ roleRef: kind: Role name: leader-election-role subjects: -- kind: ServiceAccount - name: controller-manager - namespace: system + - kind: ServiceAccount + name: controller-manager + namespace: system diff --git a/config/rbac/metrics_auth_role.yaml b/config/rbac/metrics_auth_role.yaml index 32d2e4ec..fdeed0f6 100644 --- a/config/rbac/metrics_auth_role.yaml +++ b/config/rbac/metrics_auth_role.yaml @@ -1,17 +1,18 @@ +--- apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole metadata: name: metrics-auth-role rules: -- apiGroups: - - authentication.k8s.io - resources: - - tokenreviews - verbs: - - create -- apiGroups: - - authorization.k8s.io - resources: - - subjectaccessreviews - verbs: - - create + - apiGroups: + - authentication.k8s.io + resources: + - tokenreviews + verbs: + - create + - apiGroups: + - authorization.k8s.io + resources: + - subjectaccessreviews + verbs: + - create diff --git a/config/rbac/metrics_auth_role_binding.yaml b/config/rbac/metrics_auth_role_binding.yaml index e775d67f..fcc02ef8 100644 --- a/config/rbac/metrics_auth_role_binding.yaml +++ b/config/rbac/metrics_auth_role_binding.yaml @@ -1,3 +1,4 @@ +--- apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding metadata: @@ -7,6 +8,6 @@ roleRef: kind: ClusterRole name: metrics-auth-role subjects: -- kind: ServiceAccount - name: controller-manager - namespace: system + - kind: ServiceAccount + name: controller-manager + namespace: system diff --git a/config/rbac/metrics_reader_role.yaml b/config/rbac/metrics_reader_role.yaml index 51a75db4..8e6154f3 100644 --- a/config/rbac/metrics_reader_role.yaml +++ b/config/rbac/metrics_reader_role.yaml @@ -1,9 +1,10 @@ +--- apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole metadata: name: metrics-reader rules: -- nonResourceURLs: - - "/metrics" - verbs: - - get + - nonResourceURLs: + - "/metrics" + verbs: + - get diff --git a/config/rbac/prefix_editor_role.yaml b/config/rbac/prefix_editor_role.yaml index e69aa810..454895b3 100644 --- a/config/rbac/prefix_editor_role.yaml +++ b/config/rbac/prefix_editor_role.yaml @@ -1,3 +1,4 @@ +--- # permissions for end users to edit prefixes. apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole @@ -7,21 +8,21 @@ metadata: app.kubernetes.io/managed-by: kustomize name: prefix-editor-role rules: -- apiGroups: - - netbox.dev - resources: - - prefixes - verbs: - - create - - delete - - get - - list - - patch - - update - - watch -- apiGroups: - - netbox.dev - resources: - - prefixes/status - verbs: - - get + - apiGroups: + - netbox.dev + resources: + - prefixes + verbs: + - create + - delete + - get + - list + - patch + - update + - watch + - apiGroups: + - netbox.dev + resources: + - prefixes/status + verbs: + - get diff --git a/config/rbac/prefix_viewer_role.yaml b/config/rbac/prefix_viewer_role.yaml index 7074298f..0b46d1a6 100644 --- a/config/rbac/prefix_viewer_role.yaml +++ b/config/rbac/prefix_viewer_role.yaml @@ -1,3 +1,4 @@ +--- # permissions for end users to view prefixes. apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole @@ -7,17 +8,17 @@ metadata: app.kubernetes.io/managed-by: kustomize name: prefix-viewer-role rules: -- apiGroups: - - netbox.dev - resources: - - prefixes - verbs: - - get - - list - - watch -- apiGroups: - - netbox.dev - resources: - - prefixes/status - verbs: - - get + - apiGroups: + - netbox.dev + resources: + - prefixes + verbs: + - get + - list + - watch + - apiGroups: + - netbox.dev + resources: + - prefixes/status + verbs: + - get diff --git a/config/rbac/prefixclaim_editor_role.yaml b/config/rbac/prefixclaim_editor_role.yaml index a1c7a670..7f4a9ab3 100644 --- a/config/rbac/prefixclaim_editor_role.yaml +++ b/config/rbac/prefixclaim_editor_role.yaml @@ -1,3 +1,4 @@ +--- # permissions for end users to edit prefixclaims. apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole @@ -7,21 +8,21 @@ metadata: app.kubernetes.io/managed-by: kustomize name: prefixclaim-editor-role rules: -- apiGroups: - - netbox.dev - resources: - - prefixclaims - verbs: - - create - - delete - - get - - list - - patch - - update - - watch -- apiGroups: - - netbox.dev - resources: - - prefixclaims/status - verbs: - - get + - apiGroups: + - netbox.dev + resources: + - prefixclaims + verbs: + - create + - delete + - get + - list + - patch + - update + - watch + - apiGroups: + - netbox.dev + resources: + - prefixclaims/status + verbs: + - get diff --git a/config/rbac/prefixclaim_viewer_role.yaml b/config/rbac/prefixclaim_viewer_role.yaml index b3e05f1f..eb24b357 100644 --- a/config/rbac/prefixclaim_viewer_role.yaml +++ b/config/rbac/prefixclaim_viewer_role.yaml @@ -1,3 +1,4 @@ +--- # permissions for end users to view prefixclaims. apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole @@ -7,17 +8,17 @@ metadata: app.kubernetes.io/managed-by: kustomize name: prefixclaim-viewer-role rules: -- apiGroups: - - netbox.dev - resources: - - prefixclaims - verbs: - - get - - list - - watch -- apiGroups: - - netbox.dev - resources: - - prefixclaims/status - verbs: - - get + - apiGroups: + - netbox.dev + resources: + - prefixclaims + verbs: + - get + - list + - watch + - apiGroups: + - netbox.dev + resources: + - prefixclaims/status + verbs: + - get diff --git a/config/rbac/role.yaml b/config/rbac/role.yaml index 9ce32be3..16d51779 100644 --- a/config/rbac/role.yaml +++ b/config/rbac/role.yaml @@ -4,51 +4,51 @@ kind: ClusterRole metadata: name: manager-role rules: -- apiGroups: - - "" - resources: - - events - verbs: - - create - - patch -- apiGroups: - - netbox.dev - resources: - - ipaddressclaims - - ipaddresses - - iprangeclaims - - ipranges - - prefixclaims - - prefixes - verbs: - - create - - delete - - get - - list - - patch - - update - - watch -- apiGroups: - - netbox.dev - resources: - - ipaddressclaims/finalizers - - ipaddresses/finalizers - - iprangeclaims/finalizers - - ipranges/finalizers - - prefixclaims/finalizers - - prefixes/finalizers - verbs: - - update -- apiGroups: - - netbox.dev - resources: - - ipaddressclaims/status - - ipaddresses/status - - iprangeclaims/status - - ipranges/status - - prefixclaims/status - - prefixes/status - verbs: - - get - - patch - - update + - apiGroups: + - "" + resources: + - events + verbs: + - create + - patch + - apiGroups: + - netbox.dev + resources: + - ipaddressclaims + - ipaddresses + - iprangeclaims + - ipranges + - prefixclaims + - prefixes + verbs: + - create + - delete + - get + - list + - patch + - update + - watch + - apiGroups: + - netbox.dev + resources: + - ipaddressclaims/finalizers + - ipaddresses/finalizers + - iprangeclaims/finalizers + - ipranges/finalizers + - prefixclaims/finalizers + - prefixes/finalizers + verbs: + - update + - apiGroups: + - netbox.dev + resources: + - ipaddressclaims/status + - ipaddresses/status + - iprangeclaims/status + - ipranges/status + - prefixclaims/status + - prefixes/status + verbs: + - get + - patch + - update diff --git a/config/rbac/role_binding.yaml b/config/rbac/role_binding.yaml index a314d41e..7172532f 100644 --- a/config/rbac/role_binding.yaml +++ b/config/rbac/role_binding.yaml @@ -1,3 +1,4 @@ +--- apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding metadata: @@ -14,6 +15,6 @@ roleRef: kind: ClusterRole name: manager-role subjects: -- kind: ServiceAccount - name: controller-manager - namespace: system + - kind: ServiceAccount + name: controller-manager + namespace: system diff --git a/config/rbac/service_account.yaml b/config/rbac/service_account.yaml index 4cf6eaa6..53d0e612 100644 --- a/config/rbac/service_account.yaml +++ b/config/rbac/service_account.yaml @@ -1,3 +1,4 @@ +--- apiVersion: v1 kind: ServiceAccount metadata: diff --git a/config/samples/kustomization.yaml b/config/samples/kustomization.yaml index d3f1a9ee..fbdf947e 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..5017975c 100644 --- a/kind/netbox-db.yaml +++ b/kind/netbox-db.yaml @@ -1,3 +1,4 @@ +--- apiVersion: "acid.zalan.do/v1" kind: postgresql metadata: 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..af374224 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: 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..a4d2b198 100644 --- a/kind/secret.yaml +++ b/kind/secret.yaml @@ -1,3 +1,4 @@ +--- apiVersion: v1 kind: Secret metadata: 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 From 9d477cf010a1e803436c7050d1159acef48a4c87 Mon Sep 17 00:00:00 2001 From: Joel Studler Date: Thu, 17 Jul 2025 13:18:52 +0200 Subject: [PATCH 04/13] Exclude config/rbac/* to make make manifests work --- .pre-commit-config.yaml | 2 +- .yamllint | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 69e6be6c..f29f04cf 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -19,7 +19,7 @@ repos: hooks: - id: yamlfmt language: system - exclude: ^config/crd + exclude: ^config/crd|^config/rbacß - repo: "https://github.com/adrienverge/yamllint" rev: v1.35.1 hooks: diff --git a/.yamllint b/.yamllint index 8967a451..b446d566 100644 --- a/.yamllint +++ b/.yamllint @@ -6,6 +6,7 @@ yaml-files: - '.yamllint' ignore: | config/crd/* + config/rbac/* rules: # anchors: enable braces: enable From a70bf40d83f7aaa229802280597dd668311cceee Mon Sep 17 00:00:00 2001 From: Joel Studler Date: Thu, 17 Jul 2025 13:19:08 +0200 Subject: [PATCH 05/13] make manifests --- config/rbac/role.yaml | 96 +++++++++++++++++++++---------------------- 1 file changed, 48 insertions(+), 48 deletions(-) diff --git a/config/rbac/role.yaml b/config/rbac/role.yaml index 16d51779..9ce32be3 100644 --- a/config/rbac/role.yaml +++ b/config/rbac/role.yaml @@ -4,51 +4,51 @@ kind: ClusterRole metadata: name: manager-role rules: - - apiGroups: - - "" - resources: - - events - verbs: - - create - - patch - - apiGroups: - - netbox.dev - resources: - - ipaddressclaims - - ipaddresses - - iprangeclaims - - ipranges - - prefixclaims - - prefixes - verbs: - - create - - delete - - get - - list - - patch - - update - - watch - - apiGroups: - - netbox.dev - resources: - - ipaddressclaims/finalizers - - ipaddresses/finalizers - - iprangeclaims/finalizers - - ipranges/finalizers - - prefixclaims/finalizers - - prefixes/finalizers - verbs: - - update - - apiGroups: - - netbox.dev - resources: - - ipaddressclaims/status - - ipaddresses/status - - iprangeclaims/status - - ipranges/status - - prefixclaims/status - - prefixes/status - verbs: - - get - - patch - - update +- apiGroups: + - "" + resources: + - events + verbs: + - create + - patch +- apiGroups: + - netbox.dev + resources: + - ipaddressclaims + - ipaddresses + - iprangeclaims + - ipranges + - prefixclaims + - prefixes + verbs: + - create + - delete + - get + - list + - patch + - update + - watch +- apiGroups: + - netbox.dev + resources: + - ipaddressclaims/finalizers + - ipaddresses/finalizers + - iprangeclaims/finalizers + - ipranges/finalizers + - prefixclaims/finalizers + - prefixes/finalizers + verbs: + - update +- apiGroups: + - netbox.dev + resources: + - ipaddressclaims/status + - ipaddresses/status + - iprangeclaims/status + - ipranges/status + - prefixclaims/status + - prefixes/status + verbs: + - get + - patch + - update From 362f17bb579da41318df23f22fb53f029dbff6ce Mon Sep 17 00:00:00 2001 From: Joel Studler Date: Thu, 17 Jul 2025 13:19:49 +0200 Subject: [PATCH 06/13] Exclude config/rbac/* to make make manifests work --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index f29f04cf..74b80b51 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -19,7 +19,7 @@ repos: hooks: - id: yamlfmt language: system - exclude: ^config/crd|^config/rbacß + exclude: ^config/crd|^config/rbac - repo: "https://github.com/adrienverge/yamllint" rev: v1.35.1 hooks: From e4625bac3d06f5958bbbc10e06f781be242d519a Mon Sep 17 00:00:00 2001 From: Joel Studler Date: Thu, 17 Jul 2025 13:21:45 +0200 Subject: [PATCH 07/13] Exclude config/rbac/* to make make manifests work --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 74b80b51..2bc1fde1 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -24,7 +24,7 @@ repos: rev: v1.35.1 hooks: - id: yamllint - exclude: ^config/crd + exclude: ^config/crd|^config/rbac - repo: https://github.com/codespell-project/codespell rev: v2.1.0 hooks: From fb2256be563d4bdf8f58d0fc9f7997ae146cf4a3 Mon Sep 17 00:00:00 2001 From: Joel Studler Date: Thu, 17 Jul 2025 13:31:01 +0200 Subject: [PATCH 08/13] Revert "pre-commit run --files $(find .)" This reverts commit 5fa43ec88d6e5679f78bf2e29948da023dbeef91. --- .github/dependabot.yaml | 1 - .github/workflows/build-image.yaml | 2 +- .github/workflows/codeql.yml | 103 +++++++++--------- .github/workflows/e2e-tests.yaml | 61 +++++------ .github/workflows/govuln.yaml | 6 +- .github/workflows/integration-test.yaml | 6 +- .github/workflows/lint.yaml | 10 +- .github/workflows/unit-test.yaml | 6 +- CONTRIBUTING.md | 4 +- ParentPrefixSelectorGuide.md | 2 +- config/default/kustomization.yaml | 35 +++--- config/default/manager_metrics_patch.yaml | 1 - config/default/metrics_service.yaml | 9 +- config/manager/kustomization.yaml | 3 +- config/manager/manager.yaml | 74 ++++++------- .../network-policy/allow-metrics-traffic.yaml | 7 +- config/network-policy/kustomization.yaml | 3 +- config/prometheus/kustomization.yaml | 3 +- config/prometheus/monitor.yaml | 3 +- config/rbac/ipaddress_editor_role.yaml | 37 +++---- config/rbac/ipaddress_viewer_role.yaml | 29 +++-- config/rbac/ipaddressclaim_editor_role.yaml | 37 +++---- config/rbac/ipaddressclaim_viewer_role.yaml | 29 +++-- config/rbac/iprange_editor_role.yaml | 37 +++---- config/rbac/iprange_viewer_role.yaml | 29 +++-- config/rbac/iprangeclaim_editor_role.yaml | 37 +++---- config/rbac/iprangeclaim_viewer_role.yaml | 29 +++-- config/rbac/kustomization.yaml | 55 +++++----- config/rbac/leader_election_role.yaml | 63 ++++++----- config/rbac/leader_election_role_binding.yaml | 7 +- config/rbac/metrics_auth_role.yaml | 25 ++--- config/rbac/metrics_auth_role_binding.yaml | 7 +- config/rbac/metrics_reader_role.yaml | 9 +- config/rbac/prefix_editor_role.yaml | 37 +++---- config/rbac/prefix_viewer_role.yaml | 29 +++-- config/rbac/prefixclaim_editor_role.yaml | 37 +++---- config/rbac/prefixclaim_viewer_role.yaml | 29 +++-- config/rbac/role_binding.yaml | 7 +- config/rbac/service_account.yaml | 1 - config/samples/kustomization.yaml | 19 ++-- config/samples/netbox_v1_ipaddress.yaml | 1 - config/samples/netbox_v1_ipaddressclaim.yaml | 1 - config/samples/netbox_v1_iprange.yaml | 1 - config/samples/netbox_v1_iprangeclaim.yaml | 1 - config/samples/netbox_v1_prefix.yaml | 1 - config/samples/netbox_v1_prefixclaim.yaml | 1 - ...x_v1_prefixclaim_parentprefixselector.yaml | 1 - ...ixclaim_parentprefixselector_bool_int.yaml | 1 - .../dynamic_prefixclaim-large-font.drawio.svg | 2 +- .../prefixclaim-dynamic.drawio.svg | 2 +- .../prefixclaim-dynamic.yaml | 1 - .../prefixclaim-simple.drawio.svg | 2 +- .../prefixclaim-simple.yaml | 1 - .../simple_prefixclaim-large-font.drawio.svg | 2 +- ...ancer-ip-pool-netbox-large-font.drawio.svg | 2 +- .../load-balancer-ip-pool-netbox.yaml | 1 - .../metallb-ipaddresspool-netbox.drawio.svg | 2 +- .../sample-deployment.yaml | 14 +-- .../zurich-pool.yaml | 3 +- .../restoration-large-font.drawio.svg | 2 +- .../restoration.drawio.svg | 2 +- .../exhaustion-1-starting-point.drawio.svg | 2 +- .../exhaustion-2-prefix-exhausted.drawio.svg | 2 +- .../exhaustion-3-after-fix.drawio.svg | 2 +- docs/examples/example5-multicluster/README.md | 2 +- .../example5-multicluster/cluster-cfg.yaml | 17 ++- .../demo-setup.drawio.svg | 2 +- .../example5-multicluster/kustomization.yaml | 1 - .../example5-multicluster/london-pools.yaml | 1 - .../multicluster.drawio.svg | 2 +- .../example5-multicluster/netbox-svc.yaml | 13 +-- .../example5-multicluster/zurich-pools.yaml | 1 - ...perator-high-level-architecture.drawio.svg | 2 +- docs/operational-manual.md | 6 +- ...-with-netbox-running-in-cluster.drawio.svg | 2 +- hack/boilerplate.go.txt | 2 +- kind/job/kustomization.yaml | 9 +- kind/job/load-data-job.yaml | 1 - kind/kustomization.yaml | 1 - kind/load-data-job/README.md | 2 +- kind/load-local-data-job/main.py | 40 +++---- .../netbox-load-local-data-job.yaml | 1 - kind/netbox-db.yaml | 1 - kind/netbox-db/kustomization.yaml | 1 - kind/netbox-db/netbox-db-patch.tmpl.yaml | 1 - kind/netbox-db/netbox-db.yaml | 1 - kind/nginx-unit-config.yaml | 3 +- kind/secret.yaml | 1 - .../chainsaw-test.yaml | 15 ++- .../netbox_v1_prefixclaim.yaml | 13 +-- .../chainsaw-test.yaml | 3 +- .../netbox_v1_prefixclaim-update.yaml | 1 - .../netbox_v1_prefixclaim.yaml | 1 - .../chainsaw-test.yaml | 3 +- .../netbox_v1_prefix_3-wrong-length.yaml | 1 - .../netbox_v1_prefixclaim_1.yaml | 1 - .../netbox_v1_prefixclaim_2.yaml | 1 - .../netbox_v1_prefixclaim_3.yaml | 1 - .../chainsaw-test.yaml | 5 +- .../netbox_v1_prefixclaim.yaml | 13 +-- .../chainsaw-test.yaml | 3 +- .../netbox_v1_prefixclaim_1.yaml | 9 +- .../netbox_v1_prefixclaim_2.yaml | 9 +- .../chainsaw-test.yaml | 3 +- .../netbox_v1_prefixclaim.yaml | 13 +-- .../chainsaw-test.yaml | 3 +- .../netbox_v1_prefixclaim_1.yaml | 1 - .../netbox_v1_prefixclaim_2.yaml | 1 - .../netbox_v1_prefixclaim_3.yaml | 1 - .../chainsaw-test.yaml | 3 +- .../netbox_v1_prefix_1.yaml | 1 - .../netbox_v1_prefixclaim_1.yaml | 1 - .../chainsaw-test.yaml | 3 +- .../netbox_v1_prefixclaim-update.yaml | 9 +- .../netbox_v1_prefixclaim.yaml | 9 +- tests/e2e/README.md | 2 +- .../chainsaw-test.yaml | 3 +- .../netbox_v1_ipaddressclaim-update.yaml | 1 - .../netbox_v1_ipaddressclaim.yaml | 1 - .../chainsaw-test.yaml | 5 +- .../netbox_v1_ipaddressclaim_1.yaml | 1 - .../netbox_v1_ipaddressclaim_2.yaml | 1 - .../netbox_v1_ipaddressclaim_3.yaml | 1 - .../chainsaw-test.yaml | 7 +- .../netbox_v1_ipaddressclaim_1.yaml | 1 - .../netbox_v1_ipaddressclaim_2.yaml | 1 - .../chainsaw-test.yaml | 5 +- .../netbox_v1_ipaddress_1.yaml | 1 - .../netbox_v1_ipaddressclaim_1.yaml | 1 - .../chainsaw-test.yaml | 3 +- .../netbox_v1_ipaddressclaim-update.yaml | 1 - .../netbox_v1_ipaddressclaim.yaml | 1 - .../chainsaw-test.yaml | 5 +- .../netbox_v1_ipaddressclaim_1.yaml | 1 - .../netbox_v1_ipaddressclaim_2.yaml | 1 - .../netbox_v1_ipaddressclaim_3.yaml | 1 - .../chainsaw-test.yaml | 7 +- .../netbox_v1_ipaddressclaim_1.yaml | 1 - .../netbox_v1_ipaddressclaim_2.yaml | 1 - .../chainsaw-test.yaml | 3 +- .../netbox_v1_iprangeclaim-update.yaml | 1 - .../netbox_v1_iprangeclaim.yaml | 1 - .../chainsaw-test.yaml | 3 +- .../netbox_v1_iprangeclaim.yaml | 1 - .../chainsaw-test.yaml | 3 +- .../netbox_v1_iprangeclaim.yaml | 1 - .../chainsaw-test.yaml | 3 +- .../netbox_v1_iprangeclaim.yaml | 1 - .../chainsaw-test.yaml | 3 +- .../netbox_v1_iprangeclaim.yaml | 1 - .../chainsaw-test.yaml | 3 +- .../netbox_v1_iprangeclaim.yaml | 1 - .../chainsaw-test.yaml | 3 +- .../netbox_v1_iprangeclaim.yaml | 1 - .../chainsaw-test.yaml | 5 +- .../netbox_v1_iprangeclaim_1.yaml | 1 - .../netbox_v1_iprangeclaim_2.yaml | 1 - .../netbox_v1_iprangeclaim_3.yaml | 1 - .../chainsaw-test.yaml | 7 +- .../netbox_v1_iprangeclaim_1.yaml | 1 - .../netbox_v1_iprangeclaim_2.yaml | 1 - .../chainsaw-test.yaml | 3 +- .../netbox_v1_iprange_1.yaml | 1 - .../netbox_v1_iprangeclaim_1.yaml | 1 - .../chainsaw-test.yaml | 3 +- .../netbox_v1_iprangeclaim-update.yaml | 1 - .../netbox_v1_iprangeclaim.yaml | 1 - .../chainsaw-test.yaml | 5 +- .../netbox_v1_iprangeclaim_1.yaml | 1 - .../netbox_v1_iprangeclaim_2.yaml | 1 - .../netbox_v1_iprangeclaim_3.yaml | 1 - .../chainsaw-test.yaml | 7 +- .../netbox_v1_iprangeclaim_1.yaml | 1 - .../netbox_v1_iprangeclaim_2.yaml | 1 - tests/e2e/kind-config.yaml | 1 - tools/.golangci.yaml | 1 - 176 files changed, 600 insertions(+), 746 deletions(-) diff --git a/.github/dependabot.yaml b/.github/dependabot.yaml index ded66059..0d0d58b6 100644 --- a/.github/dependabot.yaml +++ b/.github/dependabot.yaml @@ -1,4 +1,3 @@ ---- version: 2 updates: - package-ecosystem: github-actions diff --git a/.github/workflows/build-image.yaml b/.github/workflows/build-image.yaml index f191cd94..8c1cf41b 100644 --- a/.github/workflows/build-image.yaml +++ b/.github/workflows/build-image.yaml @@ -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 2183ad25..d094006a 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -1,4 +1,3 @@ ---- # For most projects, this workflow file will not need changing; you simply need # to commit it to your repository. # @@ -14,9 +13,9 @@ name: "CodeQL Advanced" on: push: - branches: ["main"] + branches: [ "main" ] pull_request: - branches: ["main"] + branches: [ "main" ] schedule: - cron: '41 6 * * 1' @@ -44,58 +43,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 61fbff9e..bc409064 100644 --- a/.github/workflows/e2e-tests.yaml +++ b/.github/workflows/e2e-tests.yaml @@ -1,4 +1,3 @@ ---- # Modified from https://github.com/prometheus-operator/prometheus-operator/blob/main/.github/workflows/e2e-feature-gated.yaml name: e2e-tests permissions: @@ -21,41 +20,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 6249568a..d8b4a9d9 100644 --- a/.github/workflows/govuln.yaml +++ b/.github/workflows/govuln.yaml @@ -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 455e11a8..b4c7c0c1 100644 --- a/.github/workflows/integration-test.yaml +++ b/.github/workflows/integration-test.yaml @@ -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 77e198c1..5fa64f19 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -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,7 +61,7 @@ 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: @@ -69,6 +69,6 @@ jobs: yamllint: runs-on: ubuntu-latest steps: - - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 + - 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 2f5581b6..3ea95705 100644 --- a/.github/workflows/unit-test.yaml +++ b/.github/workflows/unit-test.yaml @@ -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/CONTRIBUTING.md b/CONTRIBUTING.md index 426d7177..0c7fdc22 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 47af0674..3cfd4c45 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/default/kustomization.yaml b/config/default/kustomization.yaml index 9a20b56a..d8b33ff1 100644 --- a/config/default/kustomization.yaml +++ b/config/default/kustomization.yaml @@ -1,4 +1,3 @@ ---- # Adds namespace to all resources. namespace: netbox-operator-system @@ -16,18 +15,18 @@ namePrefix: netbox-operator- # someName: someValue resources: - - ../crd - - ../rbac - - ../manager - # [WEBHOOK] To enable webhook, uncomment all the sections with [WEBHOOK] prefix including the one in - # crd/kustomization.yaml - #- ../webhook - # [CERTMANAGER] To enable cert-manager, uncomment all sections with 'CERTMANAGER'. 'WEBHOOK' components are required. - #- ../certmanager - # [PROMETHEUS] To enable prometheus monitor, uncomment all sections with 'PROMETHEUS'. - #- ../prometheus - # [METRICS] Expose the controller manager metrics service. - - metrics_service.yaml +- ../crd +- ../rbac +- ../manager +# [WEBHOOK] To enable webhook, uncomment all the sections with [WEBHOOK] prefix including the one in +# crd/kustomization.yaml +#- ../webhook +# [CERTMANAGER] To enable cert-manager, uncomment all sections with 'CERTMANAGER'. 'WEBHOOK' components are required. +#- ../certmanager +# [PROMETHEUS] To enable prometheus monitor, uncomment all sections with 'PROMETHEUS'. +#- ../prometheus +# [METRICS] Expose the controller manager metrics service. +- metrics_service.yaml # [NETWORK POLICY] Protect the /metrics endpoint and Webhook Server with NetworkPolicy. # Only Pod(s) running a namespace labeled with 'metrics: enabled' will be able to gather the metrics. # Only CR(s) which requires webhooks and are applied on namespaces labeled with 'webhooks: enabled' will @@ -36,11 +35,11 @@ resources: # Uncomment the patches line if you enable Metrics, and/or are using webhooks and cert-manager patches: - # [METRICS] The following patch will enable the metrics endpoint using HTTPS and the port :8443. - # More info: https://book.kubebuilder.io/reference/metrics - - path: manager_metrics_patch.yaml - target: - kind: Deployment +# [METRICS] The following patch will enable the metrics endpoint using HTTPS and the port :8443. +# More info: https://book.kubebuilder.io/reference/metrics +- path: manager_metrics_patch.yaml + target: + kind: Deployment # [WEBHOOK] To enable webhook, uncomment all the sections with [WEBHOOK] prefix including the one in # crd/kustomization.yaml diff --git a/config/default/manager_metrics_patch.yaml b/config/default/manager_metrics_patch.yaml index 8d2c94e4..2aaef653 100644 --- a/config/default/manager_metrics_patch.yaml +++ b/config/default/manager_metrics_patch.yaml @@ -1,4 +1,3 @@ ---- # This patch adds the args to allow exposing the metrics endpoint using HTTPS - op: add path: /spec/template/spec/containers/0/args/0 diff --git a/config/default/metrics_service.yaml b/config/default/metrics_service.yaml index 5fb6cca7..694b9dfd 100644 --- a/config/default/metrics_service.yaml +++ b/config/default/metrics_service.yaml @@ -1,4 +1,3 @@ ---- apiVersion: v1 kind: Service metadata: @@ -10,10 +9,10 @@ metadata: namespace: system spec: ports: - - name: https - port: 8443 - protocol: TCP - targetPort: 8443 + - name: https + port: 8443 + protocol: TCP + targetPort: 8443 selector: control-plane: controller-manager app.kubernetes.io/part-of: netbox-operator diff --git a/config/manager/kustomization.yaml b/config/manager/kustomization.yaml index 59639615..5c5f0b84 100644 --- a/config/manager/kustomization.yaml +++ b/config/manager/kustomization.yaml @@ -1,3 +1,2 @@ ---- resources: - - manager.yaml +- manager.yaml diff --git a/config/manager/manager.yaml b/config/manager/manager.yaml index f0f31d02..aeaf352b 100644 --- a/config/manager/manager.yaml +++ b/config/manager/manager.yaml @@ -55,42 +55,42 @@ spec: # seccompProfile: # type: RuntimeDefault containers: - - command: - - /manager - args: - - --leader-elect - image: controller:latest - name: manager - env: - - name: POD_NAMESPACE - valueFrom: - fieldRef: - fieldPath: metadata.namespace - securityContext: - allowPrivilegeEscalation: false - capabilities: - drop: - - "ALL" - livenessProbe: - httpGet: - path: /healthz - port: 8081 - initialDelaySeconds: 15 - periodSeconds: 20 - readinessProbe: - httpGet: - path: /readyz - port: 8081 - initialDelaySeconds: 5 - periodSeconds: 10 - # TODO(user): Configure the resources accordingly based on the project requirements. - # More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ - resources: - limits: - cpu: 500m - memory: 128Mi - requests: - cpu: 10m - memory: 64Mi + - command: + - /manager + args: + - --leader-elect + image: controller:latest + name: manager + env: + - name: POD_NAMESPACE + valueFrom: + fieldRef: + fieldPath: metadata.namespace + securityContext: + allowPrivilegeEscalation: false + capabilities: + drop: + - "ALL" + livenessProbe: + httpGet: + path: /healthz + port: 8081 + initialDelaySeconds: 15 + periodSeconds: 20 + readinessProbe: + httpGet: + path: /readyz + port: 8081 + initialDelaySeconds: 5 + periodSeconds: 10 + # TODO(user): Configure the resources accordingly based on the project requirements. + # More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ + resources: + limits: + cpu: 500m + memory: 128Mi + requests: + cpu: 10m + memory: 64Mi serviceAccountName: controller-manager terminationGracePeriodSeconds: 10 diff --git a/config/network-policy/allow-metrics-traffic.yaml b/config/network-policy/allow-metrics-traffic.yaml index 9e7e0996..2aaa7fdd 100644 --- a/config/network-policy/allow-metrics-traffic.yaml +++ b/config/network-policy/allow-metrics-traffic.yaml @@ -1,4 +1,3 @@ ---- # This NetworkPolicy allows ingress traffic # with Pods running on namespaces labeled with 'metrics: enabled'. Only Pods on those # namespaces are able to gathering data from the metrics endpoint. @@ -19,9 +18,9 @@ spec: ingress: # This allows ingress traffic from any namespace with the label metrics: enabled - from: - - namespaceSelector: - matchLabels: - metrics: enabled # Only from namespaces with this label + - namespaceSelector: + matchLabels: + metrics: enabled # Only from namespaces with this label ports: - port: 8443 protocol: TCP diff --git a/config/network-policy/kustomization.yaml b/config/network-policy/kustomization.yaml index b9c733ff..ec0fb5e5 100644 --- a/config/network-policy/kustomization.yaml +++ b/config/network-policy/kustomization.yaml @@ -1,3 +1,2 @@ ---- resources: - - allow-metrics-traffic.yaml +- allow-metrics-traffic.yaml diff --git a/config/prometheus/kustomization.yaml b/config/prometheus/kustomization.yaml index c4aaaee0..ed137168 100644 --- a/config/prometheus/kustomization.yaml +++ b/config/prometheus/kustomization.yaml @@ -1,3 +1,2 @@ ---- resources: - - monitor.yaml +- monitor.yaml diff --git a/config/prometheus/monitor.yaml b/config/prometheus/monitor.yaml index 37080eb7..fe512d22 100644 --- a/config/prometheus/monitor.yaml +++ b/config/prometheus/monitor.yaml @@ -1,4 +1,3 @@ ---- # Prometheus Monitor Service (Metrics) apiVersion: monitoring.coreos.com/v1 kind: ServiceMonitor @@ -13,7 +12,7 @@ metadata: spec: endpoints: - path: /metrics - port: https # Ensure this is the name of the port that exposes HTTPS metrics + port: https # Ensure this is the name of the port that exposes HTTPS metrics scheme: https bearerTokenFile: /var/run/secrets/kubernetes.io/serviceaccount/token tlsConfig: diff --git a/config/rbac/ipaddress_editor_role.yaml b/config/rbac/ipaddress_editor_role.yaml index 9735e42a..75da2578 100644 --- a/config/rbac/ipaddress_editor_role.yaml +++ b/config/rbac/ipaddress_editor_role.yaml @@ -1,4 +1,3 @@ ---- # permissions for end users to edit ipaddresses. apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole @@ -12,21 +11,21 @@ metadata: app.kubernetes.io/managed-by: kustomize name: ipaddress-editor-role rules: - - apiGroups: - - netbox.dev - resources: - - ipaddresses - verbs: - - create - - delete - - get - - list - - patch - - update - - watch - - apiGroups: - - netbox.dev - resources: - - ipaddresses/status - verbs: - - get +- apiGroups: + - netbox.dev + resources: + - ipaddresses + verbs: + - create + - delete + - get + - list + - patch + - update + - watch +- apiGroups: + - netbox.dev + resources: + - ipaddresses/status + verbs: + - get diff --git a/config/rbac/ipaddress_viewer_role.yaml b/config/rbac/ipaddress_viewer_role.yaml index bf56702e..c5f1bf22 100644 --- a/config/rbac/ipaddress_viewer_role.yaml +++ b/config/rbac/ipaddress_viewer_role.yaml @@ -1,4 +1,3 @@ ---- # permissions for end users to view ipaddresses. apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole @@ -12,17 +11,17 @@ metadata: app.kubernetes.io/managed-by: kustomize name: ipaddress-viewer-role rules: - - apiGroups: - - netbox.dev - resources: - - ipaddresses - verbs: - - get - - list - - watch - - apiGroups: - - netbox.dev - resources: - - ipaddresses/status - verbs: - - get +- apiGroups: + - netbox.dev + resources: + - ipaddresses + verbs: + - get + - list + - watch +- apiGroups: + - netbox.dev + resources: + - ipaddresses/status + verbs: + - get diff --git a/config/rbac/ipaddressclaim_editor_role.yaml b/config/rbac/ipaddressclaim_editor_role.yaml index eba5baa3..b05f6592 100644 --- a/config/rbac/ipaddressclaim_editor_role.yaml +++ b/config/rbac/ipaddressclaim_editor_role.yaml @@ -1,4 +1,3 @@ ---- # permissions for end users to edit ipaddressclaims. apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole @@ -12,21 +11,21 @@ metadata: app.kubernetes.io/managed-by: kustomize name: ipaddressclaim-editor-role rules: - - apiGroups: - - netbox.dev - resources: - - ipaddressclaims - verbs: - - create - - delete - - get - - list - - patch - - update - - watch - - apiGroups: - - netbox.dev - resources: - - ipaddressclaims/status - verbs: - - get +- apiGroups: + - netbox.dev + resources: + - ipaddressclaims + verbs: + - create + - delete + - get + - list + - patch + - update + - watch +- apiGroups: + - netbox.dev + resources: + - ipaddressclaims/status + verbs: + - get diff --git a/config/rbac/ipaddressclaim_viewer_role.yaml b/config/rbac/ipaddressclaim_viewer_role.yaml index bfa2466f..5421fc7c 100644 --- a/config/rbac/ipaddressclaim_viewer_role.yaml +++ b/config/rbac/ipaddressclaim_viewer_role.yaml @@ -1,4 +1,3 @@ ---- # permissions for end users to view ipaddressclaims. apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole @@ -12,17 +11,17 @@ metadata: app.kubernetes.io/managed-by: kustomize name: ipaddressclaim-viewer-role rules: - - apiGroups: - - netbox.dev - resources: - - ipaddressclaims - verbs: - - get - - list - - watch - - apiGroups: - - netbox.dev - resources: - - ipaddressclaims/status - verbs: - - get +- apiGroups: + - netbox.dev + resources: + - ipaddressclaims + verbs: + - get + - list + - watch +- apiGroups: + - netbox.dev + resources: + - ipaddressclaims/status + verbs: + - get diff --git a/config/rbac/iprange_editor_role.yaml b/config/rbac/iprange_editor_role.yaml index 6775cffc..bf55807d 100644 --- a/config/rbac/iprange_editor_role.yaml +++ b/config/rbac/iprange_editor_role.yaml @@ -1,4 +1,3 @@ ---- # permissions for end users to edit ipranges. apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole @@ -12,21 +11,21 @@ metadata: app.kubernetes.io/managed-by: kustomize name: iprange-editor-role rules: - - apiGroups: - - netbox.dev - resources: - - ipranges - verbs: - - create - - delete - - get - - list - - patch - - update - - watch - - apiGroups: - - netbox.dev - resources: - - ipranges/status - verbs: - - get +- apiGroups: + - netbox.dev + resources: + - ipranges + verbs: + - create + - delete + - get + - list + - patch + - update + - watch +- apiGroups: + - netbox.dev + resources: + - ipranges/status + verbs: + - get diff --git a/config/rbac/iprange_viewer_role.yaml b/config/rbac/iprange_viewer_role.yaml index 2839df90..73ac9ab6 100644 --- a/config/rbac/iprange_viewer_role.yaml +++ b/config/rbac/iprange_viewer_role.yaml @@ -1,4 +1,3 @@ ---- # permissions for end users to view ipranges. apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole @@ -12,17 +11,17 @@ metadata: app.kubernetes.io/managed-by: kustomize name: iprange-viewer-role rules: - - apiGroups: - - netbox.dev - resources: - - ipranges - verbs: - - get - - list - - watch - - apiGroups: - - netbox.dev - resources: - - ipranges/status - verbs: - - get +- apiGroups: + - netbox.dev + resources: + - ipranges + verbs: + - get + - list + - watch +- apiGroups: + - netbox.dev + resources: + - ipranges/status + verbs: + - get diff --git a/config/rbac/iprangeclaim_editor_role.yaml b/config/rbac/iprangeclaim_editor_role.yaml index 09819d46..4be0b278 100644 --- a/config/rbac/iprangeclaim_editor_role.yaml +++ b/config/rbac/iprangeclaim_editor_role.yaml @@ -1,4 +1,3 @@ ---- # permissions for end users to edit iprangeclaims. apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole @@ -12,21 +11,21 @@ metadata: app.kubernetes.io/managed-by: kustomize name: iprangeclaim-editor-role rules: - - apiGroups: - - netbox.dev - resources: - - iprangeclaims - verbs: - - create - - delete - - get - - list - - patch - - update - - watch - - apiGroups: - - netbox.dev - resources: - - iprangeclaims/status - verbs: - - get +- apiGroups: + - netbox.dev + resources: + - iprangeclaims + verbs: + - create + - delete + - get + - list + - patch + - update + - watch +- apiGroups: + - netbox.dev + resources: + - iprangeclaims/status + verbs: + - get diff --git a/config/rbac/iprangeclaim_viewer_role.yaml b/config/rbac/iprangeclaim_viewer_role.yaml index 276cffba..b81cf354 100644 --- a/config/rbac/iprangeclaim_viewer_role.yaml +++ b/config/rbac/iprangeclaim_viewer_role.yaml @@ -1,4 +1,3 @@ ---- # permissions for end users to view iprangeclaims. apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole @@ -12,17 +11,17 @@ metadata: app.kubernetes.io/managed-by: kustomize name: iprangeclaim-viewer-role rules: - - apiGroups: - - netbox.dev - resources: - - iprangeclaims - verbs: - - get - - list - - watch - - apiGroups: - - netbox.dev - resources: - - iprangeclaims/status - verbs: - - get +- apiGroups: + - netbox.dev + resources: + - iprangeclaims + verbs: + - get + - list + - watch +- apiGroups: + - netbox.dev + resources: + - iprangeclaims/status + verbs: + - get diff --git a/config/rbac/kustomization.yaml b/config/rbac/kustomization.yaml index 8d27f987..5e7297eb 100644 --- a/config/rbac/kustomization.yaml +++ b/config/rbac/kustomization.yaml @@ -1,29 +1,28 @@ ---- resources: - # All RBAC will be applied under this service account in - # the deployment namespace. You may comment out this resource - # if your manager will use a service account that exists at - # runtime. Be sure to update RoleBinding and ClusterRoleBinding - # subjects if changing service account names. - - service_account.yaml - - role.yaml - - role_binding.yaml - - leader_election_role.yaml - - leader_election_role_binding.yaml - # The following RBAC configurations are used to protect - # the metrics endpoint with authn/authz. These configurations - # ensure that only authorized users and service accounts - # can access the metrics endpoint. Comment the following - # permissions if you want to disable this protection. - # More info: https://book.kubebuilder.io/reference/metrics.html - - metrics_auth_role.yaml - - metrics_auth_role_binding.yaml - - metrics_reader_role.yaml - # For each CRD, "Editor" and "Viewer" roles are scaffolded by - # default, aiding admins in cluster management. Those roles are - # not used by the Project itself. You can comment the following lines - # if you do not want those helpers be installed with your Project. - - prefixclaim_editor_role.yaml - - prefixclaim_viewer_role.yaml - - prefix_editor_role.yaml - - prefix_viewer_role.yaml +# All RBAC will be applied under this service account in +# the deployment namespace. You may comment out this resource +# if your manager will use a service account that exists at +# runtime. Be sure to update RoleBinding and ClusterRoleBinding +# subjects if changing service account names. +- service_account.yaml +- role.yaml +- role_binding.yaml +- leader_election_role.yaml +- leader_election_role_binding.yaml +# The following RBAC configurations are used to protect +# the metrics endpoint with authn/authz. These configurations +# ensure that only authorized users and service accounts +# can access the metrics endpoint. Comment the following +# permissions if you want to disable this protection. +# More info: https://book.kubebuilder.io/reference/metrics.html +- metrics_auth_role.yaml +- metrics_auth_role_binding.yaml +- metrics_reader_role.yaml +# For each CRD, "Editor" and "Viewer" roles are scaffolded by +# default, aiding admins in cluster management. Those roles are +# not used by the Project itself. You can comment the following lines +# if you do not want those helpers be installed with your Project. +- prefixclaim_editor_role.yaml +- prefixclaim_viewer_role.yaml +- prefix_editor_role.yaml +- prefix_viewer_role.yaml diff --git a/config/rbac/leader_election_role.yaml b/config/rbac/leader_election_role.yaml index 4d6417da..f7acd40f 100644 --- a/config/rbac/leader_election_role.yaml +++ b/config/rbac/leader_election_role.yaml @@ -1,4 +1,3 @@ ---- # permissions to do leader election. apiVersion: rbac.authorization.k8s.io/v1 kind: Role @@ -12,34 +11,34 @@ metadata: app.kubernetes.io/managed-by: kustomize name: leader-election-role rules: - - apiGroups: - - "" - resources: - - configmaps - verbs: - - get - - list - - watch - - create - - update - - patch - - delete - - apiGroups: - - coordination.k8s.io - resources: - - leases - verbs: - - get - - list - - watch - - create - - update - - patch - - delete - - apiGroups: - - "" - resources: - - events - verbs: - - create - - patch +- apiGroups: + - "" + resources: + - configmaps + verbs: + - get + - list + - watch + - create + - update + - patch + - delete +- apiGroups: + - coordination.k8s.io + resources: + - leases + verbs: + - get + - list + - watch + - create + - update + - patch + - delete +- apiGroups: + - "" + resources: + - events + verbs: + - create + - patch diff --git a/config/rbac/leader_election_role_binding.yaml b/config/rbac/leader_election_role_binding.yaml index 59638111..64ac99d7 100644 --- a/config/rbac/leader_election_role_binding.yaml +++ b/config/rbac/leader_election_role_binding.yaml @@ -1,4 +1,3 @@ ---- apiVersion: rbac.authorization.k8s.io/v1 kind: RoleBinding metadata: @@ -15,6 +14,6 @@ roleRef: kind: Role name: leader-election-role subjects: - - kind: ServiceAccount - name: controller-manager - namespace: system +- kind: ServiceAccount + name: controller-manager + namespace: system diff --git a/config/rbac/metrics_auth_role.yaml b/config/rbac/metrics_auth_role.yaml index fdeed0f6..32d2e4ec 100644 --- a/config/rbac/metrics_auth_role.yaml +++ b/config/rbac/metrics_auth_role.yaml @@ -1,18 +1,17 @@ ---- apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole metadata: name: metrics-auth-role rules: - - apiGroups: - - authentication.k8s.io - resources: - - tokenreviews - verbs: - - create - - apiGroups: - - authorization.k8s.io - resources: - - subjectaccessreviews - verbs: - - create +- apiGroups: + - authentication.k8s.io + resources: + - tokenreviews + verbs: + - create +- apiGroups: + - authorization.k8s.io + resources: + - subjectaccessreviews + verbs: + - create diff --git a/config/rbac/metrics_auth_role_binding.yaml b/config/rbac/metrics_auth_role_binding.yaml index fcc02ef8..e775d67f 100644 --- a/config/rbac/metrics_auth_role_binding.yaml +++ b/config/rbac/metrics_auth_role_binding.yaml @@ -1,4 +1,3 @@ ---- apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding metadata: @@ -8,6 +7,6 @@ roleRef: kind: ClusterRole name: metrics-auth-role subjects: - - kind: ServiceAccount - name: controller-manager - namespace: system +- kind: ServiceAccount + name: controller-manager + namespace: system diff --git a/config/rbac/metrics_reader_role.yaml b/config/rbac/metrics_reader_role.yaml index 8e6154f3..51a75db4 100644 --- a/config/rbac/metrics_reader_role.yaml +++ b/config/rbac/metrics_reader_role.yaml @@ -1,10 +1,9 @@ ---- apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole metadata: name: metrics-reader rules: - - nonResourceURLs: - - "/metrics" - verbs: - - get +- nonResourceURLs: + - "/metrics" + verbs: + - get diff --git a/config/rbac/prefix_editor_role.yaml b/config/rbac/prefix_editor_role.yaml index 454895b3..e69aa810 100644 --- a/config/rbac/prefix_editor_role.yaml +++ b/config/rbac/prefix_editor_role.yaml @@ -1,4 +1,3 @@ ---- # permissions for end users to edit prefixes. apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole @@ -8,21 +7,21 @@ metadata: app.kubernetes.io/managed-by: kustomize name: prefix-editor-role rules: - - apiGroups: - - netbox.dev - resources: - - prefixes - verbs: - - create - - delete - - get - - list - - patch - - update - - watch - - apiGroups: - - netbox.dev - resources: - - prefixes/status - verbs: - - get +- apiGroups: + - netbox.dev + resources: + - prefixes + verbs: + - create + - delete + - get + - list + - patch + - update + - watch +- apiGroups: + - netbox.dev + resources: + - prefixes/status + verbs: + - get diff --git a/config/rbac/prefix_viewer_role.yaml b/config/rbac/prefix_viewer_role.yaml index 0b46d1a6..7074298f 100644 --- a/config/rbac/prefix_viewer_role.yaml +++ b/config/rbac/prefix_viewer_role.yaml @@ -1,4 +1,3 @@ ---- # permissions for end users to view prefixes. apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole @@ -8,17 +7,17 @@ metadata: app.kubernetes.io/managed-by: kustomize name: prefix-viewer-role rules: - - apiGroups: - - netbox.dev - resources: - - prefixes - verbs: - - get - - list - - watch - - apiGroups: - - netbox.dev - resources: - - prefixes/status - verbs: - - get +- apiGroups: + - netbox.dev + resources: + - prefixes + verbs: + - get + - list + - watch +- apiGroups: + - netbox.dev + resources: + - prefixes/status + verbs: + - get diff --git a/config/rbac/prefixclaim_editor_role.yaml b/config/rbac/prefixclaim_editor_role.yaml index 7f4a9ab3..a1c7a670 100644 --- a/config/rbac/prefixclaim_editor_role.yaml +++ b/config/rbac/prefixclaim_editor_role.yaml @@ -1,4 +1,3 @@ ---- # permissions for end users to edit prefixclaims. apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole @@ -8,21 +7,21 @@ metadata: app.kubernetes.io/managed-by: kustomize name: prefixclaim-editor-role rules: - - apiGroups: - - netbox.dev - resources: - - prefixclaims - verbs: - - create - - delete - - get - - list - - patch - - update - - watch - - apiGroups: - - netbox.dev - resources: - - prefixclaims/status - verbs: - - get +- apiGroups: + - netbox.dev + resources: + - prefixclaims + verbs: + - create + - delete + - get + - list + - patch + - update + - watch +- apiGroups: + - netbox.dev + resources: + - prefixclaims/status + verbs: + - get diff --git a/config/rbac/prefixclaim_viewer_role.yaml b/config/rbac/prefixclaim_viewer_role.yaml index eb24b357..b3e05f1f 100644 --- a/config/rbac/prefixclaim_viewer_role.yaml +++ b/config/rbac/prefixclaim_viewer_role.yaml @@ -1,4 +1,3 @@ ---- # permissions for end users to view prefixclaims. apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole @@ -8,17 +7,17 @@ metadata: app.kubernetes.io/managed-by: kustomize name: prefixclaim-viewer-role rules: - - apiGroups: - - netbox.dev - resources: - - prefixclaims - verbs: - - get - - list - - watch - - apiGroups: - - netbox.dev - resources: - - prefixclaims/status - verbs: - - get +- apiGroups: + - netbox.dev + resources: + - prefixclaims + verbs: + - get + - list + - watch +- apiGroups: + - netbox.dev + resources: + - prefixclaims/status + verbs: + - get diff --git a/config/rbac/role_binding.yaml b/config/rbac/role_binding.yaml index 7172532f..a314d41e 100644 --- a/config/rbac/role_binding.yaml +++ b/config/rbac/role_binding.yaml @@ -1,4 +1,3 @@ ---- apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding metadata: @@ -15,6 +14,6 @@ roleRef: kind: ClusterRole name: manager-role subjects: - - kind: ServiceAccount - name: controller-manager - namespace: system +- kind: ServiceAccount + name: controller-manager + namespace: system diff --git a/config/rbac/service_account.yaml b/config/rbac/service_account.yaml index 53d0e612..4cf6eaa6 100644 --- a/config/rbac/service_account.yaml +++ b/config/rbac/service_account.yaml @@ -1,4 +1,3 @@ ---- apiVersion: v1 kind: ServiceAccount metadata: diff --git a/config/samples/kustomization.yaml b/config/samples/kustomization.yaml index fbdf947e..d3f1a9ee 100644 --- a/config/samples/kustomization.yaml +++ b/config/samples/kustomization.yaml @@ -1,12 +1,11 @@ ---- ## 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 4937daee..3a5935c1 100644 --- a/config/samples/netbox_v1_ipaddress.yaml +++ b/config/samples/netbox_v1_ipaddress.yaml @@ -1,4 +1,3 @@ ---- apiVersion: netbox.dev/v1 kind: IpAddress metadata: diff --git a/config/samples/netbox_v1_ipaddressclaim.yaml b/config/samples/netbox_v1_ipaddressclaim.yaml index 8bfdee0b..b067c558 100644 --- a/config/samples/netbox_v1_ipaddressclaim.yaml +++ b/config/samples/netbox_v1_ipaddressclaim.yaml @@ -1,4 +1,3 @@ ---- apiVersion: netbox.dev/v1 kind: IpAddressClaim metadata: diff --git a/config/samples/netbox_v1_iprange.yaml b/config/samples/netbox_v1_iprange.yaml index 93ace170..27142d60 100644 --- a/config/samples/netbox_v1_iprange.yaml +++ b/config/samples/netbox_v1_iprange.yaml @@ -1,4 +1,3 @@ ---- apiVersion: netbox.dev/v1 kind: IpRange metadata: diff --git a/config/samples/netbox_v1_iprangeclaim.yaml b/config/samples/netbox_v1_iprangeclaim.yaml index c6e477bd..75ee44ab 100644 --- a/config/samples/netbox_v1_iprangeclaim.yaml +++ b/config/samples/netbox_v1_iprangeclaim.yaml @@ -1,4 +1,3 @@ ---- apiVersion: netbox.dev/v1 kind: IpRangeClaim metadata: diff --git a/config/samples/netbox_v1_prefix.yaml b/config/samples/netbox_v1_prefix.yaml index 2deecff5..be6e3fa6 100644 --- a/config/samples/netbox_v1_prefix.yaml +++ b/config/samples/netbox_v1_prefix.yaml @@ -1,4 +1,3 @@ ---- apiVersion: netbox.dev/v1 kind: Prefix metadata: diff --git a/config/samples/netbox_v1_prefixclaim.yaml b/config/samples/netbox_v1_prefixclaim.yaml index e8534426..b23712a4 100644 --- a/config/samples/netbox_v1_prefixclaim.yaml +++ b/config/samples/netbox_v1_prefixclaim.yaml @@ -1,4 +1,3 @@ ---- 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 34016354..8a9daea5 100644 --- a/config/samples/netbox_v1_prefixclaim_parentprefixselector.yaml +++ b/config/samples/netbox_v1_prefixclaim_parentprefixselector.yaml @@ -1,4 +1,3 @@ ---- 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 7ee833ca..2f954ab8 100644 --- a/config/samples/netbox_v1_prefixclaim_parentprefixselector_bool_int.yaml +++ b/config/samples/netbox_v1_prefixclaim_parentprefixselector_bool_int.yaml @@ -1,4 +1,3 @@ ---- 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 eb94ee83..56e2c3d2 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 2d652741..00f401cd 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 79d35cea..4a6c0d13 100644 --- a/docs/examples/example1-getting-started/prefixclaim-dynamic.yaml +++ b/docs/examples/example1-getting-started/prefixclaim-dynamic.yaml @@ -1,4 +1,3 @@ ---- 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 455918e5..9e28233a 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 8c1aa937..483a0c3d 100644 --- a/docs/examples/example1-getting-started/prefixclaim-simple.yaml +++ b/docs/examples/example1-getting-started/prefixclaim-simple.yaml @@ -1,4 +1,3 @@ ---- 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 d70174bd..d89c2dbe 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 25f10cb9..ad17f4dc 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
+
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 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 56590d7b..bc84c6ac 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,4 +1,3 @@ ---- 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 3cbc2e0d..5d8997e1 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 1395af8c..51ea0e2e 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 01fbe3a3..0178ee87 100644 --- a/docs/examples/example2-load-balancer-ip/zurich-pool.yaml +++ b/docs/examples/example2-load-balancer-ip/zurich-pool.yaml @@ -1,11 +1,10 @@ ---- 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 848088cd..2e5face7 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
+
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 diff --git a/docs/examples/example3-restoration/restoration.drawio.svg b/docs/examples/example3-restoration/restoration.drawio.svg index 61ed40e5..4bcdca6c 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
+
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 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 3a994c6b..94e9ea20 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
+
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 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 07ba10d9..a2377d28 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
+
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 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 f2ae7e00..13dd249e 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
+
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 diff --git a/docs/examples/example5-multicluster/README.md b/docs/examples/example5-multicluster/README.md index 79459482..7ea53c64 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) +![Example 2](multicluster.drawio.svg) \ No newline at end of file diff --git a/docs/examples/example5-multicluster/cluster-cfg.yaml b/docs/examples/example5-multicluster/cluster-cfg.yaml index e48448f6..0dafb9be 100644 --- a/docs/examples/example5-multicluster/cluster-cfg.yaml +++ b/docs/examples/example5-multicluster/cluster-cfg.yaml @@ -1,15 +1,14 @@ ---- 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 0e2fe831..0c4fe028 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 ca878af6..fe91fc3c 100644 --- a/docs/examples/example5-multicluster/kustomization.yaml +++ b/docs/examples/example5-multicluster/kustomization.yaml @@ -1,4 +1,3 @@ ---- resources: - ../../../kind diff --git a/docs/examples/example5-multicluster/london-pools.yaml b/docs/examples/example5-multicluster/london-pools.yaml index 5bfe7df8..36c9f0db 100644 --- a/docs/examples/example5-multicluster/london-pools.yaml +++ b/docs/examples/example5-multicluster/london-pools.yaml @@ -1,4 +1,3 @@ ---- 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 49d36c3e..a32f6afc 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 ead9f0c8..ddba7fc5 100644 --- a/docs/examples/example5-multicluster/netbox-svc.yaml +++ b/docs/examples/example5-multicluster/netbox-svc.yaml @@ -1,4 +1,3 @@ ---- apiVersion: v1 kind: Service @@ -13,15 +12,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 + sessionAffinity: None \ No newline at end of file diff --git a/docs/examples/example5-multicluster/zurich-pools.yaml b/docs/examples/example5-multicluster/zurich-pools.yaml index e7ceaa37..4d270d8c 100644 --- a/docs/examples/example5-multicluster/zurich-pools.yaml +++ b/docs/examples/example5-multicluster/zurich-pools.yaml @@ -1,4 +1,3 @@ ---- 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 21ea4cb1..62fcb76f 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
+
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 diff --git a/docs/operational-manual.md b/docs/operational-manual.md index 71aa9570..b9162e5b 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 400037a6..5118715c 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
+
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 diff --git a/hack/boilerplate.go.txt b/hack/boilerplate.go.txt index 62667577..6d20a430 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 716fe282..68fcafcd 100644 --- a/kind/job/kustomization.yaml +++ b/kind/job/kustomization.yaml @@ -1,11 +1,10 @@ ---- 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 920da458..5d9bbea9 100644 --- a/kind/job/load-data-job.yaml +++ b/kind/job/load-data-job.yaml @@ -1,4 +1,3 @@ ---- apiVersion: batch/v1 kind: Job metadata: diff --git a/kind/kustomization.yaml b/kind/kustomization.yaml index 35598579..05ecc175 100644 --- a/kind/kustomization.yaml +++ b/kind/kustomization.yaml @@ -1,4 +1,3 @@ ---- resources: - ../config/default - secret.yaml diff --git a/kind/load-data-job/README.md b/kind/load-data-job/README.md index 6cabeb7b..40582c82 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 96de148e..bbac5497 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 5a4e1279..b9ce511b 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,4 +1,3 @@ ---- apiVersion: batch/v1 kind: Job metadata: diff --git a/kind/netbox-db.yaml b/kind/netbox-db.yaml index 5017975c..ead11131 100644 --- a/kind/netbox-db.yaml +++ b/kind/netbox-db.yaml @@ -1,4 +1,3 @@ ---- apiVersion: "acid.zalan.do/v1" kind: postgresql metadata: diff --git a/kind/netbox-db/kustomization.yaml b/kind/netbox-db/kustomization.yaml index f3edbc14..80910a9e 100644 --- a/kind/netbox-db/kustomization.yaml +++ b/kind/netbox-db/kustomization.yaml @@ -1,4 +1,3 @@ ---- 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 a8d947a7..de2cc4ea 100644 --- a/kind/netbox-db/netbox-db-patch.tmpl.yaml +++ b/kind/netbox-db/netbox-db-patch.tmpl.yaml @@ -1,4 +1,3 @@ ---- # 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 af374224..69575f19 100644 --- a/kind/netbox-db/netbox-db.yaml +++ b/kind/netbox-db/netbox-db.yaml @@ -1,4 +1,3 @@ ---- apiVersion: "acid.zalan.do/v1" kind: postgresql metadata: diff --git a/kind/nginx-unit-config.yaml b/kind/nginx-unit-config.yaml index a2b9eb6a..b393ea40 100644 --- a/kind/nginx-unit-config.yaml +++ b/kind/nginx-unit-config.yaml @@ -1,10 +1,9 @@ ---- 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 a4d2b198..afa03d1c 100644 --- a/kind/secret.yaml +++ b/kind/secret.yaml @@ -1,4 +1,3 @@ ---- apiVersion: v1 kind: Secret metadata: 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 ab378f4b..8ddabfdd 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,4 +1,3 @@ ---- apiVersion: chainsaw.kyverno.io/v1alpha1 kind: Test metadata: @@ -20,16 +19,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" @@ -53,5 +52,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 2030e88e..68b5600d 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,4 +1,3 @@ ---- apiVersion: netbox.dev/v1 kind: PrefixClaim metadata: @@ -7,16 +6,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 9ac1a559..a8c05074 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,4 +1,3 @@ ---- apiVersion: chainsaw.kyverno.io/v1alpha1 kind: Test metadata: @@ -83,5 +82,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 bb12a2d4..d51789f8 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,4 +1,3 @@ ---- 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 8eada6a0..8fe50871 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,4 +1,3 @@ ---- 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 c95ebc45..ece8693f 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,4 +1,3 @@ ---- apiVersion: chainsaw.kyverno.io/v1alpha1 kind: Test metadata: @@ -224,6 +223,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 cef188f5..47f0c164 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,4 +1,3 @@ ---- 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 9e5ca433..0c052d67 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,4 +1,3 @@ ---- 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 b4040243..f2d8fa17 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,4 +1,3 @@ ---- 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 a34af89f..6324fa8b 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,4 +1,3 @@ ---- 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 980e0fc2..c45d8aa3 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,4 +1,3 @@ ---- apiVersion: chainsaw.kyverno.io/v1alpha1 kind: Test metadata: @@ -22,7 +21,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" @@ -62,5 +61,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 7f1ce8f4..8df2e862 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,4 +1,3 @@ ---- apiVersion: netbox.dev/v1 kind: PrefixClaim metadata: @@ -7,16 +6,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 48876438..03b61eb9 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,4 +1,3 @@ ---- apiVersion: chainsaw.kyverno.io/v1alpha1 kind: Test metadata: @@ -168,6 +167,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 2758a2b9..f25d8a25 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,4 +1,3 @@ ---- apiVersion: netbox.dev/v1 kind: PrefixClaim metadata: @@ -13,10 +12,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 92a9fa6b..d8239404 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,4 +1,3 @@ ---- apiVersion: netbox.dev/v1 kind: PrefixClaim metadata: @@ -13,10 +12,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 2ddd15cf..0c554c03 100644 --- a/tests/e2e/Prefix/IPv4/prefixclaim-ipv4-parentprefixselector/chainsaw-test.yaml +++ b/tests/e2e/Prefix/IPv4/prefixclaim-ipv4-parentprefixselector/chainsaw-test.yaml @@ -1,4 +1,3 @@ ---- apiVersion: chainsaw.kyverno.io/v1alpha1 kind: Test metadata: @@ -75,5 +74,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 68fa69e2..9511071f 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,4 +1,3 @@ ---- apiVersion: netbox.dev/v1 kind: PrefixClaim metadata: @@ -7,16 +6,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 9c832dcf..d687f60f 100644 --- a/tests/e2e/Prefix/IPv4/prefixclaim-ipv4-prefixexhausted/chainsaw-test.yaml +++ b/tests/e2e/Prefix/IPv4/prefixclaim-ipv4-prefixexhausted/chainsaw-test.yaml @@ -1,4 +1,3 @@ ---- apiVersion: chainsaw.kyverno.io/v1alpha1 kind: Test metadata: @@ -102,7 +101,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 a25f44c3..e28b0cc4 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,4 +1,3 @@ ---- 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 1039c86b..394b1b1e 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,4 +1,3 @@ ---- 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 7ac517eb..ffa12595 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,4 +1,3 @@ ---- 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 dc260c9b..9936b25b 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,4 +1,3 @@ ---- apiVersion: chainsaw.kyverno.io/v1alpha1 kind: Test metadata: @@ -75,5 +74,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 5fc88662..28384041 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,4 +1,3 @@ ---- 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 d3c1a32d..62f80a05 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,4 +1,3 @@ ---- 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 f2914c1f..d4037f53 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,4 +1,3 @@ ---- apiVersion: chainsaw.kyverno.io/v1alpha1 kind: Test metadata: @@ -112,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=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 6c2db0ff..44520e0a 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,4 +1,3 @@ ---- apiVersion: netbox.dev/v1 kind: PrefixClaim metadata: @@ -7,14 +6,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 830a8238..05aa6e0e 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,4 +1,3 @@ ---- apiVersion: netbox.dev/v1 kind: PrefixClaim metadata: @@ -7,14 +6,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 87aee5bd..1459beb5 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 60595009..3225d16d 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,4 +1,3 @@ ---- apiVersion: chainsaw.kyverno.io/v1alpha1 kind: Test metadata: @@ -111,5 +110,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 e7f830dc..526268fd 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,4 +1,3 @@ ---- 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 3d04bf32..0dcc0175 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,4 +1,3 @@ ---- 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 580ce860..68fe6b91 100644 --- a/tests/e2e/ipaddress/ipv4/ipaddressclaim-ipv4-prefixexhausted/chainsaw-test.yaml +++ b/tests/e2e/ipaddress/ipv4/ipaddressclaim-ipv4-prefixexhausted/chainsaw-test.yaml @@ -1,4 +1,3 @@ ---- apiVersion: chainsaw.kyverno.io/v1alpha1 kind: Test metadata: @@ -118,7 +117,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: @@ -137,7 +136,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 ba5f8575..74bb7fe9 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,4 +1,3 @@ ---- 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 320b643b..446ec4ba 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,4 +1,3 @@ ---- 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 e2bef0c7..bdf702c2 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,4 +1,3 @@ ---- 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 59b33bdf..a202d558 100644 --- a/tests/e2e/ipaddress/ipv4/ipaddressclaim-ipv4-restore/chainsaw-test.yaml +++ b/tests/e2e/ipaddress/ipv4/ipaddressclaim-ipv4-restore/chainsaw-test.yaml @@ -1,4 +1,3 @@ ---- apiVersion: chainsaw.kyverno.io/v1alpha1 kind: Test metadata: @@ -46,7 +45,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 @@ -147,7 +146,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 @@ -180,6 +179,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 2b412e94..c6aa4db3 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,4 +1,3 @@ ---- 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 aedbbaa4..51e79035 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,4 +1,3 @@ ---- 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 82da008e..2ed28394 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,4 +1,3 @@ ---- apiVersion: chainsaw.kyverno.io/v1alpha1 kind: Test metadata: @@ -62,7 +61,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 @@ -73,5 +72,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 3ed7d6c0..0c50e4be 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,4 +1,3 @@ ---- 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 dc8ad3f7..52231de8 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,4 +1,3 @@ ---- 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 4bee494c..0e45758c 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,4 +1,3 @@ ---- apiVersion: chainsaw.kyverno.io/v1alpha1 kind: Test metadata: @@ -111,5 +110,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 cc9fc2bb..b992e7d9 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,4 +1,3 @@ ---- 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 1c0ca241..86aa6562 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,4 +1,3 @@ ---- 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 581708bd..8874d64c 100644 --- a/tests/e2e/ipaddress/ipv6/ipaddressclaim-ipv6-prefixexhausted/chainsaw-test.yaml +++ b/tests/e2e/ipaddress/ipv6/ipaddressclaim-ipv6-prefixexhausted/chainsaw-test.yaml @@ -1,4 +1,3 @@ ---- apiVersion: chainsaw.kyverno.io/v1alpha1 kind: Test metadata: @@ -118,7 +117,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: @@ -137,7 +136,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 f0b5f555..8f6c850f 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,4 +1,3 @@ ---- 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 5ee6677f..149cb176 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,4 +1,3 @@ ---- 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 02619580..c0e44c97 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,4 +1,3 @@ ---- 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 1126c35e..29af423f 100644 --- a/tests/e2e/ipaddress/ipv6/ipaddressclaim-ipv6-restore/chainsaw-test.yaml +++ b/tests/e2e/ipaddress/ipv6/ipaddressclaim-ipv6-restore/chainsaw-test.yaml @@ -1,4 +1,3 @@ ---- apiVersion: chainsaw.kyverno.io/v1alpha1 kind: Test metadata: @@ -46,7 +45,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 @@ -147,7 +146,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 @@ -180,6 +179,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 a50a52ec..0b5c0046 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,4 +1,3 @@ ---- 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 9b7f4b9b..e82b5a34 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,4 +1,3 @@ ---- 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 71b7bb85..167fc90e 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,4 +1,3 @@ ---- apiVersion: chainsaw.kyverno.io/v1alpha1 kind: Test metadata: @@ -121,7 +120,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 dfe3d77f..028a21b2 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,4 +1,3 @@ ---- 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 b2e06eb5..1a6d3fba 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,4 +1,3 @@ ---- 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 20e19641..67ec8af4 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,4 +1,3 @@ ---- apiVersion: chainsaw.kyverno.io/v1alpha1 kind: Test metadata: @@ -18,7 +17,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 9994b7d1..fa1aa7c2 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,4 +1,3 @@ ---- 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 449dc58d..d2aa444d 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,4 +1,3 @@ ---- apiVersion: chainsaw.kyverno.io/v1alpha1 kind: Test metadata: @@ -64,7 +63,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 9997d8f7..6a5c953c 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,4 +1,3 @@ ---- 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 296f0b51..499aaeec 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,4 +1,3 @@ ---- apiVersion: chainsaw.kyverno.io/v1alpha1 kind: Test metadata: @@ -64,7 +63,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 6eb17aa1..fc668892 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,4 +1,3 @@ ---- 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 5f04d2e9..24ad0f99 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,4 +1,3 @@ ---- apiVersion: chainsaw.kyverno.io/v1alpha1 kind: Test metadata: @@ -38,7 +37,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 dd494e1e..e7095fbf 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,4 +1,3 @@ ---- 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 6f3221ae..b7099608 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,4 +1,3 @@ ---- apiVersion: chainsaw.kyverno.io/v1alpha1 kind: Test metadata: @@ -18,7 +17,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 afb78a0c..5bcdcb9c 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,4 +1,3 @@ ---- 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 5e43055b..56de3a02 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,4 +1,3 @@ ---- apiVersion: chainsaw.kyverno.io/v1alpha1 kind: Test metadata: @@ -44,7 +43,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 9329b407..c5331315 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,4 +1,3 @@ ---- 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 2c7ae2bc..594ff8b0 100644 --- a/tests/e2e/iprange/ipv4/iprangeclaim-ipv4-prefixexhausted/chainsaw-test.yaml +++ b/tests/e2e/iprange/ipv4/iprangeclaim-ipv4-prefixexhausted/chainsaw-test.yaml @@ -1,4 +1,3 @@ ---- apiVersion: chainsaw.kyverno.io/v1alpha1 kind: Test metadata: @@ -127,7 +126,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 +145,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 54625b7f..e1f8cd07 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,4 +1,3 @@ ---- 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 4665d00a..3eee358a 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,4 +1,3 @@ ---- 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 58a4df99..7d6d3542 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,4 +1,3 @@ ---- 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 962bd36a..9542419f 100644 --- a/tests/e2e/iprange/ipv4/iprangeclaim-ipv4-restore/chainsaw-test.yaml +++ b/tests/e2e/iprange/ipv4/iprangeclaim-ipv4-restore/chainsaw-test.yaml @@ -1,4 +1,3 @@ ---- apiVersion: chainsaw.kyverno.io/v1alpha1 kind: Test metadata: @@ -51,7 +50,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 @@ -163,7 +162,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 @@ -197,7 +196,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 34babb25..c150e949 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,4 +1,3 @@ ---- 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 5045aadc..1f062c7e 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,4 +1,3 @@ ---- 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 434d50ef..3ce686b7 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,4 +1,3 @@ ---- apiVersion: chainsaw.kyverno.io/v1alpha1 kind: Test metadata: @@ -79,5 +78,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 1ca43e3e..b5a92911 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,4 +1,3 @@ ---- 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 0ad1ca46..af8b6fba 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,4 +1,3 @@ ---- 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 8657b581..108b7076 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,4 +1,3 @@ ---- apiVersion: chainsaw.kyverno.io/v1alpha1 kind: Test metadata: @@ -121,7 +120,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 402d1e2b..24aa7f31 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,4 +1,3 @@ ---- 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 a9b0431c..369e771b 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,4 +1,3 @@ ---- 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 69c2fff0..82dc3a01 100644 --- a/tests/e2e/iprange/ipv6/iprangeclaim-ipv6-prefixexhausted/chainsaw-test.yaml +++ b/tests/e2e/iprange/ipv6/iprangeclaim-ipv6-prefixexhausted/chainsaw-test.yaml @@ -1,4 +1,3 @@ ---- apiVersion: chainsaw.kyverno.io/v1alpha1 kind: Test metadata: @@ -128,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: @@ -147,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/ipv6/iprangeclaim-ipv6-prefixexhausted/netbox_v1_iprangeclaim_1.yaml b/tests/e2e/iprange/ipv6/iprangeclaim-ipv6-prefixexhausted/netbox_v1_iprangeclaim_1.yaml index 8a8320e6..af3bf2f7 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,4 +1,3 @@ ---- 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 ed30ba38..19bd62ea 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,4 +1,3 @@ ---- 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 555a2c4c..c734ff84 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,4 +1,3 @@ ---- 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 04bf0bc7..aa3c07c3 100644 --- a/tests/e2e/iprange/ipv6/iprangeclaim-ipv6-restore/chainsaw-test.yaml +++ b/tests/e2e/iprange/ipv6/iprangeclaim-ipv6-restore/chainsaw-test.yaml @@ -1,4 +1,3 @@ ---- apiVersion: chainsaw.kyverno.io/v1alpha1 kind: Test metadata: @@ -51,7 +50,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 @@ -163,7 +162,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 @@ -197,7 +196,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 7c9b8c3a..6175ca54 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,4 +1,3 @@ ---- 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 fe04b36e..7a378141 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,4 +1,3 @@ ---- apiVersion: netbox.dev/v1 kind: IpRangeClaim metadata: diff --git a/tests/e2e/kind-config.yaml b/tests/e2e/kind-config.yaml index e199b514..eb2557ce 100644 --- a/tests/e2e/kind-config.yaml +++ b/tests/e2e/kind-config.yaml @@ -1,4 +1,3 @@ ---- # 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 8542f39b..dfcd2b6e 100644 --- a/tools/.golangci.yaml +++ b/tools/.golangci.yaml @@ -1,4 +1,3 @@ ---- version: "2" linters: default: none From cb49732df5e1e8e38e4626fc449f2a4e2d9beb53 Mon Sep 17 00:00:00 2001 From: Joel Studler Date: Thu, 17 Jul 2025 13:32:12 +0200 Subject: [PATCH 09/13] pre-commit run --files $(find .) --- .github/dependabot.yaml | 1 + .github/workflows/build-image.yaml | 2 +- .github/workflows/codeql.yml | 103 +++++++++--------- .github/workflows/e2e-tests.yaml | 61 ++++++----- .github/workflows/govuln.yaml | 6 +- .github/workflows/integration-test.yaml | 6 +- .github/workflows/lint.yaml | 10 +- .github/workflows/unit-test.yaml | 6 +- CONTRIBUTING.md | 4 +- ParentPrefixSelectorGuide.md | 2 +- config/default/kustomization.yaml | 35 +++--- config/default/manager_metrics_patch.yaml | 1 + config/default/metrics_service.yaml | 9 +- config/manager/kustomization.yaml | 3 +- config/manager/manager.yaml | 74 ++++++------- .../network-policy/allow-metrics-traffic.yaml | 7 +- config/network-policy/kustomization.yaml | 3 +- config/prometheus/kustomization.yaml | 3 +- config/prometheus/monitor.yaml | 3 +- config/samples/kustomization.yaml | 19 ++-- config/samples/netbox_v1_ipaddress.yaml | 1 + config/samples/netbox_v1_ipaddressclaim.yaml | 1 + config/samples/netbox_v1_iprange.yaml | 1 + config/samples/netbox_v1_iprangeclaim.yaml | 1 + config/samples/netbox_v1_prefix.yaml | 1 + config/samples/netbox_v1_prefixclaim.yaml | 1 + ...x_v1_prefixclaim_parentprefixselector.yaml | 1 + ...ixclaim_parentprefixselector_bool_int.yaml | 1 + .../dynamic_prefixclaim-large-font.drawio.svg | 2 +- .../prefixclaim-dynamic.drawio.svg | 2 +- .../prefixclaim-dynamic.yaml | 1 + .../prefixclaim-simple.drawio.svg | 2 +- .../prefixclaim-simple.yaml | 1 + .../simple_prefixclaim-large-font.drawio.svg | 2 +- ...ancer-ip-pool-netbox-large-font.drawio.svg | 2 +- .../load-balancer-ip-pool-netbox.yaml | 1 + .../metallb-ipaddresspool-netbox.drawio.svg | 2 +- .../sample-deployment.yaml | 14 +-- .../zurich-pool.yaml | 3 +- .../restoration-large-font.drawio.svg | 2 +- .../restoration.drawio.svg | 2 +- .../exhaustion-1-starting-point.drawio.svg | 2 +- .../exhaustion-2-prefix-exhausted.drawio.svg | 2 +- .../exhaustion-3-after-fix.drawio.svg | 2 +- docs/examples/example5-multicluster/README.md | 2 +- .../example5-multicluster/cluster-cfg.yaml | 17 +-- .../demo-setup.drawio.svg | 2 +- .../example5-multicluster/kustomization.yaml | 1 + .../example5-multicluster/london-pools.yaml | 1 + .../multicluster.drawio.svg | 2 +- .../example5-multicluster/netbox-svc.yaml | 13 ++- .../example5-multicluster/zurich-pools.yaml | 1 + ...perator-high-level-architecture.drawio.svg | 2 +- docs/operational-manual.md | 6 +- ...-with-netbox-running-in-cluster.drawio.svg | 2 +- hack/boilerplate.go.txt | 2 +- kind/job/kustomization.yaml | 9 +- kind/job/load-data-job.yaml | 1 + kind/kustomization.yaml | 1 + kind/load-data-job/README.md | 2 +- kind/load-local-data-job/main.py | 40 +++---- .../netbox-load-local-data-job.yaml | 1 + kind/netbox-db.yaml | 1 + kind/netbox-db/kustomization.yaml | 1 + kind/netbox-db/netbox-db-patch.tmpl.yaml | 1 + kind/netbox-db/netbox-db.yaml | 1 + kind/nginx-unit-config.yaml | 3 +- kind/secret.yaml | 1 + .../chainsaw-test.yaml | 15 +-- .../netbox_v1_prefixclaim.yaml | 13 ++- .../chainsaw-test.yaml | 3 +- .../netbox_v1_prefixclaim-update.yaml | 1 + .../netbox_v1_prefixclaim.yaml | 1 + .../chainsaw-test.yaml | 3 +- .../netbox_v1_prefix_3-wrong-length.yaml | 1 + .../netbox_v1_prefixclaim_1.yaml | 1 + .../netbox_v1_prefixclaim_2.yaml | 1 + .../netbox_v1_prefixclaim_3.yaml | 1 + .../chainsaw-test.yaml | 5 +- .../netbox_v1_prefixclaim.yaml | 13 ++- .../chainsaw-test.yaml | 3 +- .../netbox_v1_prefixclaim_1.yaml | 9 +- .../netbox_v1_prefixclaim_2.yaml | 9 +- .../chainsaw-test.yaml | 3 +- .../netbox_v1_prefixclaim.yaml | 13 ++- .../chainsaw-test.yaml | 3 +- .../netbox_v1_prefixclaim_1.yaml | 1 + .../netbox_v1_prefixclaim_2.yaml | 1 + .../netbox_v1_prefixclaim_3.yaml | 1 + .../chainsaw-test.yaml | 3 +- .../netbox_v1_prefix_1.yaml | 1 + .../netbox_v1_prefixclaim_1.yaml | 1 + .../chainsaw-test.yaml | 3 +- .../netbox_v1_prefixclaim-update.yaml | 9 +- .../netbox_v1_prefixclaim.yaml | 9 +- tests/e2e/README.md | 2 +- .../chainsaw-test.yaml | 3 +- .../netbox_v1_ipaddressclaim-update.yaml | 1 + .../netbox_v1_ipaddressclaim.yaml | 1 + .../chainsaw-test.yaml | 5 +- .../netbox_v1_ipaddressclaim_1.yaml | 1 + .../netbox_v1_ipaddressclaim_2.yaml | 1 + .../netbox_v1_ipaddressclaim_3.yaml | 1 + .../chainsaw-test.yaml | 7 +- .../netbox_v1_ipaddressclaim_1.yaml | 1 + .../netbox_v1_ipaddressclaim_2.yaml | 1 + .../chainsaw-test.yaml | 5 +- .../netbox_v1_ipaddress_1.yaml | 1 + .../netbox_v1_ipaddressclaim_1.yaml | 1 + .../chainsaw-test.yaml | 3 +- .../netbox_v1_ipaddressclaim-update.yaml | 1 + .../netbox_v1_ipaddressclaim.yaml | 1 + .../chainsaw-test.yaml | 5 +- .../netbox_v1_ipaddressclaim_1.yaml | 1 + .../netbox_v1_ipaddressclaim_2.yaml | 1 + .../netbox_v1_ipaddressclaim_3.yaml | 1 + .../chainsaw-test.yaml | 7 +- .../netbox_v1_ipaddressclaim_1.yaml | 1 + .../netbox_v1_ipaddressclaim_2.yaml | 1 + .../chainsaw-test.yaml | 3 +- .../netbox_v1_iprangeclaim-update.yaml | 1 + .../netbox_v1_iprangeclaim.yaml | 1 + .../chainsaw-test.yaml | 3 +- .../netbox_v1_iprangeclaim.yaml | 1 + .../chainsaw-test.yaml | 3 +- .../netbox_v1_iprangeclaim.yaml | 1 + .../chainsaw-test.yaml | 3 +- .../netbox_v1_iprangeclaim.yaml | 1 + .../chainsaw-test.yaml | 3 +- .../netbox_v1_iprangeclaim.yaml | 1 + .../chainsaw-test.yaml | 3 +- .../netbox_v1_iprangeclaim.yaml | 1 + .../chainsaw-test.yaml | 3 +- .../netbox_v1_iprangeclaim.yaml | 1 + .../chainsaw-test.yaml | 5 +- .../netbox_v1_iprangeclaim_1.yaml | 1 + .../netbox_v1_iprangeclaim_2.yaml | 1 + .../netbox_v1_iprangeclaim_3.yaml | 1 + .../chainsaw-test.yaml | 7 +- .../netbox_v1_iprangeclaim_1.yaml | 1 + .../netbox_v1_iprangeclaim_2.yaml | 1 + .../chainsaw-test.yaml | 3 +- .../netbox_v1_iprange_1.yaml | 1 + .../netbox_v1_iprangeclaim_1.yaml | 1 + .../chainsaw-test.yaml | 3 +- .../netbox_v1_iprangeclaim-update.yaml | 1 + .../netbox_v1_iprangeclaim.yaml | 1 + .../chainsaw-test.yaml | 5 +- .../netbox_v1_iprangeclaim_1.yaml | 1 + .../netbox_v1_iprangeclaim_2.yaml | 1 + .../netbox_v1_iprangeclaim_3.yaml | 1 + .../chainsaw-test.yaml | 7 +- .../netbox_v1_iprangeclaim_1.yaml | 1 + .../netbox_v1_iprangeclaim_2.yaml | 1 + tests/e2e/kind-config.yaml | 1 + tools/.golangci.yaml | 1 + 156 files changed, 451 insertions(+), 325 deletions(-) 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..f191cd94 100644 --- a/.github/workflows/build-image.yaml +++ b/.github/workflows/build-image.yaml @@ -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..2183ad25 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. # @@ -13,9 +14,9 @@ name: "CodeQL Advanced" on: 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..61fbff9e 100644 --- a/.github/workflows/e2e-tests.yaml +++ b/.github/workflows/e2e-tests.yaml @@ -1,3 +1,4 @@ +--- # Modified from https://github.com/prometheus-operator/prometheus-operator/blob/main/.github/workflows/e2e-feature-gated.yaml name: e2e-tests permissions: @@ -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..6249568a 100644 --- a/.github/workflows/govuln.yaml +++ b/.github/workflows/govuln.yaml @@ -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..455e11a8 100644 --- a/.github/workflows/integration-test.yaml +++ b/.github/workflows/integration-test.yaml @@ -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 5fa64f19..77e198c1 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -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,7 +61,7 @@ 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: @@ -69,6 +69,6 @@ jobs: yamllint: runs-on: ubuntu-latest steps: - - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 + - 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..2f5581b6 100644 --- a/.github/workflows/unit-test.yaml +++ b/.github/workflows/unit-test.yaml @@ -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/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/default/kustomization.yaml b/config/default/kustomization.yaml index d8b33ff1..9a20b56a 100644 --- a/config/default/kustomization.yaml +++ b/config/default/kustomization.yaml @@ -1,3 +1,4 @@ +--- # Adds namespace to all resources. namespace: netbox-operator-system @@ -15,18 +16,18 @@ namePrefix: netbox-operator- # someName: someValue resources: -- ../crd -- ../rbac -- ../manager -# [WEBHOOK] To enable webhook, uncomment all the sections with [WEBHOOK] prefix including the one in -# crd/kustomization.yaml -#- ../webhook -# [CERTMANAGER] To enable cert-manager, uncomment all sections with 'CERTMANAGER'. 'WEBHOOK' components are required. -#- ../certmanager -# [PROMETHEUS] To enable prometheus monitor, uncomment all sections with 'PROMETHEUS'. -#- ../prometheus -# [METRICS] Expose the controller manager metrics service. -- metrics_service.yaml + - ../crd + - ../rbac + - ../manager + # [WEBHOOK] To enable webhook, uncomment all the sections with [WEBHOOK] prefix including the one in + # crd/kustomization.yaml + #- ../webhook + # [CERTMANAGER] To enable cert-manager, uncomment all sections with 'CERTMANAGER'. 'WEBHOOK' components are required. + #- ../certmanager + # [PROMETHEUS] To enable prometheus monitor, uncomment all sections with 'PROMETHEUS'. + #- ../prometheus + # [METRICS] Expose the controller manager metrics service. + - metrics_service.yaml # [NETWORK POLICY] Protect the /metrics endpoint and Webhook Server with NetworkPolicy. # Only Pod(s) running a namespace labeled with 'metrics: enabled' will be able to gather the metrics. # Only CR(s) which requires webhooks and are applied on namespaces labeled with 'webhooks: enabled' will @@ -35,11 +36,11 @@ resources: # Uncomment the patches line if you enable Metrics, and/or are using webhooks and cert-manager patches: -# [METRICS] The following patch will enable the metrics endpoint using HTTPS and the port :8443. -# More info: https://book.kubebuilder.io/reference/metrics -- path: manager_metrics_patch.yaml - target: - kind: Deployment + # [METRICS] The following patch will enable the metrics endpoint using HTTPS and the port :8443. + # More info: https://book.kubebuilder.io/reference/metrics + - path: manager_metrics_patch.yaml + target: + kind: Deployment # [WEBHOOK] To enable webhook, uncomment all the sections with [WEBHOOK] prefix including the one in # crd/kustomization.yaml diff --git a/config/default/manager_metrics_patch.yaml b/config/default/manager_metrics_patch.yaml index 2aaef653..8d2c94e4 100644 --- a/config/default/manager_metrics_patch.yaml +++ b/config/default/manager_metrics_patch.yaml @@ -1,3 +1,4 @@ +--- # This patch adds the args to allow exposing the metrics endpoint using HTTPS - op: add path: /spec/template/spec/containers/0/args/0 diff --git a/config/default/metrics_service.yaml b/config/default/metrics_service.yaml index 694b9dfd..5fb6cca7 100644 --- a/config/default/metrics_service.yaml +++ b/config/default/metrics_service.yaml @@ -1,3 +1,4 @@ +--- apiVersion: v1 kind: Service metadata: @@ -9,10 +10,10 @@ metadata: namespace: system spec: ports: - - name: https - port: 8443 - protocol: TCP - targetPort: 8443 + - name: https + port: 8443 + protocol: TCP + targetPort: 8443 selector: control-plane: controller-manager app.kubernetes.io/part-of: netbox-operator diff --git a/config/manager/kustomization.yaml b/config/manager/kustomization.yaml index 5c5f0b84..59639615 100644 --- a/config/manager/kustomization.yaml +++ b/config/manager/kustomization.yaml @@ -1,2 +1,3 @@ +--- resources: -- manager.yaml + - manager.yaml diff --git a/config/manager/manager.yaml b/config/manager/manager.yaml index aeaf352b..f0f31d02 100644 --- a/config/manager/manager.yaml +++ b/config/manager/manager.yaml @@ -55,42 +55,42 @@ spec: # seccompProfile: # type: RuntimeDefault containers: - - command: - - /manager - args: - - --leader-elect - image: controller:latest - name: manager - env: - - name: POD_NAMESPACE - valueFrom: - fieldRef: - fieldPath: metadata.namespace - securityContext: - allowPrivilegeEscalation: false - capabilities: - drop: - - "ALL" - livenessProbe: - httpGet: - path: /healthz - port: 8081 - initialDelaySeconds: 15 - periodSeconds: 20 - readinessProbe: - httpGet: - path: /readyz - port: 8081 - initialDelaySeconds: 5 - periodSeconds: 10 - # TODO(user): Configure the resources accordingly based on the project requirements. - # More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ - resources: - limits: - cpu: 500m - memory: 128Mi - requests: - cpu: 10m - memory: 64Mi + - command: + - /manager + args: + - --leader-elect + image: controller:latest + name: manager + env: + - name: POD_NAMESPACE + valueFrom: + fieldRef: + fieldPath: metadata.namespace + securityContext: + allowPrivilegeEscalation: false + capabilities: + drop: + - "ALL" + livenessProbe: + httpGet: + path: /healthz + port: 8081 + initialDelaySeconds: 15 + periodSeconds: 20 + readinessProbe: + httpGet: + path: /readyz + port: 8081 + initialDelaySeconds: 5 + periodSeconds: 10 + # TODO(user): Configure the resources accordingly based on the project requirements. + # More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ + resources: + limits: + cpu: 500m + memory: 128Mi + requests: + cpu: 10m + memory: 64Mi serviceAccountName: controller-manager terminationGracePeriodSeconds: 10 diff --git a/config/network-policy/allow-metrics-traffic.yaml b/config/network-policy/allow-metrics-traffic.yaml index 2aaa7fdd..9e7e0996 100644 --- a/config/network-policy/allow-metrics-traffic.yaml +++ b/config/network-policy/allow-metrics-traffic.yaml @@ -1,3 +1,4 @@ +--- # This NetworkPolicy allows ingress traffic # with Pods running on namespaces labeled with 'metrics: enabled'. Only Pods on those # namespaces are able to gathering data from the metrics endpoint. @@ -18,9 +19,9 @@ spec: ingress: # This allows ingress traffic from any namespace with the label metrics: enabled - from: - - namespaceSelector: - matchLabels: - metrics: enabled # Only from namespaces with this label + - namespaceSelector: + matchLabels: + metrics: enabled # Only from namespaces with this label ports: - port: 8443 protocol: TCP diff --git a/config/network-policy/kustomization.yaml b/config/network-policy/kustomization.yaml index ec0fb5e5..b9c733ff 100644 --- a/config/network-policy/kustomization.yaml +++ b/config/network-policy/kustomization.yaml @@ -1,2 +1,3 @@ +--- resources: -- allow-metrics-traffic.yaml + - allow-metrics-traffic.yaml diff --git a/config/prometheus/kustomization.yaml b/config/prometheus/kustomization.yaml index ed137168..c4aaaee0 100644 --- a/config/prometheus/kustomization.yaml +++ b/config/prometheus/kustomization.yaml @@ -1,2 +1,3 @@ +--- resources: -- monitor.yaml + - monitor.yaml diff --git a/config/prometheus/monitor.yaml b/config/prometheus/monitor.yaml index fe512d22..37080eb7 100644 --- a/config/prometheus/monitor.yaml +++ b/config/prometheus/monitor.yaml @@ -1,3 +1,4 @@ +--- # Prometheus Monitor Service (Metrics) apiVersion: monitoring.coreos.com/v1 kind: ServiceMonitor @@ -12,7 +13,7 @@ metadata: spec: endpoints: - path: /metrics - port: https # Ensure this is the name of the port that exposes HTTPS metrics + port: https # Ensure this is the name of the port that exposes HTTPS metrics scheme: https bearerTokenFile: /var/run/secrets/kubernetes.io/serviceaccount/token tlsConfig: diff --git a/config/samples/kustomization.yaml b/config/samples/kustomization.yaml index d3f1a9ee..fbdf947e 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..5017975c 100644 --- a/kind/netbox-db.yaml +++ b/kind/netbox-db.yaml @@ -1,3 +1,4 @@ +--- apiVersion: "acid.zalan.do/v1" kind: postgresql metadata: 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..af374224 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: 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..a4d2b198 100644 --- a/kind/secret.yaml +++ b/kind/secret.yaml @@ -1,3 +1,4 @@ +--- apiVersion: v1 kind: Secret metadata: 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 From 3a8ca925fceebebd4fd049a32d84fef7c81a2694 Mon Sep 17 00:00:00 2001 From: Joel Studler Date: Fri, 18 Jul 2025 10:01:30 +0200 Subject: [PATCH 10/13] Revert "pre-commit run --files $(find .)" This reverts commit cb49732df5e1e8e38e4626fc449f2a4e2d9beb53. --- .github/dependabot.yaml | 1 - .github/workflows/build-image.yaml | 2 +- .github/workflows/codeql.yml | 103 +++++++++--------- .github/workflows/e2e-tests.yaml | 61 +++++------ .github/workflows/govuln.yaml | 6 +- .github/workflows/integration-test.yaml | 6 +- .github/workflows/lint.yaml | 10 +- .github/workflows/unit-test.yaml | 6 +- CONTRIBUTING.md | 4 +- ParentPrefixSelectorGuide.md | 2 +- config/default/kustomization.yaml | 35 +++--- config/default/manager_metrics_patch.yaml | 1 - config/default/metrics_service.yaml | 9 +- config/manager/kustomization.yaml | 3 +- config/manager/manager.yaml | 74 ++++++------- .../network-policy/allow-metrics-traffic.yaml | 7 +- config/network-policy/kustomization.yaml | 3 +- config/prometheus/kustomization.yaml | 3 +- config/prometheus/monitor.yaml | 3 +- config/samples/kustomization.yaml | 19 ++-- config/samples/netbox_v1_ipaddress.yaml | 1 - config/samples/netbox_v1_ipaddressclaim.yaml | 1 - config/samples/netbox_v1_iprange.yaml | 1 - config/samples/netbox_v1_iprangeclaim.yaml | 1 - config/samples/netbox_v1_prefix.yaml | 1 - config/samples/netbox_v1_prefixclaim.yaml | 1 - ...x_v1_prefixclaim_parentprefixselector.yaml | 1 - ...ixclaim_parentprefixselector_bool_int.yaml | 1 - .../dynamic_prefixclaim-large-font.drawio.svg | 2 +- .../prefixclaim-dynamic.drawio.svg | 2 +- .../prefixclaim-dynamic.yaml | 1 - .../prefixclaim-simple.drawio.svg | 2 +- .../prefixclaim-simple.yaml | 1 - .../simple_prefixclaim-large-font.drawio.svg | 2 +- ...ancer-ip-pool-netbox-large-font.drawio.svg | 2 +- .../load-balancer-ip-pool-netbox.yaml | 1 - .../metallb-ipaddresspool-netbox.drawio.svg | 2 +- .../sample-deployment.yaml | 14 +-- .../zurich-pool.yaml | 3 +- .../restoration-large-font.drawio.svg | 2 +- .../restoration.drawio.svg | 2 +- .../exhaustion-1-starting-point.drawio.svg | 2 +- .../exhaustion-2-prefix-exhausted.drawio.svg | 2 +- .../exhaustion-3-after-fix.drawio.svg | 2 +- docs/examples/example5-multicluster/README.md | 2 +- .../example5-multicluster/cluster-cfg.yaml | 17 ++- .../demo-setup.drawio.svg | 2 +- .../example5-multicluster/kustomization.yaml | 1 - .../example5-multicluster/london-pools.yaml | 1 - .../multicluster.drawio.svg | 2 +- .../example5-multicluster/netbox-svc.yaml | 13 +-- .../example5-multicluster/zurich-pools.yaml | 1 - ...perator-high-level-architecture.drawio.svg | 2 +- docs/operational-manual.md | 6 +- ...-with-netbox-running-in-cluster.drawio.svg | 2 +- hack/boilerplate.go.txt | 2 +- kind/job/kustomization.yaml | 9 +- kind/job/load-data-job.yaml | 1 - kind/kustomization.yaml | 1 - kind/load-data-job/README.md | 2 +- kind/load-local-data-job/main.py | 40 +++---- .../netbox-load-local-data-job.yaml | 1 - kind/netbox-db.yaml | 1 - kind/netbox-db/kustomization.yaml | 1 - kind/netbox-db/netbox-db-patch.tmpl.yaml | 1 - kind/netbox-db/netbox-db.yaml | 1 - kind/nginx-unit-config.yaml | 3 +- kind/secret.yaml | 1 - .../chainsaw-test.yaml | 15 ++- .../netbox_v1_prefixclaim.yaml | 13 +-- .../chainsaw-test.yaml | 3 +- .../netbox_v1_prefixclaim-update.yaml | 1 - .../netbox_v1_prefixclaim.yaml | 1 - .../chainsaw-test.yaml | 3 +- .../netbox_v1_prefix_3-wrong-length.yaml | 1 - .../netbox_v1_prefixclaim_1.yaml | 1 - .../netbox_v1_prefixclaim_2.yaml | 1 - .../netbox_v1_prefixclaim_3.yaml | 1 - .../chainsaw-test.yaml | 5 +- .../netbox_v1_prefixclaim.yaml | 13 +-- .../chainsaw-test.yaml | 3 +- .../netbox_v1_prefixclaim_1.yaml | 9 +- .../netbox_v1_prefixclaim_2.yaml | 9 +- .../chainsaw-test.yaml | 3 +- .../netbox_v1_prefixclaim.yaml | 13 +-- .../chainsaw-test.yaml | 3 +- .../netbox_v1_prefixclaim_1.yaml | 1 - .../netbox_v1_prefixclaim_2.yaml | 1 - .../netbox_v1_prefixclaim_3.yaml | 1 - .../chainsaw-test.yaml | 3 +- .../netbox_v1_prefix_1.yaml | 1 - .../netbox_v1_prefixclaim_1.yaml | 1 - .../chainsaw-test.yaml | 3 +- .../netbox_v1_prefixclaim-update.yaml | 9 +- .../netbox_v1_prefixclaim.yaml | 9 +- tests/e2e/README.md | 2 +- .../chainsaw-test.yaml | 3 +- .../netbox_v1_ipaddressclaim-update.yaml | 1 - .../netbox_v1_ipaddressclaim.yaml | 1 - .../chainsaw-test.yaml | 5 +- .../netbox_v1_ipaddressclaim_1.yaml | 1 - .../netbox_v1_ipaddressclaim_2.yaml | 1 - .../netbox_v1_ipaddressclaim_3.yaml | 1 - .../chainsaw-test.yaml | 7 +- .../netbox_v1_ipaddressclaim_1.yaml | 1 - .../netbox_v1_ipaddressclaim_2.yaml | 1 - .../chainsaw-test.yaml | 5 +- .../netbox_v1_ipaddress_1.yaml | 1 - .../netbox_v1_ipaddressclaim_1.yaml | 1 - .../chainsaw-test.yaml | 3 +- .../netbox_v1_ipaddressclaim-update.yaml | 1 - .../netbox_v1_ipaddressclaim.yaml | 1 - .../chainsaw-test.yaml | 5 +- .../netbox_v1_ipaddressclaim_1.yaml | 1 - .../netbox_v1_ipaddressclaim_2.yaml | 1 - .../netbox_v1_ipaddressclaim_3.yaml | 1 - .../chainsaw-test.yaml | 7 +- .../netbox_v1_ipaddressclaim_1.yaml | 1 - .../netbox_v1_ipaddressclaim_2.yaml | 1 - .../chainsaw-test.yaml | 3 +- .../netbox_v1_iprangeclaim-update.yaml | 1 - .../netbox_v1_iprangeclaim.yaml | 1 - .../chainsaw-test.yaml | 3 +- .../netbox_v1_iprangeclaim.yaml | 1 - .../chainsaw-test.yaml | 3 +- .../netbox_v1_iprangeclaim.yaml | 1 - .../chainsaw-test.yaml | 3 +- .../netbox_v1_iprangeclaim.yaml | 1 - .../chainsaw-test.yaml | 3 +- .../netbox_v1_iprangeclaim.yaml | 1 - .../chainsaw-test.yaml | 3 +- .../netbox_v1_iprangeclaim.yaml | 1 - .../chainsaw-test.yaml | 3 +- .../netbox_v1_iprangeclaim.yaml | 1 - .../chainsaw-test.yaml | 5 +- .../netbox_v1_iprangeclaim_1.yaml | 1 - .../netbox_v1_iprangeclaim_2.yaml | 1 - .../netbox_v1_iprangeclaim_3.yaml | 1 - .../chainsaw-test.yaml | 7 +- .../netbox_v1_iprangeclaim_1.yaml | 1 - .../netbox_v1_iprangeclaim_2.yaml | 1 - .../chainsaw-test.yaml | 3 +- .../netbox_v1_iprange_1.yaml | 1 - .../netbox_v1_iprangeclaim_1.yaml | 1 - .../chainsaw-test.yaml | 3 +- .../netbox_v1_iprangeclaim-update.yaml | 1 - .../netbox_v1_iprangeclaim.yaml | 1 - .../chainsaw-test.yaml | 5 +- .../netbox_v1_iprangeclaim_1.yaml | 1 - .../netbox_v1_iprangeclaim_2.yaml | 1 - .../netbox_v1_iprangeclaim_3.yaml | 1 - .../chainsaw-test.yaml | 7 +- .../netbox_v1_iprangeclaim_1.yaml | 1 - .../netbox_v1_iprangeclaim_2.yaml | 1 - tests/e2e/kind-config.yaml | 1 - tools/.golangci.yaml | 1 - 156 files changed, 325 insertions(+), 451 deletions(-) diff --git a/.github/dependabot.yaml b/.github/dependabot.yaml index ded66059..0d0d58b6 100644 --- a/.github/dependabot.yaml +++ b/.github/dependabot.yaml @@ -1,4 +1,3 @@ ---- version: 2 updates: - package-ecosystem: github-actions diff --git a/.github/workflows/build-image.yaml b/.github/workflows/build-image.yaml index f191cd94..8c1cf41b 100644 --- a/.github/workflows/build-image.yaml +++ b/.github/workflows/build-image.yaml @@ -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 2183ad25..d094006a 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -1,4 +1,3 @@ ---- # For most projects, this workflow file will not need changing; you simply need # to commit it to your repository. # @@ -14,9 +13,9 @@ name: "CodeQL Advanced" on: push: - branches: ["main"] + branches: [ "main" ] pull_request: - branches: ["main"] + branches: [ "main" ] schedule: - cron: '41 6 * * 1' @@ -44,58 +43,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 61fbff9e..bc409064 100644 --- a/.github/workflows/e2e-tests.yaml +++ b/.github/workflows/e2e-tests.yaml @@ -1,4 +1,3 @@ ---- # Modified from https://github.com/prometheus-operator/prometheus-operator/blob/main/.github/workflows/e2e-feature-gated.yaml name: e2e-tests permissions: @@ -21,41 +20,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 6249568a..d8b4a9d9 100644 --- a/.github/workflows/govuln.yaml +++ b/.github/workflows/govuln.yaml @@ -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 455e11a8..b4c7c0c1 100644 --- a/.github/workflows/integration-test.yaml +++ b/.github/workflows/integration-test.yaml @@ -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 77e198c1..5fa64f19 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -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,7 +61,7 @@ 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: @@ -69,6 +69,6 @@ jobs: yamllint: runs-on: ubuntu-latest steps: - - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 + - 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 2f5581b6..3ea95705 100644 --- a/.github/workflows/unit-test.yaml +++ b/.github/workflows/unit-test.yaml @@ -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/CONTRIBUTING.md b/CONTRIBUTING.md index 426d7177..0c7fdc22 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 47af0674..3cfd4c45 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/default/kustomization.yaml b/config/default/kustomization.yaml index 9a20b56a..d8b33ff1 100644 --- a/config/default/kustomization.yaml +++ b/config/default/kustomization.yaml @@ -1,4 +1,3 @@ ---- # Adds namespace to all resources. namespace: netbox-operator-system @@ -16,18 +15,18 @@ namePrefix: netbox-operator- # someName: someValue resources: - - ../crd - - ../rbac - - ../manager - # [WEBHOOK] To enable webhook, uncomment all the sections with [WEBHOOK] prefix including the one in - # crd/kustomization.yaml - #- ../webhook - # [CERTMANAGER] To enable cert-manager, uncomment all sections with 'CERTMANAGER'. 'WEBHOOK' components are required. - #- ../certmanager - # [PROMETHEUS] To enable prometheus monitor, uncomment all sections with 'PROMETHEUS'. - #- ../prometheus - # [METRICS] Expose the controller manager metrics service. - - metrics_service.yaml +- ../crd +- ../rbac +- ../manager +# [WEBHOOK] To enable webhook, uncomment all the sections with [WEBHOOK] prefix including the one in +# crd/kustomization.yaml +#- ../webhook +# [CERTMANAGER] To enable cert-manager, uncomment all sections with 'CERTMANAGER'. 'WEBHOOK' components are required. +#- ../certmanager +# [PROMETHEUS] To enable prometheus monitor, uncomment all sections with 'PROMETHEUS'. +#- ../prometheus +# [METRICS] Expose the controller manager metrics service. +- metrics_service.yaml # [NETWORK POLICY] Protect the /metrics endpoint and Webhook Server with NetworkPolicy. # Only Pod(s) running a namespace labeled with 'metrics: enabled' will be able to gather the metrics. # Only CR(s) which requires webhooks and are applied on namespaces labeled with 'webhooks: enabled' will @@ -36,11 +35,11 @@ resources: # Uncomment the patches line if you enable Metrics, and/or are using webhooks and cert-manager patches: - # [METRICS] The following patch will enable the metrics endpoint using HTTPS and the port :8443. - # More info: https://book.kubebuilder.io/reference/metrics - - path: manager_metrics_patch.yaml - target: - kind: Deployment +# [METRICS] The following patch will enable the metrics endpoint using HTTPS and the port :8443. +# More info: https://book.kubebuilder.io/reference/metrics +- path: manager_metrics_patch.yaml + target: + kind: Deployment # [WEBHOOK] To enable webhook, uncomment all the sections with [WEBHOOK] prefix including the one in # crd/kustomization.yaml diff --git a/config/default/manager_metrics_patch.yaml b/config/default/manager_metrics_patch.yaml index 8d2c94e4..2aaef653 100644 --- a/config/default/manager_metrics_patch.yaml +++ b/config/default/manager_metrics_patch.yaml @@ -1,4 +1,3 @@ ---- # This patch adds the args to allow exposing the metrics endpoint using HTTPS - op: add path: /spec/template/spec/containers/0/args/0 diff --git a/config/default/metrics_service.yaml b/config/default/metrics_service.yaml index 5fb6cca7..694b9dfd 100644 --- a/config/default/metrics_service.yaml +++ b/config/default/metrics_service.yaml @@ -1,4 +1,3 @@ ---- apiVersion: v1 kind: Service metadata: @@ -10,10 +9,10 @@ metadata: namespace: system spec: ports: - - name: https - port: 8443 - protocol: TCP - targetPort: 8443 + - name: https + port: 8443 + protocol: TCP + targetPort: 8443 selector: control-plane: controller-manager app.kubernetes.io/part-of: netbox-operator diff --git a/config/manager/kustomization.yaml b/config/manager/kustomization.yaml index 59639615..5c5f0b84 100644 --- a/config/manager/kustomization.yaml +++ b/config/manager/kustomization.yaml @@ -1,3 +1,2 @@ ---- resources: - - manager.yaml +- manager.yaml diff --git a/config/manager/manager.yaml b/config/manager/manager.yaml index f0f31d02..aeaf352b 100644 --- a/config/manager/manager.yaml +++ b/config/manager/manager.yaml @@ -55,42 +55,42 @@ spec: # seccompProfile: # type: RuntimeDefault containers: - - command: - - /manager - args: - - --leader-elect - image: controller:latest - name: manager - env: - - name: POD_NAMESPACE - valueFrom: - fieldRef: - fieldPath: metadata.namespace - securityContext: - allowPrivilegeEscalation: false - capabilities: - drop: - - "ALL" - livenessProbe: - httpGet: - path: /healthz - port: 8081 - initialDelaySeconds: 15 - periodSeconds: 20 - readinessProbe: - httpGet: - path: /readyz - port: 8081 - initialDelaySeconds: 5 - periodSeconds: 10 - # TODO(user): Configure the resources accordingly based on the project requirements. - # More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ - resources: - limits: - cpu: 500m - memory: 128Mi - requests: - cpu: 10m - memory: 64Mi + - command: + - /manager + args: + - --leader-elect + image: controller:latest + name: manager + env: + - name: POD_NAMESPACE + valueFrom: + fieldRef: + fieldPath: metadata.namespace + securityContext: + allowPrivilegeEscalation: false + capabilities: + drop: + - "ALL" + livenessProbe: + httpGet: + path: /healthz + port: 8081 + initialDelaySeconds: 15 + periodSeconds: 20 + readinessProbe: + httpGet: + path: /readyz + port: 8081 + initialDelaySeconds: 5 + periodSeconds: 10 + # TODO(user): Configure the resources accordingly based on the project requirements. + # More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ + resources: + limits: + cpu: 500m + memory: 128Mi + requests: + cpu: 10m + memory: 64Mi serviceAccountName: controller-manager terminationGracePeriodSeconds: 10 diff --git a/config/network-policy/allow-metrics-traffic.yaml b/config/network-policy/allow-metrics-traffic.yaml index 9e7e0996..2aaa7fdd 100644 --- a/config/network-policy/allow-metrics-traffic.yaml +++ b/config/network-policy/allow-metrics-traffic.yaml @@ -1,4 +1,3 @@ ---- # This NetworkPolicy allows ingress traffic # with Pods running on namespaces labeled with 'metrics: enabled'. Only Pods on those # namespaces are able to gathering data from the metrics endpoint. @@ -19,9 +18,9 @@ spec: ingress: # This allows ingress traffic from any namespace with the label metrics: enabled - from: - - namespaceSelector: - matchLabels: - metrics: enabled # Only from namespaces with this label + - namespaceSelector: + matchLabels: + metrics: enabled # Only from namespaces with this label ports: - port: 8443 protocol: TCP diff --git a/config/network-policy/kustomization.yaml b/config/network-policy/kustomization.yaml index b9c733ff..ec0fb5e5 100644 --- a/config/network-policy/kustomization.yaml +++ b/config/network-policy/kustomization.yaml @@ -1,3 +1,2 @@ ---- resources: - - allow-metrics-traffic.yaml +- allow-metrics-traffic.yaml diff --git a/config/prometheus/kustomization.yaml b/config/prometheus/kustomization.yaml index c4aaaee0..ed137168 100644 --- a/config/prometheus/kustomization.yaml +++ b/config/prometheus/kustomization.yaml @@ -1,3 +1,2 @@ ---- resources: - - monitor.yaml +- monitor.yaml diff --git a/config/prometheus/monitor.yaml b/config/prometheus/monitor.yaml index 37080eb7..fe512d22 100644 --- a/config/prometheus/monitor.yaml +++ b/config/prometheus/monitor.yaml @@ -1,4 +1,3 @@ ---- # Prometheus Monitor Service (Metrics) apiVersion: monitoring.coreos.com/v1 kind: ServiceMonitor @@ -13,7 +12,7 @@ metadata: spec: endpoints: - path: /metrics - port: https # Ensure this is the name of the port that exposes HTTPS metrics + port: https # Ensure this is the name of the port that exposes HTTPS metrics scheme: https bearerTokenFile: /var/run/secrets/kubernetes.io/serviceaccount/token tlsConfig: diff --git a/config/samples/kustomization.yaml b/config/samples/kustomization.yaml index fbdf947e..d3f1a9ee 100644 --- a/config/samples/kustomization.yaml +++ b/config/samples/kustomization.yaml @@ -1,12 +1,11 @@ ---- ## 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 4937daee..3a5935c1 100644 --- a/config/samples/netbox_v1_ipaddress.yaml +++ b/config/samples/netbox_v1_ipaddress.yaml @@ -1,4 +1,3 @@ ---- apiVersion: netbox.dev/v1 kind: IpAddress metadata: diff --git a/config/samples/netbox_v1_ipaddressclaim.yaml b/config/samples/netbox_v1_ipaddressclaim.yaml index 8bfdee0b..b067c558 100644 --- a/config/samples/netbox_v1_ipaddressclaim.yaml +++ b/config/samples/netbox_v1_ipaddressclaim.yaml @@ -1,4 +1,3 @@ ---- apiVersion: netbox.dev/v1 kind: IpAddressClaim metadata: diff --git a/config/samples/netbox_v1_iprange.yaml b/config/samples/netbox_v1_iprange.yaml index 93ace170..27142d60 100644 --- a/config/samples/netbox_v1_iprange.yaml +++ b/config/samples/netbox_v1_iprange.yaml @@ -1,4 +1,3 @@ ---- apiVersion: netbox.dev/v1 kind: IpRange metadata: diff --git a/config/samples/netbox_v1_iprangeclaim.yaml b/config/samples/netbox_v1_iprangeclaim.yaml index c6e477bd..75ee44ab 100644 --- a/config/samples/netbox_v1_iprangeclaim.yaml +++ b/config/samples/netbox_v1_iprangeclaim.yaml @@ -1,4 +1,3 @@ ---- apiVersion: netbox.dev/v1 kind: IpRangeClaim metadata: diff --git a/config/samples/netbox_v1_prefix.yaml b/config/samples/netbox_v1_prefix.yaml index 2deecff5..be6e3fa6 100644 --- a/config/samples/netbox_v1_prefix.yaml +++ b/config/samples/netbox_v1_prefix.yaml @@ -1,4 +1,3 @@ ---- apiVersion: netbox.dev/v1 kind: Prefix metadata: diff --git a/config/samples/netbox_v1_prefixclaim.yaml b/config/samples/netbox_v1_prefixclaim.yaml index e8534426..b23712a4 100644 --- a/config/samples/netbox_v1_prefixclaim.yaml +++ b/config/samples/netbox_v1_prefixclaim.yaml @@ -1,4 +1,3 @@ ---- 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 34016354..8a9daea5 100644 --- a/config/samples/netbox_v1_prefixclaim_parentprefixselector.yaml +++ b/config/samples/netbox_v1_prefixclaim_parentprefixselector.yaml @@ -1,4 +1,3 @@ ---- 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 7ee833ca..2f954ab8 100644 --- a/config/samples/netbox_v1_prefixclaim_parentprefixselector_bool_int.yaml +++ b/config/samples/netbox_v1_prefixclaim_parentprefixselector_bool_int.yaml @@ -1,4 +1,3 @@ ---- 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 eb94ee83..56e2c3d2 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 2d652741..00f401cd 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 79d35cea..4a6c0d13 100644 --- a/docs/examples/example1-getting-started/prefixclaim-dynamic.yaml +++ b/docs/examples/example1-getting-started/prefixclaim-dynamic.yaml @@ -1,4 +1,3 @@ ---- 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 455918e5..9e28233a 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 8c1aa937..483a0c3d 100644 --- a/docs/examples/example1-getting-started/prefixclaim-simple.yaml +++ b/docs/examples/example1-getting-started/prefixclaim-simple.yaml @@ -1,4 +1,3 @@ ---- 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 d70174bd..d89c2dbe 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 25f10cb9..ad17f4dc 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
+
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 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 56590d7b..bc84c6ac 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,4 +1,3 @@ ---- 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 3cbc2e0d..5d8997e1 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 1395af8c..51ea0e2e 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 01fbe3a3..0178ee87 100644 --- a/docs/examples/example2-load-balancer-ip/zurich-pool.yaml +++ b/docs/examples/example2-load-balancer-ip/zurich-pool.yaml @@ -1,11 +1,10 @@ ---- 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 848088cd..2e5face7 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
+
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 diff --git a/docs/examples/example3-restoration/restoration.drawio.svg b/docs/examples/example3-restoration/restoration.drawio.svg index 61ed40e5..4bcdca6c 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
+
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 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 3a994c6b..94e9ea20 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
+
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 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 07ba10d9..a2377d28 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
+
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 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 f2ae7e00..13dd249e 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
+
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 diff --git a/docs/examples/example5-multicluster/README.md b/docs/examples/example5-multicluster/README.md index 79459482..7ea53c64 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) +![Example 2](multicluster.drawio.svg) \ No newline at end of file diff --git a/docs/examples/example5-multicluster/cluster-cfg.yaml b/docs/examples/example5-multicluster/cluster-cfg.yaml index e48448f6..0dafb9be 100644 --- a/docs/examples/example5-multicluster/cluster-cfg.yaml +++ b/docs/examples/example5-multicluster/cluster-cfg.yaml @@ -1,15 +1,14 @@ ---- 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 0e2fe831..0c4fe028 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 ca878af6..fe91fc3c 100644 --- a/docs/examples/example5-multicluster/kustomization.yaml +++ b/docs/examples/example5-multicluster/kustomization.yaml @@ -1,4 +1,3 @@ ---- resources: - ../../../kind diff --git a/docs/examples/example5-multicluster/london-pools.yaml b/docs/examples/example5-multicluster/london-pools.yaml index 5bfe7df8..36c9f0db 100644 --- a/docs/examples/example5-multicluster/london-pools.yaml +++ b/docs/examples/example5-multicluster/london-pools.yaml @@ -1,4 +1,3 @@ ---- 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 49d36c3e..a32f6afc 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 ead9f0c8..ddba7fc5 100644 --- a/docs/examples/example5-multicluster/netbox-svc.yaml +++ b/docs/examples/example5-multicluster/netbox-svc.yaml @@ -1,4 +1,3 @@ ---- apiVersion: v1 kind: Service @@ -13,15 +12,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 + sessionAffinity: None \ No newline at end of file diff --git a/docs/examples/example5-multicluster/zurich-pools.yaml b/docs/examples/example5-multicluster/zurich-pools.yaml index e7ceaa37..4d270d8c 100644 --- a/docs/examples/example5-multicluster/zurich-pools.yaml +++ b/docs/examples/example5-multicluster/zurich-pools.yaml @@ -1,4 +1,3 @@ ---- 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 21ea4cb1..62fcb76f 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
+
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 diff --git a/docs/operational-manual.md b/docs/operational-manual.md index 71aa9570..b9162e5b 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 400037a6..5118715c 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
+
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 diff --git a/hack/boilerplate.go.txt b/hack/boilerplate.go.txt index 62667577..6d20a430 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 716fe282..68fcafcd 100644 --- a/kind/job/kustomization.yaml +++ b/kind/job/kustomization.yaml @@ -1,11 +1,10 @@ ---- 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 920da458..5d9bbea9 100644 --- a/kind/job/load-data-job.yaml +++ b/kind/job/load-data-job.yaml @@ -1,4 +1,3 @@ ---- apiVersion: batch/v1 kind: Job metadata: diff --git a/kind/kustomization.yaml b/kind/kustomization.yaml index 35598579..05ecc175 100644 --- a/kind/kustomization.yaml +++ b/kind/kustomization.yaml @@ -1,4 +1,3 @@ ---- resources: - ../config/default - secret.yaml diff --git a/kind/load-data-job/README.md b/kind/load-data-job/README.md index 6cabeb7b..40582c82 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 96de148e..bbac5497 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 5a4e1279..b9ce511b 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,4 +1,3 @@ ---- apiVersion: batch/v1 kind: Job metadata: diff --git a/kind/netbox-db.yaml b/kind/netbox-db.yaml index 5017975c..ead11131 100644 --- a/kind/netbox-db.yaml +++ b/kind/netbox-db.yaml @@ -1,4 +1,3 @@ ---- apiVersion: "acid.zalan.do/v1" kind: postgresql metadata: diff --git a/kind/netbox-db/kustomization.yaml b/kind/netbox-db/kustomization.yaml index f3edbc14..80910a9e 100644 --- a/kind/netbox-db/kustomization.yaml +++ b/kind/netbox-db/kustomization.yaml @@ -1,4 +1,3 @@ ---- 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 a8d947a7..de2cc4ea 100644 --- a/kind/netbox-db/netbox-db-patch.tmpl.yaml +++ b/kind/netbox-db/netbox-db-patch.tmpl.yaml @@ -1,4 +1,3 @@ ---- # 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 af374224..69575f19 100644 --- a/kind/netbox-db/netbox-db.yaml +++ b/kind/netbox-db/netbox-db.yaml @@ -1,4 +1,3 @@ ---- apiVersion: "acid.zalan.do/v1" kind: postgresql metadata: diff --git a/kind/nginx-unit-config.yaml b/kind/nginx-unit-config.yaml index a2b9eb6a..b393ea40 100644 --- a/kind/nginx-unit-config.yaml +++ b/kind/nginx-unit-config.yaml @@ -1,10 +1,9 @@ ---- 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 a4d2b198..afa03d1c 100644 --- a/kind/secret.yaml +++ b/kind/secret.yaml @@ -1,4 +1,3 @@ ---- apiVersion: v1 kind: Secret metadata: 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 ab378f4b..8ddabfdd 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,4 +1,3 @@ ---- apiVersion: chainsaw.kyverno.io/v1alpha1 kind: Test metadata: @@ -20,16 +19,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" @@ -53,5 +52,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 2030e88e..68b5600d 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,4 +1,3 @@ ---- apiVersion: netbox.dev/v1 kind: PrefixClaim metadata: @@ -7,16 +6,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 9ac1a559..a8c05074 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,4 +1,3 @@ ---- apiVersion: chainsaw.kyverno.io/v1alpha1 kind: Test metadata: @@ -83,5 +82,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 bb12a2d4..d51789f8 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,4 +1,3 @@ ---- 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 8eada6a0..8fe50871 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,4 +1,3 @@ ---- 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 c95ebc45..ece8693f 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,4 +1,3 @@ ---- apiVersion: chainsaw.kyverno.io/v1alpha1 kind: Test metadata: @@ -224,6 +223,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 cef188f5..47f0c164 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,4 +1,3 @@ ---- 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 9e5ca433..0c052d67 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,4 +1,3 @@ ---- 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 b4040243..f2d8fa17 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,4 +1,3 @@ ---- 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 a34af89f..6324fa8b 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,4 +1,3 @@ ---- 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 980e0fc2..c45d8aa3 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,4 +1,3 @@ ---- apiVersion: chainsaw.kyverno.io/v1alpha1 kind: Test metadata: @@ -22,7 +21,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" @@ -62,5 +61,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 7f1ce8f4..8df2e862 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,4 +1,3 @@ ---- apiVersion: netbox.dev/v1 kind: PrefixClaim metadata: @@ -7,16 +6,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 48876438..03b61eb9 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,4 +1,3 @@ ---- apiVersion: chainsaw.kyverno.io/v1alpha1 kind: Test metadata: @@ -168,6 +167,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 2758a2b9..f25d8a25 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,4 +1,3 @@ ---- apiVersion: netbox.dev/v1 kind: PrefixClaim metadata: @@ -13,10 +12,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 92a9fa6b..d8239404 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,4 +1,3 @@ ---- apiVersion: netbox.dev/v1 kind: PrefixClaim metadata: @@ -13,10 +12,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 2ddd15cf..0c554c03 100644 --- a/tests/e2e/Prefix/IPv4/prefixclaim-ipv4-parentprefixselector/chainsaw-test.yaml +++ b/tests/e2e/Prefix/IPv4/prefixclaim-ipv4-parentprefixselector/chainsaw-test.yaml @@ -1,4 +1,3 @@ ---- apiVersion: chainsaw.kyverno.io/v1alpha1 kind: Test metadata: @@ -75,5 +74,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 68fa69e2..9511071f 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,4 +1,3 @@ ---- apiVersion: netbox.dev/v1 kind: PrefixClaim metadata: @@ -7,16 +6,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 9c832dcf..d687f60f 100644 --- a/tests/e2e/Prefix/IPv4/prefixclaim-ipv4-prefixexhausted/chainsaw-test.yaml +++ b/tests/e2e/Prefix/IPv4/prefixclaim-ipv4-prefixexhausted/chainsaw-test.yaml @@ -1,4 +1,3 @@ ---- apiVersion: chainsaw.kyverno.io/v1alpha1 kind: Test metadata: @@ -102,7 +101,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 a25f44c3..e28b0cc4 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,4 +1,3 @@ ---- 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 1039c86b..394b1b1e 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,4 +1,3 @@ ---- 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 7ac517eb..ffa12595 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,4 +1,3 @@ ---- 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 dc260c9b..9936b25b 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,4 +1,3 @@ ---- apiVersion: chainsaw.kyverno.io/v1alpha1 kind: Test metadata: @@ -75,5 +74,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 5fc88662..28384041 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,4 +1,3 @@ ---- 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 d3c1a32d..62f80a05 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,4 +1,3 @@ ---- 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 f2914c1f..d4037f53 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,4 +1,3 @@ ---- apiVersion: chainsaw.kyverno.io/v1alpha1 kind: Test metadata: @@ -112,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=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 6c2db0ff..44520e0a 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,4 +1,3 @@ ---- apiVersion: netbox.dev/v1 kind: PrefixClaim metadata: @@ -7,14 +6,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 830a8238..05aa6e0e 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,4 +1,3 @@ ---- apiVersion: netbox.dev/v1 kind: PrefixClaim metadata: @@ -7,14 +6,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 87aee5bd..1459beb5 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 60595009..3225d16d 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,4 +1,3 @@ ---- apiVersion: chainsaw.kyverno.io/v1alpha1 kind: Test metadata: @@ -111,5 +110,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 e7f830dc..526268fd 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,4 +1,3 @@ ---- 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 3d04bf32..0dcc0175 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,4 +1,3 @@ ---- 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 580ce860..68fe6b91 100644 --- a/tests/e2e/ipaddress/ipv4/ipaddressclaim-ipv4-prefixexhausted/chainsaw-test.yaml +++ b/tests/e2e/ipaddress/ipv4/ipaddressclaim-ipv4-prefixexhausted/chainsaw-test.yaml @@ -1,4 +1,3 @@ ---- apiVersion: chainsaw.kyverno.io/v1alpha1 kind: Test metadata: @@ -118,7 +117,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: @@ -137,7 +136,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 ba5f8575..74bb7fe9 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,4 +1,3 @@ ---- 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 320b643b..446ec4ba 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,4 +1,3 @@ ---- 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 e2bef0c7..bdf702c2 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,4 +1,3 @@ ---- 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 59b33bdf..a202d558 100644 --- a/tests/e2e/ipaddress/ipv4/ipaddressclaim-ipv4-restore/chainsaw-test.yaml +++ b/tests/e2e/ipaddress/ipv4/ipaddressclaim-ipv4-restore/chainsaw-test.yaml @@ -1,4 +1,3 @@ ---- apiVersion: chainsaw.kyverno.io/v1alpha1 kind: Test metadata: @@ -46,7 +45,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 @@ -147,7 +146,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 @@ -180,6 +179,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 2b412e94..c6aa4db3 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,4 +1,3 @@ ---- 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 aedbbaa4..51e79035 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,4 +1,3 @@ ---- 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 82da008e..2ed28394 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,4 +1,3 @@ ---- apiVersion: chainsaw.kyverno.io/v1alpha1 kind: Test metadata: @@ -62,7 +61,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 @@ -73,5 +72,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 3ed7d6c0..0c50e4be 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,4 +1,3 @@ ---- 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 dc8ad3f7..52231de8 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,4 +1,3 @@ ---- 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 4bee494c..0e45758c 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,4 +1,3 @@ ---- apiVersion: chainsaw.kyverno.io/v1alpha1 kind: Test metadata: @@ -111,5 +110,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 cc9fc2bb..b992e7d9 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,4 +1,3 @@ ---- 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 1c0ca241..86aa6562 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,4 +1,3 @@ ---- 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 581708bd..8874d64c 100644 --- a/tests/e2e/ipaddress/ipv6/ipaddressclaim-ipv6-prefixexhausted/chainsaw-test.yaml +++ b/tests/e2e/ipaddress/ipv6/ipaddressclaim-ipv6-prefixexhausted/chainsaw-test.yaml @@ -1,4 +1,3 @@ ---- apiVersion: chainsaw.kyverno.io/v1alpha1 kind: Test metadata: @@ -118,7 +117,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: @@ -137,7 +136,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 f0b5f555..8f6c850f 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,4 +1,3 @@ ---- 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 5ee6677f..149cb176 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,4 +1,3 @@ ---- 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 02619580..c0e44c97 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,4 +1,3 @@ ---- 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 1126c35e..29af423f 100644 --- a/tests/e2e/ipaddress/ipv6/ipaddressclaim-ipv6-restore/chainsaw-test.yaml +++ b/tests/e2e/ipaddress/ipv6/ipaddressclaim-ipv6-restore/chainsaw-test.yaml @@ -1,4 +1,3 @@ ---- apiVersion: chainsaw.kyverno.io/v1alpha1 kind: Test metadata: @@ -46,7 +45,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 @@ -147,7 +146,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 @@ -180,6 +179,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 a50a52ec..0b5c0046 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,4 +1,3 @@ ---- 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 9b7f4b9b..e82b5a34 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,4 +1,3 @@ ---- 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 71b7bb85..167fc90e 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,4 +1,3 @@ ---- apiVersion: chainsaw.kyverno.io/v1alpha1 kind: Test metadata: @@ -121,7 +120,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 dfe3d77f..028a21b2 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,4 +1,3 @@ ---- 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 b2e06eb5..1a6d3fba 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,4 +1,3 @@ ---- 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 20e19641..67ec8af4 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,4 +1,3 @@ ---- apiVersion: chainsaw.kyverno.io/v1alpha1 kind: Test metadata: @@ -18,7 +17,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 9994b7d1..fa1aa7c2 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,4 +1,3 @@ ---- 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 449dc58d..d2aa444d 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,4 +1,3 @@ ---- apiVersion: chainsaw.kyverno.io/v1alpha1 kind: Test metadata: @@ -64,7 +63,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 9997d8f7..6a5c953c 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,4 +1,3 @@ ---- 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 296f0b51..499aaeec 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,4 +1,3 @@ ---- apiVersion: chainsaw.kyverno.io/v1alpha1 kind: Test metadata: @@ -64,7 +63,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 6eb17aa1..fc668892 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,4 +1,3 @@ ---- 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 5f04d2e9..24ad0f99 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,4 +1,3 @@ ---- apiVersion: chainsaw.kyverno.io/v1alpha1 kind: Test metadata: @@ -38,7 +37,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 dd494e1e..e7095fbf 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,4 +1,3 @@ ---- 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 6f3221ae..b7099608 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,4 +1,3 @@ ---- apiVersion: chainsaw.kyverno.io/v1alpha1 kind: Test metadata: @@ -18,7 +17,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 afb78a0c..5bcdcb9c 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,4 +1,3 @@ ---- 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 5e43055b..56de3a02 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,4 +1,3 @@ ---- apiVersion: chainsaw.kyverno.io/v1alpha1 kind: Test metadata: @@ -44,7 +43,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 9329b407..c5331315 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,4 +1,3 @@ ---- 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 2c7ae2bc..594ff8b0 100644 --- a/tests/e2e/iprange/ipv4/iprangeclaim-ipv4-prefixexhausted/chainsaw-test.yaml +++ b/tests/e2e/iprange/ipv4/iprangeclaim-ipv4-prefixexhausted/chainsaw-test.yaml @@ -1,4 +1,3 @@ ---- apiVersion: chainsaw.kyverno.io/v1alpha1 kind: Test metadata: @@ -127,7 +126,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 +145,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 54625b7f..e1f8cd07 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,4 +1,3 @@ ---- 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 4665d00a..3eee358a 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,4 +1,3 @@ ---- 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 58a4df99..7d6d3542 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,4 +1,3 @@ ---- 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 962bd36a..9542419f 100644 --- a/tests/e2e/iprange/ipv4/iprangeclaim-ipv4-restore/chainsaw-test.yaml +++ b/tests/e2e/iprange/ipv4/iprangeclaim-ipv4-restore/chainsaw-test.yaml @@ -1,4 +1,3 @@ ---- apiVersion: chainsaw.kyverno.io/v1alpha1 kind: Test metadata: @@ -51,7 +50,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 @@ -163,7 +162,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 @@ -197,7 +196,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 34babb25..c150e949 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,4 +1,3 @@ ---- 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 5045aadc..1f062c7e 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,4 +1,3 @@ ---- 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 434d50ef..3ce686b7 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,4 +1,3 @@ ---- apiVersion: chainsaw.kyverno.io/v1alpha1 kind: Test metadata: @@ -79,5 +78,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 1ca43e3e..b5a92911 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,4 +1,3 @@ ---- 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 0ad1ca46..af8b6fba 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,4 +1,3 @@ ---- 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 8657b581..108b7076 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,4 +1,3 @@ ---- apiVersion: chainsaw.kyverno.io/v1alpha1 kind: Test metadata: @@ -121,7 +120,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 402d1e2b..24aa7f31 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,4 +1,3 @@ ---- 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 a9b0431c..369e771b 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,4 +1,3 @@ ---- 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 69c2fff0..82dc3a01 100644 --- a/tests/e2e/iprange/ipv6/iprangeclaim-ipv6-prefixexhausted/chainsaw-test.yaml +++ b/tests/e2e/iprange/ipv6/iprangeclaim-ipv6-prefixexhausted/chainsaw-test.yaml @@ -1,4 +1,3 @@ ---- apiVersion: chainsaw.kyverno.io/v1alpha1 kind: Test metadata: @@ -128,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: @@ -147,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/ipv6/iprangeclaim-ipv6-prefixexhausted/netbox_v1_iprangeclaim_1.yaml b/tests/e2e/iprange/ipv6/iprangeclaim-ipv6-prefixexhausted/netbox_v1_iprangeclaim_1.yaml index 8a8320e6..af3bf2f7 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,4 +1,3 @@ ---- 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 ed30ba38..19bd62ea 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,4 +1,3 @@ ---- 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 555a2c4c..c734ff84 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,4 +1,3 @@ ---- 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 04bf0bc7..aa3c07c3 100644 --- a/tests/e2e/iprange/ipv6/iprangeclaim-ipv6-restore/chainsaw-test.yaml +++ b/tests/e2e/iprange/ipv6/iprangeclaim-ipv6-restore/chainsaw-test.yaml @@ -1,4 +1,3 @@ ---- apiVersion: chainsaw.kyverno.io/v1alpha1 kind: Test metadata: @@ -51,7 +50,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 @@ -163,7 +162,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 @@ -197,7 +196,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 7c9b8c3a..6175ca54 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,4 +1,3 @@ ---- 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 fe04b36e..7a378141 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,4 +1,3 @@ ---- apiVersion: netbox.dev/v1 kind: IpRangeClaim metadata: diff --git a/tests/e2e/kind-config.yaml b/tests/e2e/kind-config.yaml index e199b514..eb2557ce 100644 --- a/tests/e2e/kind-config.yaml +++ b/tests/e2e/kind-config.yaml @@ -1,4 +1,3 @@ ---- # 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 8542f39b..dfcd2b6e 100644 --- a/tools/.golangci.yaml +++ b/tools/.golangci.yaml @@ -1,4 +1,3 @@ ---- version: "2" linters: default: none From 5bf04351123aa18bbb8f46a52e1dbd5324e5b177 Mon Sep 17 00:00:00 2001 From: Joel Studler Date: Fri, 18 Jul 2025 10:03:29 +0200 Subject: [PATCH 11/13] Exclude config/* except for samples to not interfere with kubebuilder --- .pre-commit-config.yaml | 4 ++-- .yamllint | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 2bc1fde1..1a3fa183 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -19,12 +19,12 @@ repos: hooks: - id: yamlfmt language: system - exclude: ^config/crd|^config/rbac + 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 + 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: diff --git a/.yamllint b/.yamllint index b446d566..5c3e8c04 100644 --- a/.yamllint +++ b/.yamllint @@ -7,6 +7,10 @@ yaml-files: ignore: | config/crd/* config/rbac/* + config/manager/* + config/default/* + config/prometheus/* + config/network-policy/* rules: # anchors: enable braces: enable From 7d75cd71be609d34e43dd3d16a5d2716e08c21ce Mon Sep 17 00:00:00 2001 From: Joel Studler Date: Fri, 18 Jul 2025 10:09:08 +0200 Subject: [PATCH 12/13] pre-commit run --files $(find .) --- .github/dependabot.yaml | 1 + .github/workflows/build-image.yaml | 2 +- .github/workflows/codeql.yml | 103 +++++++++--------- .github/workflows/e2e-tests.yaml | 61 ++++++----- .github/workflows/govuln.yaml | 6 +- .github/workflows/integration-test.yaml | 6 +- .github/workflows/lint.yaml | 10 +- .github/workflows/unit-test.yaml | 6 +- CONTRIBUTING.md | 4 +- ParentPrefixSelectorGuide.md | 2 +- config/samples/kustomization.yaml | 19 ++-- config/samples/netbox_v1_ipaddress.yaml | 1 + config/samples/netbox_v1_ipaddressclaim.yaml | 1 + config/samples/netbox_v1_iprange.yaml | 1 + config/samples/netbox_v1_iprangeclaim.yaml | 1 + config/samples/netbox_v1_prefix.yaml | 1 + config/samples/netbox_v1_prefixclaim.yaml | 1 + ...x_v1_prefixclaim_parentprefixselector.yaml | 1 + ...ixclaim_parentprefixselector_bool_int.yaml | 1 + .../dynamic_prefixclaim-large-font.drawio.svg | 2 +- .../prefixclaim-dynamic.drawio.svg | 2 +- .../prefixclaim-dynamic.yaml | 1 + .../prefixclaim-simple.drawio.svg | 2 +- .../prefixclaim-simple.yaml | 1 + .../simple_prefixclaim-large-font.drawio.svg | 2 +- ...ancer-ip-pool-netbox-large-font.drawio.svg | 2 +- .../load-balancer-ip-pool-netbox.yaml | 1 + .../metallb-ipaddresspool-netbox.drawio.svg | 2 +- .../sample-deployment.yaml | 14 +-- .../zurich-pool.yaml | 3 +- .../restoration-large-font.drawio.svg | 2 +- .../restoration.drawio.svg | 2 +- .../exhaustion-1-starting-point.drawio.svg | 2 +- .../exhaustion-2-prefix-exhausted.drawio.svg | 2 +- .../exhaustion-3-after-fix.drawio.svg | 2 +- docs/examples/example5-multicluster/README.md | 2 +- .../example5-multicluster/cluster-cfg.yaml | 17 +-- .../demo-setup.drawio.svg | 2 +- .../example5-multicluster/kustomization.yaml | 1 + .../example5-multicluster/london-pools.yaml | 1 + .../multicluster.drawio.svg | 2 +- .../example5-multicluster/netbox-svc.yaml | 13 ++- .../example5-multicluster/zurich-pools.yaml | 1 + ...perator-high-level-architecture.drawio.svg | 2 +- docs/operational-manual.md | 6 +- ...-with-netbox-running-in-cluster.drawio.svg | 2 +- hack/boilerplate.go.txt | 2 +- kind/job/kustomization.yaml | 9 +- kind/job/load-data-job.yaml | 1 + kind/kustomization.yaml | 1 + kind/load-data-job/README.md | 2 +- kind/load-local-data-job/main.py | 40 +++---- .../netbox-load-local-data-job.yaml | 1 + kind/netbox-db.yaml | 1 + kind/netbox-db/kustomization.yaml | 1 + kind/netbox-db/netbox-db-patch.tmpl.yaml | 1 + kind/netbox-db/netbox-db.yaml | 1 + kind/nginx-unit-config.yaml | 3 +- kind/secret.yaml | 1 + .../chainsaw-test.yaml | 15 +-- .../netbox_v1_prefixclaim.yaml | 13 ++- .../chainsaw-test.yaml | 3 +- .../netbox_v1_prefixclaim-update.yaml | 1 + .../netbox_v1_prefixclaim.yaml | 1 + .../chainsaw-test.yaml | 3 +- .../netbox_v1_prefix_3-wrong-length.yaml | 1 + .../netbox_v1_prefixclaim_1.yaml | 1 + .../netbox_v1_prefixclaim_2.yaml | 1 + .../netbox_v1_prefixclaim_3.yaml | 1 + .../chainsaw-test.yaml | 5 +- .../netbox_v1_prefixclaim.yaml | 13 ++- .../chainsaw-test.yaml | 3 +- .../netbox_v1_prefixclaim_1.yaml | 9 +- .../netbox_v1_prefixclaim_2.yaml | 9 +- .../chainsaw-test.yaml | 3 +- .../netbox_v1_prefixclaim.yaml | 13 ++- .../chainsaw-test.yaml | 3 +- .../netbox_v1_prefixclaim_1.yaml | 1 + .../netbox_v1_prefixclaim_2.yaml | 1 + .../netbox_v1_prefixclaim_3.yaml | 1 + .../chainsaw-test.yaml | 3 +- .../netbox_v1_prefix_1.yaml | 1 + .../netbox_v1_prefixclaim_1.yaml | 1 + .../chainsaw-test.yaml | 3 +- .../netbox_v1_prefixclaim-update.yaml | 9 +- .../netbox_v1_prefixclaim.yaml | 9 +- tests/e2e/README.md | 2 +- .../chainsaw-test.yaml | 3 +- .../netbox_v1_ipaddressclaim-update.yaml | 1 + .../netbox_v1_ipaddressclaim.yaml | 1 + .../chainsaw-test.yaml | 5 +- .../netbox_v1_ipaddressclaim_1.yaml | 1 + .../netbox_v1_ipaddressclaim_2.yaml | 1 + .../netbox_v1_ipaddressclaim_3.yaml | 1 + .../chainsaw-test.yaml | 7 +- .../netbox_v1_ipaddressclaim_1.yaml | 1 + .../netbox_v1_ipaddressclaim_2.yaml | 1 + .../chainsaw-test.yaml | 5 +- .../netbox_v1_ipaddress_1.yaml | 1 + .../netbox_v1_ipaddressclaim_1.yaml | 1 + .../chainsaw-test.yaml | 3 +- .../netbox_v1_ipaddressclaim-update.yaml | 1 + .../netbox_v1_ipaddressclaim.yaml | 1 + .../chainsaw-test.yaml | 5 +- .../netbox_v1_ipaddressclaim_1.yaml | 1 + .../netbox_v1_ipaddressclaim_2.yaml | 1 + .../netbox_v1_ipaddressclaim_3.yaml | 1 + .../chainsaw-test.yaml | 7 +- .../netbox_v1_ipaddressclaim_1.yaml | 1 + .../netbox_v1_ipaddressclaim_2.yaml | 1 + .../chainsaw-test.yaml | 3 +- .../netbox_v1_iprangeclaim-update.yaml | 1 + .../netbox_v1_iprangeclaim.yaml | 1 + .../chainsaw-test.yaml | 3 +- .../netbox_v1_iprangeclaim.yaml | 1 + .../chainsaw-test.yaml | 3 +- .../netbox_v1_iprangeclaim.yaml | 1 + .../chainsaw-test.yaml | 3 +- .../netbox_v1_iprangeclaim.yaml | 1 + .../chainsaw-test.yaml | 3 +- .../netbox_v1_iprangeclaim.yaml | 1 + .../chainsaw-test.yaml | 3 +- .../netbox_v1_iprangeclaim.yaml | 1 + .../chainsaw-test.yaml | 3 +- .../netbox_v1_iprangeclaim.yaml | 1 + .../chainsaw-test.yaml | 5 +- .../netbox_v1_iprangeclaim_1.yaml | 1 + .../netbox_v1_iprangeclaim_2.yaml | 1 + .../netbox_v1_iprangeclaim_3.yaml | 1 + .../chainsaw-test.yaml | 7 +- .../netbox_v1_iprangeclaim_1.yaml | 1 + .../netbox_v1_iprangeclaim_2.yaml | 1 + .../chainsaw-test.yaml | 3 +- .../netbox_v1_iprange_1.yaml | 1 + .../netbox_v1_iprangeclaim_1.yaml | 1 + .../chainsaw-test.yaml | 3 +- .../netbox_v1_iprangeclaim-update.yaml | 1 + .../netbox_v1_iprangeclaim.yaml | 1 + .../chainsaw-test.yaml | 5 +- .../netbox_v1_iprangeclaim_1.yaml | 1 + .../netbox_v1_iprangeclaim_2.yaml | 1 + .../netbox_v1_iprangeclaim_3.yaml | 1 + .../chainsaw-test.yaml | 7 +- .../netbox_v1_iprangeclaim_1.yaml | 1 + .../netbox_v1_iprangeclaim_2.yaml | 1 + tests/e2e/kind-config.yaml | 1 + tools/.golangci.yaml | 1 + 147 files changed, 378 insertions(+), 260 deletions(-) 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..f191cd94 100644 --- a/.github/workflows/build-image.yaml +++ b/.github/workflows/build-image.yaml @@ -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..2183ad25 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. # @@ -13,9 +14,9 @@ name: "CodeQL Advanced" on: 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..61fbff9e 100644 --- a/.github/workflows/e2e-tests.yaml +++ b/.github/workflows/e2e-tests.yaml @@ -1,3 +1,4 @@ +--- # Modified from https://github.com/prometheus-operator/prometheus-operator/blob/main/.github/workflows/e2e-feature-gated.yaml name: e2e-tests permissions: @@ -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..6249568a 100644 --- a/.github/workflows/govuln.yaml +++ b/.github/workflows/govuln.yaml @@ -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..455e11a8 100644 --- a/.github/workflows/integration-test.yaml +++ b/.github/workflows/integration-test.yaml @@ -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 5fa64f19..77e198c1 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -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,7 +61,7 @@ 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: @@ -69,6 +69,6 @@ jobs: yamllint: runs-on: ubuntu-latest steps: - - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 + - 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..2f5581b6 100644 --- a/.github/workflows/unit-test.yaml +++ b/.github/workflows/unit-test.yaml @@ -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/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..fbdf947e 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..5017975c 100644 --- a/kind/netbox-db.yaml +++ b/kind/netbox-db.yaml @@ -1,3 +1,4 @@ +--- apiVersion: "acid.zalan.do/v1" kind: postgresql metadata: 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..af374224 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: 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..a4d2b198 100644 --- a/kind/secret.yaml +++ b/kind/secret.yaml @@ -1,3 +1,4 @@ +--- apiVersion: v1 kind: Secret metadata: 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 From 328dcb647c19e8118e728e79da5bbe22cc10397b Mon Sep 17 00:00:00 2001 From: Joel Studler Date: Fri, 18 Jul 2025 10:11:25 +0200 Subject: [PATCH 13/13] Manual fixes of truthy values and comments --- .github/workflows/build-image.yaml | 2 +- .github/workflows/codeql.yml | 2 +- .github/workflows/e2e-tests.yaml | 2 +- .github/workflows/govuln.yaml | 2 +- .github/workflows/integration-test.yaml | 2 +- .github/workflows/lint.yaml | 2 +- .github/workflows/unit-test.yaml | 2 +- config/samples/kustomization.yaml | 2 +- kind/netbox-db.yaml | 2 +- kind/netbox-db/netbox-db.yaml | 2 +- kind/secret.yaml | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/build-image.yaml b/.github/workflows/build-image.yaml index f191cd94..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 diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 2183ad25..9d34c263 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -12,7 +12,7 @@ # name: "CodeQL Advanced" -on: +on: # yamllint disable-line rule:truthy push: branches: ["main"] pull_request: diff --git a/.github/workflows/e2e-tests.yaml b/.github/workflows/e2e-tests.yaml index 61fbff9e..ee0c2518 100644 --- a/.github/workflows/e2e-tests.yaml +++ b/.github/workflows/e2e-tests.yaml @@ -3,7 +3,7 @@ name: e2e-tests permissions: contents: read -on: +on: # yamllint disable-line rule:truthy push: branches: - main diff --git a/.github/workflows/govuln.yaml b/.github/workflows/govuln.yaml index 6249568a..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 diff --git a/.github/workflows/integration-test.yaml b/.github/workflows/integration-test.yaml index 455e11a8..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 diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index 77e198c1..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 diff --git a/.github/workflows/unit-test.yaml b/.github/workflows/unit-test.yaml index 2f5581b6..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 diff --git a/config/samples/kustomization.yaml b/config/samples/kustomization.yaml index fbdf947e..674e3bc8 100644 --- a/config/samples/kustomization.yaml +++ b/config/samples/kustomization.yaml @@ -9,4 +9,4 @@ resources: - netbox_v1_prefixclaim_parentprefixselector.yaml - netbox_v1_iprangeclaim.yaml - netbox_v1_iprange.yaml - #+kubebuilder:scaffold:manifestskustomizesamples + # +kubebuilder:scaffold:manifestskustomizesamples diff --git a/kind/netbox-db.yaml b/kind/netbox-db.yaml index 5017975c..a28e54db 100644 --- a/kind/netbox-db.yaml +++ b/kind/netbox-db.yaml @@ -15,7 +15,7 @@ spec: - superuser - createdb - #databases: name->owner + # databases: name->owner databases: netbox: netbox postgresql: diff --git a/kind/netbox-db/netbox-db.yaml b/kind/netbox-db/netbox-db.yaml index af374224..3ec864d0 100644 --- a/kind/netbox-db/netbox-db.yaml +++ b/kind/netbox-db/netbox-db.yaml @@ -15,7 +15,7 @@ spec: - superuser - createdb - #databases: name->owner + # databases: name->owner databases: netbox: netbox postgresql: diff --git a/kind/secret.yaml b/kind/secret.yaml index a4d2b198..b3adf2f1 100644 --- a/kind/secret.yaml +++ b/kind/secret.yaml @@ -5,5 +5,5 @@ 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==