Code Monkey home page Code Monkey logo

ipam's Introduction

ipam's People

Contributors

dependabot[bot] avatar aiivashchenko avatar damyan avatar igogrek avatar charleenklang avatar landeleih avatar evgeniaorfeeva avatar gardener-robot avatar aobort avatar gchbg avatar charleen-klang avatar gehoern avatar afritzler avatar dmvolod avatar

Stargazers

Maxime SOURDIN avatar

Watchers

 avatar

ipam's Issues

Subnet validating webhook denies request if consumer object still exists but is being currently deleting

What happened:

  1. When user/controller tries to delete Subnet object which's Consumer field is not empty, validation webhook denies this request;
  2. switch-controller (part of metal-api operator) during Switch object reconciliation creates Subnet objects for each switch port. Also it sets finalizer on Switch object - finalizer function should delete spawned IPAM objects, like Subnets;
  3. As a result of two points above it is impossible to finalize Switch on deletion, due to subnets webhook denies request, since subnet's consumer (switch) is not deleted yet.

What you expected to happen:
Validating webhook should check not only whether the consumer object exists or not, but also its deletion timestamp, so if timestamp is not empty, then it should allow deletion.

Documentation - broken URLs in documentation found

What happened:
URL Links in https://github.com/onmetal/ipam/blob/main/docs/usage.md are broken:

The 'onmetal/ipam' repository doesn't contain the 'docs/config/samples/ipam_v1alpha1_ipv4_parent_cidr_subnet.yaml' path in 'main'.  

They are pointing to non existing location.

What you expected to happen:

  • URL in .md working
  • use /config/samples/ instead of docs/config/samples/

How to reproduce it (as minimally and precisely as possible):
Click on URL in such file.

Landscape update

What happened:

What you expected to happen:

How to reproduce it (as minimally and precisely as possible):

Anything else we need to know:

Environment:

IPAM controller panic on bulk subnets deletion

What happened:
On bulk subnets deletion ipam controller throws panic during subnet resource finalization

E1027 11:38:09.121592       1 runtime.go:78] Observed a panic: "invalid memory address or nil pointer dereference" (runtime error: invalid memory address or nil pointer dereference)
goroutine 288 [running]:
k8s.io/apimachinery/pkg/util/runtime.logPanic(0x1665080, 0x2399fd0)
        /go/pkg/mod/k8s.io/[email protected]/pkg/util/runtime/runtime.go:74 +0x95
k8s.io/apimachinery/pkg/util/runtime.HandleCrash(0x0, 0x0, 0x0)
        /go/pkg/mod/k8s.io/[email protected]/pkg/util/runtime/runtime.go:48 +0x89
panic(0x1665080, 0x2399fd0)
        /usr/local/go/src/runtime/panic.go:969 +0x1b9
github.com/onmetal/ipam/api/v1alpha1.(*CIDR).CanReserve(0x0, 0xc0001071e8, 0xc0001b2fc0)
        /workspace/api/v1alpha1/cidr_types.go:275 +0x29
github.com/onmetal/ipam/api/v1alpha1.(*Subnet).Release(0xc0001b2d80, 0xc0001071e8, 0xc000249380, 0xc000315c80)
        /workspace/api/v1alpha1/subnet_types.go:298 +0x57
github.com/onmetal/ipam/controllers.(*SubnetReconciler).finalizeSubnet(0xc0006dee40, 0x1a12720, 0xc000249380, 0x1a1b3e0, 0xc000237800, 0xc000315c80, 0x7, 0xc000279300, 0x17, 0xc0001b2900, ...)
        /workspace/controllers/subnet_controller.go:342 +0x1405
github.com/onmetal/ipam/controllers.(*SubnetReconciler).Reconcile(0xc0006dee40, 0x1a12720, 0xc000249380, 0xc000315c80, 0x7, 0xc000279300, 0x17, 0xc000249380, 0x40a1ff, 0xc000030000, ...)
        /workspace/controllers/subnet_controller.go:91 +0x2e5
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).reconcileHandler(0xc00043cb40, 0x1a12660, 0xc0006df780, 0x16bbc40, 0xc00024a920)
        /go/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:263 +0x317
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).processNextWorkItem(0xc00043cb40, 0x1a12660, 0xc0006df780, 0x0)
        /go/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:235 +0x205
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Start.func1.1(0x1a12660, 0xc0006df780)
        /go/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:198 +0x4a
k8s.io/apimachinery/pkg/util/wait.JitterUntilWithContext.func1()
        /go/pkg/mod/k8s.io/[email protected]/pkg/util/wait/wait.go:185 +0x37
k8s.io/apimachinery/pkg/util/wait.BackoffUntil.func1(0xc00016ff50)
        /go/pkg/mod/k8s.io/[email protected]/pkg/util/wait/wait.go:155 +0x5f
k8s.io/apimachinery/pkg/util/wait.BackoffUntil(0xc00040bf50, 0x19db000, 0xc000249260, 0xc0006df701, 0xc0004302a0)
        /go/pkg/mod/k8s.io/[email protected]/pkg/util/wait/wait.go:156 +0xad
k8s.io/apimachinery/pkg/util/wait.JitterUntil(0xc00016ff50, 0x3b9aca00, 0x0, 0x1, 0xc0004302a0)
        /go/pkg/mod/k8s.io/[email protected]/pkg/util/wait/wait.go:133 +0x98
k8s.io/apimachinery/pkg/util/wait.JitterUntilWithContext(0x1a12660, 0xc0006df780, 0xc000237760, 0x3b9aca00, 0x0, 0x1)
        /go/pkg/mod/k8s.io/[email protected]/pkg/util/wait/wait.go:185 +0xa6
k8s.io/apimachinery/pkg/util/wait.UntilWithContext(0x1a12660, 0xc0006df780, 0xc000237760, 0x3b9aca00)
        /go/pkg/mod/k8s.io/[email protected]/pkg/util/wait/wait.go:99 +0x57
created by sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Start.func1
        /go/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:195 +0x4e7
panic: runtime error: invalid memory address or nil pointer dereference [recovered]
        panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x1512109]

What you expected to happen:
Subnet resources deleted

How to reproduce it (as minimally and precisely as possible):

  1. deploy ipam operator built from main branch
  2. create several nested subnets, i.e.
apiVersion: ipam.onmetal.de/v1alpha1
kind: Network
metadata:
 name: underlay
 namespace: default
spec:
 description: sample
---
apiVersion: ipam.onmetal.de/v1alpha1
kind: Subnet
metadata:
 name: switch-ranges-v4
 namespace: default
spec:
 cidr: "100.64.0.0/16"
 networkName: underlay
 regions:
   - name: eu-west
     availabilityZones:
     - A
---
apiVersion: ipam.onmetal.de/v1alpha1
kind: Subnet
metadata:
 name: subnet-parent-001-v4
 namespace: default
spec:
 capacity: 512
 networkName: underlay
 parentSubnetName: switch-ranges-v4
 regions:
   - name: eu-west
     availabilityZones:
     - A
---
apiVersion: ipam.onmetal.de/v1alpha1
kind: Subnet
metadata:
 name: subnet-parent-002-v4
 namespace: default
spec:
 capacity: 512
 networkName: underlay
 parentSubnetName: switch-ranges-v4
 regions:
   - name: eu-west
     availabilityZones:
     - A
---
apiVersion: ipam.onmetal.de/v1alpha1
kind: Subnet
metadata:
 name: subnet-parent-003-v4
 namespace: default
spec:
 capacity: 512
 networkName: underlay
 parentSubnetName: switch-ranges-v4
 regions:
   - name: eu-west
     availabilityZones:
     - A
---
apiVersion: ipam.onmetal.de/v1alpha1
kind: Subnet
metadata:
 name: subnet-child-001-001-v4
 namespace: default
spec:
 capacity: 4
 networkName: underlay
 parentSubnetName: subnet-parent-001-v4
 regions:
   - name: eu-west
     availabilityZones:
     - A
---
apiVersion: ipam.onmetal.de/v1alpha1
kind: Subnet
metadata:
 name: subnet-child-001-002-v4
 namespace: default
spec:
 capacity: 4
 networkName: underlay
 parentSubnetName: subnet-parent-001-v4
 regions:
   - name: eu-west
     availabilityZones:
     - A
---
apiVersion: ipam.onmetal.de/v1alpha1
kind: Subnet
metadata:
 name: subnet-child-001-003-v4
 namespace: default
spec:
 capacity: 4
 networkName: underlay
 parentSubnetName: subnet-parent-001-v4
 regions:
   - name: eu-west
     availabilityZones:
     - A
---
apiVersion: ipam.onmetal.de/v1alpha1
kind: Subnet
metadata:
 name: subnet-child-002-001-v4
 namespace: default
spec:
 capacity: 4
 networkName: underlay
 parentSubnetName: subnet-parent-002-v4
 regions:
   - name: eu-west
     availabilityZones:
     - A
---
apiVersion: ipam.onmetal.de/v1alpha1
kind: Subnet
metadata:
 name: subnet-child-003-001-v4
 namespace: default
spec:
 capacity: 4
 networkName: underlay
 parentSubnetName: subnet-parent-003-v4
 regions:
   - name: eu-west
     availabilityZones:
     - A
---
  1. delete subnets k delete subnets.ipam.onmetal.de --all

Environment:

kube-user@minikube:~/ipam$ uname -a
Linux minikube 4.19.0-16-amd64 #1 SMP Debian 4.19.181-1 (2021-03-19) x86_64 GNU/Linux

kube-user@minikube:~/ipam$ minikube version
minikube version: v1.20.0
commit: c61663e942ec43b20e8e70839dcca52e44cd85ae

kube-user@minikube:~/ipam$ git log --format="%H" -n 1
8bd1d806158ebbd8681db50386f24187ab802966

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.