diff --git a/.github/workflows/bug-reproduction.yml b/.github/workflows/bug-reproduction.yml index 61148e357c7..8d049355d73 100644 --- a/.github/workflows/bug-reproduction.yml +++ b/.github/workflows/bug-reproduction.yml @@ -1,76 +1,10 @@ -# This file is automatically generated by gen_github_action.py on 2022-10-17 05:39:02.930097 +# This file is automatically generated by gen_github_action.py on 2022-12-30 05:14:21.038641 name: Bug Reproduction 'on': workflow_dispatch: null env: IMAGE_NAMESPACE: ghcr.io/sieve-project/action jobs: - cass-operator: - runs-on: self-hosted - env: - GOPATH: /home/runner/go - KUBECONFIG: /home/runner/.kube/config - steps: - - uses: actions/checkout@v2 - - name: Setup Git - run: 'git config --global user.name "sieve" - - git config --global user.email "sieve@sieve.com"' - - name: Setup Go environment - uses: actions/setup-go@v2.1.3 - with: - go-version: 1.15 - - name: Setup Python - uses: actions/setup-python@v2.2.2 - with: - python-version: 3.7 - - name: Setup GitHub Package Registry - run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u "${{ github.actor }}" --password-stdin - - name: Install Python Packages - run: pip install -r requirements.txt - - name: Install Kind - run: 'GO111MODULE="on" go get sigs.k8s.io/kind@v0.13.0 - - kind' - - name: Install Mage - run: 'go get -u github.com/magefile/mage - - mage -h' - - name: Install Helm - run: 'wget https://get.helm.sh/helm-v3.6.0-linux-amd64.tar.gz - - tar -zxvf helm-v3.6.0-linux-amd64.tar.gz - - sudo mv linux-amd64/helm /usr/local/bin/helm - - helm' - - name: Sieve CI config generate - run: 'echo "{\"workload_conditional_wait_timeout\": 1000}" > sieve_config.json - - cat sieve_config.json' - - name: Sieve Test - cass-operator intermediate-state-1 - run: python3 reproduce_bugs.py -c cass-operator -b intermediate-state-1 -r $IMAGE_NAMESPACE - - name: Sieve Test - cass-operator intermediate-state-2 - run: python3 reproduce_bugs.py -c cass-operator -b intermediate-state-2 -r $IMAGE_NAMESPACE - - name: Sieve Test - cass-operator stale-state-1 - run: python3 reproduce_bugs.py -c cass-operator -b stale-state-1 -r $IMAGE_NAMESPACE - - uses: actions/upload-artifact@v2 - if: always() - with: - name: sieve-cass-operator-log - path: log - - name: Remove cluster - if: always() - run: kind delete cluster - - uses: JamesIves/github-pages-deploy-action@4.1.5 - name: Persistent oracle data - with: - branch: oracle-data - folder: examples/cass-operator/oracle - target-folder: cass-operator/oracle - - name: Clean images - if: always() - run: docker image prune -a -f && docker builder prune -a -f && docker system df cassandra-operator: runs-on: self-hosted env: @@ -85,7 +19,7 @@ jobs: - name: Setup Go environment uses: actions/setup-go@v2.1.3 with: - go-version: 1.15 + go-version: 1.19 - name: Setup Python uses: actions/setup-python@v2.2.2 with: @@ -95,13 +29,9 @@ jobs: - name: Install Python Packages run: pip install -r requirements.txt - name: Install Kind - run: 'GO111MODULE="on" go get sigs.k8s.io/kind@v0.13.0 + run: 'GO111MODULE="on" go install sigs.k8s.io/kind@v0.13.0 kind' - - name: Install Mage - run: 'go get -u github.com/magefile/mage - - mage -h' - name: Install Helm run: 'wget https://get.helm.sh/helm-v3.6.0-linux-amd64.tar.gz @@ -151,7 +81,7 @@ jobs: - name: Setup Go environment uses: actions/setup-go@v2.1.3 with: - go-version: 1.15 + go-version: 1.19 - name: Setup Python uses: actions/setup-python@v2.2.2 with: @@ -161,13 +91,9 @@ jobs: - name: Install Python Packages run: pip install -r requirements.txt - name: Install Kind - run: 'GO111MODULE="on" go get sigs.k8s.io/kind@v0.13.0 + run: 'GO111MODULE="on" go install sigs.k8s.io/kind@v0.13.0 kind' - - name: Install Mage - run: 'go get -u github.com/magefile/mage - - mage -h' - name: Install Helm run: 'wget https://get.helm.sh/helm-v3.6.0-linux-amd64.tar.gz @@ -205,70 +131,6 @@ jobs: - name: Clean images if: always() run: docker image prune -a -f && docker builder prune -a -f && docker system df - elastic-operator: - runs-on: self-hosted - env: - GOPATH: /home/runner/go - KUBECONFIG: /home/runner/.kube/config - steps: - - uses: actions/checkout@v2 - - name: Setup Git - run: 'git config --global user.name "sieve" - - git config --global user.email "sieve@sieve.com"' - - name: Setup Go environment - uses: actions/setup-go@v2.1.3 - with: - go-version: 1.15 - - name: Setup Python - uses: actions/setup-python@v2.2.2 - with: - python-version: 3.7 - - name: Setup GitHub Package Registry - run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u "${{ github.actor }}" --password-stdin - - name: Install Python Packages - run: pip install -r requirements.txt - - name: Install Kind - run: 'GO111MODULE="on" go get sigs.k8s.io/kind@v0.13.0 - - kind' - - name: Install Mage - run: 'go get -u github.com/magefile/mage - - mage -h' - - name: Install Helm - run: 'wget https://get.helm.sh/helm-v3.6.0-linux-amd64.tar.gz - - tar -zxvf helm-v3.6.0-linux-amd64.tar.gz - - sudo mv linux-amd64/helm /usr/local/bin/helm - - helm' - - name: Sieve CI config generate - run: 'echo "{\"workload_conditional_wait_timeout\": 1000}" > sieve_config.json - - cat sieve_config.json' - - name: Sieve Test - elastic-operator stale-state-1 - run: python3 reproduce_bugs.py -c elastic-operator -b stale-state-1 -r $IMAGE_NAMESPACE - - name: Sieve Test - elastic-operator stale-state-2 - run: python3 reproduce_bugs.py -c elastic-operator -b stale-state-2 -r $IMAGE_NAMESPACE - - uses: actions/upload-artifact@v2 - if: always() - with: - name: sieve-elastic-operator-log - path: log - - name: Remove cluster - if: always() - run: kind delete cluster - - uses: JamesIves/github-pages-deploy-action@4.1.5 - name: Persistent oracle data - with: - branch: oracle-data - folder: examples/elastic-operator/oracle - target-folder: elastic-operator/oracle - - name: Clean images - if: always() - run: docker image prune -a -f && docker builder prune -a -f && docker system df mongodb-operator: runs-on: self-hosted env: @@ -283,7 +145,7 @@ jobs: - name: Setup Go environment uses: actions/setup-go@v2.1.3 with: - go-version: 1.15 + go-version: 1.19 - name: Setup Python uses: actions/setup-python@v2.2.2 with: @@ -293,13 +155,9 @@ jobs: - name: Install Python Packages run: pip install -r requirements.txt - name: Install Kind - run: 'GO111MODULE="on" go get sigs.k8s.io/kind@v0.13.0 + run: 'GO111MODULE="on" go install sigs.k8s.io/kind@v0.13.0 kind' - - name: Install Mage - run: 'go get -u github.com/magefile/mage - - mage -h' - name: Install Helm run: 'wget https://get.helm.sh/helm-v3.6.0-linux-amd64.tar.gz @@ -355,7 +213,7 @@ jobs: - name: Setup Go environment uses: actions/setup-go@v2.1.3 with: - go-version: 1.15 + go-version: 1.19 - name: Setup Python uses: actions/setup-python@v2.2.2 with: @@ -365,13 +223,9 @@ jobs: - name: Install Python Packages run: pip install -r requirements.txt - name: Install Kind - run: 'GO111MODULE="on" go get sigs.k8s.io/kind@v0.13.0 + run: 'GO111MODULE="on" go install sigs.k8s.io/kind@v0.13.0 kind' - - name: Install Mage - run: 'go get -u github.com/magefile/mage - - mage -h' - name: Install Helm run: 'wget https://get.helm.sh/helm-v3.6.0-linux-amd64.tar.gz @@ -419,7 +273,7 @@ jobs: - name: Setup Go environment uses: actions/setup-go@v2.1.3 with: - go-version: 1.15 + go-version: 1.19 - name: Setup Python uses: actions/setup-python@v2.2.2 with: @@ -429,13 +283,9 @@ jobs: - name: Install Python Packages run: pip install -r requirements.txt - name: Install Kind - run: 'GO111MODULE="on" go get sigs.k8s.io/kind@v0.13.0 + run: 'GO111MODULE="on" go install sigs.k8s.io/kind@v0.13.0 kind' - - name: Install Mage - run: 'go get -u github.com/magefile/mage - - mage -h' - name: Install Helm run: 'wget https://get.helm.sh/helm-v3.6.0-linux-amd64.tar.gz @@ -487,7 +337,7 @@ jobs: - name: Setup Go environment uses: actions/setup-go@v2.1.3 with: - go-version: 1.15 + go-version: 1.19 - name: Setup Python uses: actions/setup-python@v2.2.2 with: @@ -497,13 +347,9 @@ jobs: - name: Install Python Packages run: pip install -r requirements.txt - name: Install Kind - run: 'GO111MODULE="on" go get sigs.k8s.io/kind@v0.13.0 + run: 'GO111MODULE="on" go install sigs.k8s.io/kind@v0.13.0 kind' - - name: Install Mage - run: 'go get -u github.com/magefile/mage - - mage -h' - name: Install Helm run: 'wget https://get.helm.sh/helm-v3.6.0-linux-amd64.tar.gz @@ -561,7 +407,7 @@ jobs: - name: Setup Go environment uses: actions/setup-go@v2.1.3 with: - go-version: 1.15 + go-version: 1.19 - name: Setup Python uses: actions/setup-python@v2.2.2 with: @@ -571,13 +417,9 @@ jobs: - name: Install Python Packages run: pip install -r requirements.txt - name: Install Kind - run: 'GO111MODULE="on" go get sigs.k8s.io/kind@v0.13.0 + run: 'GO111MODULE="on" go install sigs.k8s.io/kind@v0.13.0 kind' - - name: Install Mage - run: 'go get -u github.com/magefile/mage - - mage -h' - name: Install Helm run: 'wget https://get.helm.sh/helm-v3.6.0-linux-amd64.tar.gz @@ -627,7 +469,7 @@ jobs: - name: Setup Go environment uses: actions/setup-go@v2.1.3 with: - go-version: 1.15 + go-version: 1.19 - name: Setup Python uses: actions/setup-python@v2.2.2 with: @@ -637,13 +479,9 @@ jobs: - name: Install Python Packages run: pip install -r requirements.txt - name: Install Kind - run: 'GO111MODULE="on" go get sigs.k8s.io/kind@v0.13.0 + run: 'GO111MODULE="on" go install sigs.k8s.io/kind@v0.13.0 kind' - - name: Install Mage - run: 'go get -u github.com/magefile/mage - - mage -h' - name: Install Helm run: 'wget https://get.helm.sh/helm-v3.6.0-linux-amd64.tar.gz diff --git a/.github/workflows/example-controller-image-build.yml b/.github/workflows/example-controller-image-build.yml index 1d19e2a5437..fcb3360d047 100644 --- a/.github/workflows/example-controller-image-build.yml +++ b/.github/workflows/example-controller-image-build.yml @@ -1,62 +1,10 @@ -# This file is automatically generated by gen_github_action.py on 2022-10-17 05:39:02.821086 +# This file is automatically generated by gen_github_action.py on 2022-12-30 05:14:20.983825 name: Example Controller Image Build 'on': workflow_dispatch: null env: IMAGE_NAMESPACE: ghcr.io/sieve-project/action jobs: - cass-operator: - runs-on: ubuntu-latest - env: - GOPATH: /home/runner/go - KUBECONFIG: /home/runner/.kube/config - steps: - - uses: actions/checkout@v2 - - name: Setup Git - run: 'git config --global user.name "sieve" - - git config --global user.email "sieve@sieve.com"' - - name: Setup Go environment - uses: actions/setup-go@v2.1.3 - with: - go-version: 1.15 - - name: Setup Python - uses: actions/setup-python@v2.2.2 - with: - python-version: 3.7 - - name: Setup GitHub Package Registry - run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u "${{ github.actor }}" --password-stdin - - name: Install Python Packages - run: pip install -r requirements.txt - - name: Install Kind - run: 'GO111MODULE="on" go get sigs.k8s.io/kind@v0.13.0 - - kind' - - name: Install Mage - run: 'go get -u github.com/magefile/mage - - mage -h' - - name: Install Helm - run: 'wget https://get.helm.sh/helm-v3.6.0-linux-amd64.tar.gz - - tar -zxvf helm-v3.6.0-linux-amd64.tar.gz - - sudo mv linux-amd64/helm /usr/local/bin/helm - - helm' - - name: Sieve CI config generate - run: 'echo "{\"workload_conditional_wait_timeout\": 1000}" > sieve_config.json - - cat sieve_config.json' - - name: Build Image - learn - run: 'python3 build.py -c examples/cass-operator/ -m learn -p -r $IMAGE_NAMESPACE ' - - name: Build Image - test - run: 'python3 build.py -c examples/cass-operator/ -m test -p -r $IMAGE_NAMESPACE ' - - name: Build Image - vanilla - run: 'python3 build.py -c examples/cass-operator/ -m vanilla -p -r $IMAGE_NAMESPACE ' - - name: Clean images - if: always() - run: docker image prune -a -f && docker builder prune -a -f && docker system df cassandra-operator: runs-on: ubuntu-latest env: @@ -71,7 +19,7 @@ jobs: - name: Setup Go environment uses: actions/setup-go@v2.1.3 with: - go-version: 1.15 + go-version: 1.19 - name: Setup Python uses: actions/setup-python@v2.2.2 with: @@ -81,13 +29,9 @@ jobs: - name: Install Python Packages run: pip install -r requirements.txt - name: Install Kind - run: 'GO111MODULE="on" go get sigs.k8s.io/kind@v0.13.0 + run: 'GO111MODULE="on" go install sigs.k8s.io/kind@v0.13.0 kind' - - name: Install Mage - run: 'go get -u github.com/magefile/mage - - mage -h' - name: Install Helm run: 'wget https://get.helm.sh/helm-v3.6.0-linux-amd64.tar.gz @@ -123,7 +67,7 @@ jobs: - name: Setup Go environment uses: actions/setup-go@v2.1.3 with: - go-version: 1.15 + go-version: 1.19 - name: Setup Python uses: actions/setup-python@v2.2.2 with: @@ -133,13 +77,9 @@ jobs: - name: Install Python Packages run: pip install -r requirements.txt - name: Install Kind - run: 'GO111MODULE="on" go get sigs.k8s.io/kind@v0.13.0 + run: 'GO111MODULE="on" go install sigs.k8s.io/kind@v0.13.0 kind' - - name: Install Mage - run: 'go get -u github.com/magefile/mage - - mage -h' - name: Install Helm run: 'wget https://get.helm.sh/helm-v3.6.0-linux-amd64.tar.gz @@ -161,58 +101,6 @@ jobs: - name: Clean images if: always() run: docker image prune -a -f && docker builder prune -a -f && docker system df - elastic-operator: - runs-on: ubuntu-latest - env: - GOPATH: /home/runner/go - KUBECONFIG: /home/runner/.kube/config - steps: - - uses: actions/checkout@v2 - - name: Setup Git - run: 'git config --global user.name "sieve" - - git config --global user.email "sieve@sieve.com"' - - name: Setup Go environment - uses: actions/setup-go@v2.1.3 - with: - go-version: 1.15 - - name: Setup Python - uses: actions/setup-python@v2.2.2 - with: - python-version: 3.7 - - name: Setup GitHub Package Registry - run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u "${{ github.actor }}" --password-stdin - - name: Install Python Packages - run: pip install -r requirements.txt - - name: Install Kind - run: 'GO111MODULE="on" go get sigs.k8s.io/kind@v0.13.0 - - kind' - - name: Install Mage - run: 'go get -u github.com/magefile/mage - - mage -h' - - name: Install Helm - run: 'wget https://get.helm.sh/helm-v3.6.0-linux-amd64.tar.gz - - tar -zxvf helm-v3.6.0-linux-amd64.tar.gz - - sudo mv linux-amd64/helm /usr/local/bin/helm - - helm' - - name: Sieve CI config generate - run: 'echo "{\"workload_conditional_wait_timeout\": 1000}" > sieve_config.json - - cat sieve_config.json' - - name: Build Image - learn - run: 'python3 build.py -c examples/elastic-operator/ -m learn -p -r $IMAGE_NAMESPACE ' - - name: Build Image - test - run: 'python3 build.py -c examples/elastic-operator/ -m test -p -r $IMAGE_NAMESPACE ' - - name: Build Image - vanilla - run: 'python3 build.py -c examples/elastic-operator/ -m vanilla -p -r $IMAGE_NAMESPACE ' - - name: Clean images - if: always() - run: docker image prune -a -f && docker builder prune -a -f && docker system df mongodb-operator: runs-on: ubuntu-latest env: @@ -227,7 +115,7 @@ jobs: - name: Setup Go environment uses: actions/setup-go@v2.1.3 with: - go-version: 1.15 + go-version: 1.19 - name: Setup Python uses: actions/setup-python@v2.2.2 with: @@ -237,13 +125,9 @@ jobs: - name: Install Python Packages run: pip install -r requirements.txt - name: Install Kind - run: 'GO111MODULE="on" go get sigs.k8s.io/kind@v0.13.0 + run: 'GO111MODULE="on" go install sigs.k8s.io/kind@v0.13.0 kind' - - name: Install Mage - run: 'go get -u github.com/magefile/mage - - mage -h' - name: Install Helm run: 'wget https://get.helm.sh/helm-v3.6.0-linux-amd64.tar.gz @@ -279,7 +163,7 @@ jobs: - name: Setup Go environment uses: actions/setup-go@v2.1.3 with: - go-version: 1.15 + go-version: 1.19 - name: Setup Python uses: actions/setup-python@v2.2.2 with: @@ -289,13 +173,9 @@ jobs: - name: Install Python Packages run: pip install -r requirements.txt - name: Install Kind - run: 'GO111MODULE="on" go get sigs.k8s.io/kind@v0.13.0 + run: 'GO111MODULE="on" go install sigs.k8s.io/kind@v0.13.0 kind' - - name: Install Mage - run: 'go get -u github.com/magefile/mage - - mage -h' - name: Install Helm run: 'wget https://get.helm.sh/helm-v3.6.0-linux-amd64.tar.gz @@ -331,7 +211,7 @@ jobs: - name: Setup Go environment uses: actions/setup-go@v2.1.3 with: - go-version: 1.15 + go-version: 1.19 - name: Setup Python uses: actions/setup-python@v2.2.2 with: @@ -341,13 +221,9 @@ jobs: - name: Install Python Packages run: pip install -r requirements.txt - name: Install Kind - run: 'GO111MODULE="on" go get sigs.k8s.io/kind@v0.13.0 + run: 'GO111MODULE="on" go install sigs.k8s.io/kind@v0.13.0 kind' - - name: Install Mage - run: 'go get -u github.com/magefile/mage - - mage -h' - name: Install Helm run: 'wget https://get.helm.sh/helm-v3.6.0-linux-amd64.tar.gz @@ -383,7 +259,7 @@ jobs: - name: Setup Go environment uses: actions/setup-go@v2.1.3 with: - go-version: 1.15 + go-version: 1.19 - name: Setup Python uses: actions/setup-python@v2.2.2 with: @@ -393,13 +269,9 @@ jobs: - name: Install Python Packages run: pip install -r requirements.txt - name: Install Kind - run: 'GO111MODULE="on" go get sigs.k8s.io/kind@v0.13.0 + run: 'GO111MODULE="on" go install sigs.k8s.io/kind@v0.13.0 kind' - - name: Install Mage - run: 'go get -u github.com/magefile/mage - - mage -h' - name: Install Helm run: 'wget https://get.helm.sh/helm-v3.6.0-linux-amd64.tar.gz @@ -435,7 +307,7 @@ jobs: - name: Setup Go environment uses: actions/setup-go@v2.1.3 with: - go-version: 1.15 + go-version: 1.19 - name: Setup Python uses: actions/setup-python@v2.2.2 with: @@ -445,13 +317,9 @@ jobs: - name: Install Python Packages run: pip install -r requirements.txt - name: Install Kind - run: 'GO111MODULE="on" go get sigs.k8s.io/kind@v0.13.0 + run: 'GO111MODULE="on" go install sigs.k8s.io/kind@v0.13.0 kind' - - name: Install Mage - run: 'go get -u github.com/magefile/mage - - mage -h' - name: Install Helm run: 'wget https://get.helm.sh/helm-v3.6.0-linux-amd64.tar.gz @@ -487,7 +355,7 @@ jobs: - name: Setup Go environment uses: actions/setup-go@v2.1.3 with: - go-version: 1.15 + go-version: 1.19 - name: Setup Python uses: actions/setup-python@v2.2.2 with: @@ -497,13 +365,9 @@ jobs: - name: Install Python Packages run: pip install -r requirements.txt - name: Install Kind - run: 'GO111MODULE="on" go get sigs.k8s.io/kind@v0.13.0 + run: 'GO111MODULE="on" go install sigs.k8s.io/kind@v0.13.0 kind' - - name: Install Mage - run: 'go get -u github.com/magefile/mage - - mage -h' - name: Install Helm run: 'wget https://get.helm.sh/helm-v3.6.0-linux-amd64.tar.gz diff --git a/.github/workflows/oracle-generation.yml b/.github/workflows/oracle-generation.yml index 2a53b4ac8aa..18d472b8639 100644 --- a/.github/workflows/oracle-generation.yml +++ b/.github/workflows/oracle-generation.yml @@ -1,74 +1,10 @@ -# This file is automatically generated by gen_github_action.py on 2022-10-17 05:39:02.870913 +# This file is automatically generated by gen_github_action.py on 2022-12-30 05:14:21.007204 name: Oracle Generation 'on': workflow_dispatch: null env: IMAGE_NAMESPACE: ghcr.io/sieve-project/action jobs: - cass-operator: - runs-on: self-hosted - env: - GOPATH: /home/runner/go - KUBECONFIG: /home/runner/.kube/config - steps: - - uses: actions/checkout@v2 - - name: Setup Git - run: 'git config --global user.name "sieve" - - git config --global user.email "sieve@sieve.com"' - - name: Setup Go environment - uses: actions/setup-go@v2.1.3 - with: - go-version: 1.15 - - name: Setup Python - uses: actions/setup-python@v2.2.2 - with: - python-version: 3.7 - - name: Setup GitHub Package Registry - run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u "${{ github.actor }}" --password-stdin - - name: Install Python Packages - run: pip install -r requirements.txt - - name: Install Kind - run: 'GO111MODULE="on" go get sigs.k8s.io/kind@v0.13.0 - - kind' - - name: Install Mage - run: 'go get -u github.com/magefile/mage - - mage -h' - - name: Install Helm - run: 'wget https://get.helm.sh/helm-v3.6.0-linux-amd64.tar.gz - - tar -zxvf helm-v3.6.0-linux-amd64.tar.gz - - sudo mv linux-amd64/helm /usr/local/bin/helm - - helm' - - name: Sieve CI config generate - run: 'echo "{\"workload_conditional_wait_timeout\": 1000}" > sieve_config.json - - cat sieve_config.json' - - name: Sieve Learn - cass-operator recreate - run: python3 sieve.py -c examples/cass-operator/ -w recreate -m generate-oracle -r $IMAGE_NAMESPACE - - name: Sieve Learn - cass-operator scaledown-scaleup - run: python3 sieve.py -c examples/cass-operator/ -w scaledown-scaleup -m generate-oracle -r $IMAGE_NAMESPACE - - uses: actions/upload-artifact@v2 - if: always() - with: - name: sieve-cass-operator-log - path: log - - name: Remove cluster - if: always() - run: kind delete cluster - - uses: JamesIves/github-pages-deploy-action@4.1.5 - name: Persistent oracle data - with: - branch: oracle-data - folder: examples/cass-operator/oracle - target-folder: cass-operator/oracle - - name: Clean images - if: always() - run: docker image prune -a -f && docker builder prune -a -f && docker system df cassandra-operator: runs-on: self-hosted env: @@ -83,7 +19,7 @@ jobs: - name: Setup Go environment uses: actions/setup-go@v2.1.3 with: - go-version: 1.15 + go-version: 1.19 - name: Setup Python uses: actions/setup-python@v2.2.2 with: @@ -93,13 +29,9 @@ jobs: - name: Install Python Packages run: pip install -r requirements.txt - name: Install Kind - run: 'GO111MODULE="on" go get sigs.k8s.io/kind@v0.13.0 + run: 'GO111MODULE="on" go install sigs.k8s.io/kind@v0.13.0 kind' - - name: Install Mage - run: 'go get -u github.com/magefile/mage - - mage -h' - name: Install Helm run: 'wget https://get.helm.sh/helm-v3.6.0-linux-amd64.tar.gz @@ -147,7 +79,7 @@ jobs: - name: Setup Go environment uses: actions/setup-go@v2.1.3 with: - go-version: 1.15 + go-version: 1.19 - name: Setup Python uses: actions/setup-python@v2.2.2 with: @@ -157,13 +89,9 @@ jobs: - name: Install Python Packages run: pip install -r requirements.txt - name: Install Kind - run: 'GO111MODULE="on" go get sigs.k8s.io/kind@v0.13.0 + run: 'GO111MODULE="on" go install sigs.k8s.io/kind@v0.13.0 kind' - - name: Install Mage - run: 'go get -u github.com/magefile/mage - - mage -h' - name: Install Helm run: 'wget https://get.helm.sh/helm-v3.6.0-linux-amd64.tar.gz @@ -199,70 +127,6 @@ jobs: - name: Clean images if: always() run: docker image prune -a -f && docker builder prune -a -f && docker system df - elastic-operator: - runs-on: self-hosted - env: - GOPATH: /home/runner/go - KUBECONFIG: /home/runner/.kube/config - steps: - - uses: actions/checkout@v2 - - name: Setup Git - run: 'git config --global user.name "sieve" - - git config --global user.email "sieve@sieve.com"' - - name: Setup Go environment - uses: actions/setup-go@v2.1.3 - with: - go-version: 1.15 - - name: Setup Python - uses: actions/setup-python@v2.2.2 - with: - python-version: 3.7 - - name: Setup GitHub Package Registry - run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u "${{ github.actor }}" --password-stdin - - name: Install Python Packages - run: pip install -r requirements.txt - - name: Install Kind - run: 'GO111MODULE="on" go get sigs.k8s.io/kind@v0.13.0 - - kind' - - name: Install Mage - run: 'go get -u github.com/magefile/mage - - mage -h' - - name: Install Helm - run: 'wget https://get.helm.sh/helm-v3.6.0-linux-amd64.tar.gz - - tar -zxvf helm-v3.6.0-linux-amd64.tar.gz - - sudo mv linux-amd64/helm /usr/local/bin/helm - - helm' - - name: Sieve CI config generate - run: 'echo "{\"workload_conditional_wait_timeout\": 1000}" > sieve_config.json - - cat sieve_config.json' - - name: Sieve Learn - elastic-operator recreate - run: python3 sieve.py -c examples/elastic-operator/ -w recreate -m generate-oracle -r $IMAGE_NAMESPACE - - name: Sieve Learn - elastic-operator scaledown-scaleup - run: python3 sieve.py -c examples/elastic-operator/ -w scaledown-scaleup -m generate-oracle -r $IMAGE_NAMESPACE - - uses: actions/upload-artifact@v2 - if: always() - with: - name: sieve-elastic-operator-log - path: log - - name: Remove cluster - if: always() - run: kind delete cluster - - uses: JamesIves/github-pages-deploy-action@4.1.5 - name: Persistent oracle data - with: - branch: oracle-data - folder: examples/elastic-operator/oracle - target-folder: elastic-operator/oracle - - name: Clean images - if: always() - run: docker image prune -a -f && docker builder prune -a -f && docker system df mongodb-operator: runs-on: self-hosted env: @@ -277,7 +141,7 @@ jobs: - name: Setup Go environment uses: actions/setup-go@v2.1.3 with: - go-version: 1.15 + go-version: 1.19 - name: Setup Python uses: actions/setup-python@v2.2.2 with: @@ -287,13 +151,9 @@ jobs: - name: Install Python Packages run: pip install -r requirements.txt - name: Install Kind - run: 'GO111MODULE="on" go get sigs.k8s.io/kind@v0.13.0 + run: 'GO111MODULE="on" go install sigs.k8s.io/kind@v0.13.0 kind' - - name: Install Mage - run: 'go get -u github.com/magefile/mage - - mage -h' - name: Install Helm run: 'wget https://get.helm.sh/helm-v3.6.0-linux-amd64.tar.gz @@ -347,7 +207,7 @@ jobs: - name: Setup Go environment uses: actions/setup-go@v2.1.3 with: - go-version: 1.15 + go-version: 1.19 - name: Setup Python uses: actions/setup-python@v2.2.2 with: @@ -357,13 +217,9 @@ jobs: - name: Install Python Packages run: pip install -r requirements.txt - name: Install Kind - run: 'GO111MODULE="on" go get sigs.k8s.io/kind@v0.13.0 + run: 'GO111MODULE="on" go install sigs.k8s.io/kind@v0.13.0 kind' - - name: Install Mage - run: 'go get -u github.com/magefile/mage - - mage -h' - name: Install Helm run: 'wget https://get.helm.sh/helm-v3.6.0-linux-amd64.tar.gz @@ -413,7 +269,7 @@ jobs: - name: Setup Go environment uses: actions/setup-go@v2.1.3 with: - go-version: 1.15 + go-version: 1.19 - name: Setup Python uses: actions/setup-python@v2.2.2 with: @@ -423,13 +279,9 @@ jobs: - name: Install Python Packages run: pip install -r requirements.txt - name: Install Kind - run: 'GO111MODULE="on" go get sigs.k8s.io/kind@v0.13.0 + run: 'GO111MODULE="on" go install sigs.k8s.io/kind@v0.13.0 kind' - - name: Install Mage - run: 'go get -u github.com/magefile/mage - - mage -h' - name: Install Helm run: 'wget https://get.helm.sh/helm-v3.6.0-linux-amd64.tar.gz @@ -479,7 +331,7 @@ jobs: - name: Setup Go environment uses: actions/setup-go@v2.1.3 with: - go-version: 1.15 + go-version: 1.19 - name: Setup Python uses: actions/setup-python@v2.2.2 with: @@ -489,13 +341,9 @@ jobs: - name: Install Python Packages run: pip install -r requirements.txt - name: Install Kind - run: 'GO111MODULE="on" go get sigs.k8s.io/kind@v0.13.0 + run: 'GO111MODULE="on" go install sigs.k8s.io/kind@v0.13.0 kind' - - name: Install Mage - run: 'go get -u github.com/magefile/mage - - mage -h' - name: Install Helm run: 'wget https://get.helm.sh/helm-v3.6.0-linux-amd64.tar.gz @@ -549,7 +397,7 @@ jobs: - name: Setup Go environment uses: actions/setup-go@v2.1.3 with: - go-version: 1.15 + go-version: 1.19 - name: Setup Python uses: actions/setup-python@v2.2.2 with: @@ -559,13 +407,9 @@ jobs: - name: Install Python Packages run: pip install -r requirements.txt - name: Install Kind - run: 'GO111MODULE="on" go get sigs.k8s.io/kind@v0.13.0 + run: 'GO111MODULE="on" go install sigs.k8s.io/kind@v0.13.0 kind' - - name: Install Mage - run: 'go get -u github.com/magefile/mage - - mage -h' - name: Install Helm run: 'wget https://get.helm.sh/helm-v3.6.0-linux-amd64.tar.gz @@ -617,7 +461,7 @@ jobs: - name: Setup Go environment uses: actions/setup-go@v2.1.3 with: - go-version: 1.15 + go-version: 1.19 - name: Setup Python uses: actions/setup-python@v2.2.2 with: @@ -627,13 +471,9 @@ jobs: - name: Install Python Packages run: pip install -r requirements.txt - name: Install Kind - run: 'GO111MODULE="on" go get sigs.k8s.io/kind@v0.13.0 + run: 'GO111MODULE="on" go install sigs.k8s.io/kind@v0.13.0 kind' - - name: Install Mage - run: 'go get -u github.com/magefile/mage - - mage -h' - name: Install Helm run: 'wget https://get.helm.sh/helm-v3.6.0-linux-amd64.tar.gz diff --git a/.github/workflows/regression-testing.yml b/.github/workflows/regression-testing.yml index 1f9702bf0d3..39c08abaa79 100644 --- a/.github/workflows/regression-testing.yml +++ b/.github/workflows/regression-testing.yml @@ -1,4 +1,4 @@ -# This file is automatically generated by gen_github_action.py on 2022-10-17 05:39:02.736552 +# This file is automatically generated by gen_github_action.py on 2022-12-30 05:14:20.952337 name: Regression Testing 'on': pull_request: null @@ -6,73 +6,6 @@ name: Regression Testing env: IMAGE_NAMESPACE: ghcr.io/sieve-project/action jobs: - cass-operator: - runs-on: ubuntu-latest - env: - GOPATH: /home/runner/go - KUBECONFIG: /home/runner/.kube/config - steps: - - uses: actions/checkout@v2 - - name: Setup Git - run: 'git config --global user.name "sieve" - - git config --global user.email "sieve@sieve.com"' - - name: Setup Go environment - uses: actions/setup-go@v2.1.3 - with: - go-version: 1.15 - - name: Setup Python - uses: actions/setup-python@v2.2.2 - with: - python-version: 3.7 - - name: Setup GitHub Package Registry - run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u "${{ github.actor }}" --password-stdin - - name: Install Python Packages - run: pip install -r requirements.txt - - name: Install Kind - run: 'GO111MODULE="on" go get sigs.k8s.io/kind@v0.13.0 - - kind' - - name: Install Mage - run: 'go get -u github.com/magefile/mage - - mage -h' - - name: Install Helm - run: 'wget https://get.helm.sh/helm-v3.6.0-linux-amd64.tar.gz - - tar -zxvf helm-v3.6.0-linux-amd64.tar.gz - - sudo mv linux-amd64/helm /usr/local/bin/helm - - helm' - - name: Sieve CI config generate - run: 'echo "{\"workload_conditional_wait_timeout\": 1000}" > sieve_config.json - - cat sieve_config.json' - - name: Build Image - learn - run: python3 build.py -c examples/cass-operator/ -m learn -r $IMAGE_NAMESPACE - - name: Build Image - test - run: python3 build.py -c examples/cass-operator/ -m test -r $IMAGE_NAMESPACE - - name: Build Image - vanilla - run: python3 build.py -c examples/cass-operator/ -m vanilla -r $IMAGE_NAMESPACE - - name: Sieve Learn - cass-operator recreate - run: python3 sieve.py -c examples/cass-operator/ -w recreate -m generate-oracle -r $IMAGE_NAMESPACE - - name: Sieve Learn - cass-operator scaledown-scaleup - run: python3 sieve.py -c examples/cass-operator/ -w scaledown-scaleup -m generate-oracle -r $IMAGE_NAMESPACE - - name: Sieve Test - cass-operator intermediate-state-1 - run: python3 reproduce_bugs.py -c cass-operator -b intermediate-state-1 -r $IMAGE_NAMESPACE - - name: Sieve Test - cass-operator intermediate-state-2 - run: python3 reproduce_bugs.py -c cass-operator -b intermediate-state-2 -r $IMAGE_NAMESPACE - - name: Sieve Test - cass-operator stale-state-1 - run: python3 reproduce_bugs.py -c cass-operator -b stale-state-1 -r $IMAGE_NAMESPACE - - uses: actions/upload-artifact@v2 - if: always() - with: - name: sieve-cass-operator-log - path: log - - name: Remove cluster - if: always() - run: kind delete cluster cassandra-operator: runs-on: ubuntu-latest env: @@ -87,7 +20,7 @@ jobs: - name: Setup Go environment uses: actions/setup-go@v2.1.3 with: - go-version: 1.15 + go-version: 1.19 - name: Setup Python uses: actions/setup-python@v2.2.2 with: @@ -97,13 +30,9 @@ jobs: - name: Install Python Packages run: pip install -r requirements.txt - name: Install Kind - run: 'GO111MODULE="on" go get sigs.k8s.io/kind@v0.13.0 + run: 'GO111MODULE="on" go install sigs.k8s.io/kind@v0.13.0 kind' - - name: Install Mage - run: 'go get -u github.com/magefile/mage - - mage -h' - name: Install Helm run: 'wget https://get.helm.sh/helm-v3.6.0-linux-amd64.tar.gz @@ -136,7 +65,7 @@ jobs: - name: Setup Go environment uses: actions/setup-go@v2.1.3 with: - go-version: 1.15 + go-version: 1.19 - name: Setup Python uses: actions/setup-python@v2.2.2 with: @@ -146,13 +75,9 @@ jobs: - name: Install Python Packages run: pip install -r requirements.txt - name: Install Kind - run: 'GO111MODULE="on" go get sigs.k8s.io/kind@v0.13.0 + run: 'GO111MODULE="on" go install sigs.k8s.io/kind@v0.13.0 kind' - - name: Install Mage - run: 'go get -u github.com/magefile/mage - - mage -h' - name: Install Helm run: 'wget https://get.helm.sh/helm-v3.6.0-linux-amd64.tar.gz @@ -193,71 +118,6 @@ jobs: - name: Remove cluster if: always() run: kind delete cluster - elastic-operator: - runs-on: ubuntu-latest - env: - GOPATH: /home/runner/go - KUBECONFIG: /home/runner/.kube/config - steps: - - uses: actions/checkout@v2 - - name: Setup Git - run: 'git config --global user.name "sieve" - - git config --global user.email "sieve@sieve.com"' - - name: Setup Go environment - uses: actions/setup-go@v2.1.3 - with: - go-version: 1.15 - - name: Setup Python - uses: actions/setup-python@v2.2.2 - with: - python-version: 3.7 - - name: Setup GitHub Package Registry - run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u "${{ github.actor }}" --password-stdin - - name: Install Python Packages - run: pip install -r requirements.txt - - name: Install Kind - run: 'GO111MODULE="on" go get sigs.k8s.io/kind@v0.13.0 - - kind' - - name: Install Mage - run: 'go get -u github.com/magefile/mage - - mage -h' - - name: Install Helm - run: 'wget https://get.helm.sh/helm-v3.6.0-linux-amd64.tar.gz - - tar -zxvf helm-v3.6.0-linux-amd64.tar.gz - - sudo mv linux-amd64/helm /usr/local/bin/helm - - helm' - - name: Sieve CI config generate - run: 'echo "{\"workload_conditional_wait_timeout\": 1000}" > sieve_config.json - - cat sieve_config.json' - - name: Build Image - learn - run: python3 build.py -c examples/elastic-operator/ -m learn -r $IMAGE_NAMESPACE - - name: Build Image - test - run: python3 build.py -c examples/elastic-operator/ -m test -r $IMAGE_NAMESPACE - - name: Build Image - vanilla - run: python3 build.py -c examples/elastic-operator/ -m vanilla -r $IMAGE_NAMESPACE - - name: Sieve Learn - elastic-operator recreate - run: python3 sieve.py -c examples/elastic-operator/ -w recreate -m generate-oracle -r $IMAGE_NAMESPACE - - name: Sieve Learn - elastic-operator scaledown-scaleup - run: python3 sieve.py -c examples/elastic-operator/ -w scaledown-scaleup -m generate-oracle -r $IMAGE_NAMESPACE - - name: Sieve Test - elastic-operator stale-state-1 - run: python3 reproduce_bugs.py -c elastic-operator -b stale-state-1 -r $IMAGE_NAMESPACE - - name: Sieve Test - elastic-operator stale-state-2 - run: python3 reproduce_bugs.py -c elastic-operator -b stale-state-2 -r $IMAGE_NAMESPACE - - uses: actions/upload-artifact@v2 - if: always() - with: - name: sieve-elastic-operator-log - path: log - - name: Remove cluster - if: always() - run: kind delete cluster mongodb-operator: runs-on: ubuntu-latest env: @@ -272,7 +132,7 @@ jobs: - name: Setup Go environment uses: actions/setup-go@v2.1.3 with: - go-version: 1.15 + go-version: 1.19 - name: Setup Python uses: actions/setup-python@v2.2.2 with: @@ -282,13 +142,9 @@ jobs: - name: Install Python Packages run: pip install -r requirements.txt - name: Install Kind - run: 'GO111MODULE="on" go get sigs.k8s.io/kind@v0.13.0 + run: 'GO111MODULE="on" go install sigs.k8s.io/kind@v0.13.0 kind' - - name: Install Mage - run: 'go get -u github.com/magefile/mage - - mage -h' - name: Install Helm run: 'wget https://get.helm.sh/helm-v3.6.0-linux-amd64.tar.gz @@ -351,7 +207,7 @@ jobs: - name: Setup Go environment uses: actions/setup-go@v2.1.3 with: - go-version: 1.15 + go-version: 1.19 - name: Setup Python uses: actions/setup-python@v2.2.2 with: @@ -361,13 +217,9 @@ jobs: - name: Install Python Packages run: pip install -r requirements.txt - name: Install Kind - run: 'GO111MODULE="on" go get sigs.k8s.io/kind@v0.13.0 + run: 'GO111MODULE="on" go install sigs.k8s.io/kind@v0.13.0 kind' - - name: Install Mage - run: 'go get -u github.com/magefile/mage - - mage -h' - name: Install Helm run: 'wget https://get.helm.sh/helm-v3.6.0-linux-amd64.tar.gz @@ -400,7 +252,7 @@ jobs: - name: Setup Go environment uses: actions/setup-go@v2.1.3 with: - go-version: 1.15 + go-version: 1.19 - name: Setup Python uses: actions/setup-python@v2.2.2 with: @@ -410,13 +262,9 @@ jobs: - name: Install Python Packages run: pip install -r requirements.txt - name: Install Kind - run: 'GO111MODULE="on" go get sigs.k8s.io/kind@v0.13.0 + run: 'GO111MODULE="on" go install sigs.k8s.io/kind@v0.13.0 kind' - - name: Install Mage - run: 'go get -u github.com/magefile/mage - - mage -h' - name: Install Helm run: 'wget https://get.helm.sh/helm-v3.6.0-linux-amd64.tar.gz @@ -471,7 +319,7 @@ jobs: - name: Setup Go environment uses: actions/setup-go@v2.1.3 with: - go-version: 1.15 + go-version: 1.19 - name: Setup Python uses: actions/setup-python@v2.2.2 with: @@ -481,13 +329,9 @@ jobs: - name: Install Python Packages run: pip install -r requirements.txt - name: Install Kind - run: 'GO111MODULE="on" go get sigs.k8s.io/kind@v0.13.0 + run: 'GO111MODULE="on" go install sigs.k8s.io/kind@v0.13.0 kind' - - name: Install Mage - run: 'go get -u github.com/magefile/mage - - mage -h' - name: Install Helm run: 'wget https://get.helm.sh/helm-v3.6.0-linux-amd64.tar.gz @@ -520,7 +364,7 @@ jobs: - name: Setup Go environment uses: actions/setup-go@v2.1.3 with: - go-version: 1.15 + go-version: 1.19 - name: Setup Python uses: actions/setup-python@v2.2.2 with: @@ -530,13 +374,9 @@ jobs: - name: Install Python Packages run: pip install -r requirements.txt - name: Install Kind - run: 'GO111MODULE="on" go get sigs.k8s.io/kind@v0.13.0 + run: 'GO111MODULE="on" go install sigs.k8s.io/kind@v0.13.0 kind' - - name: Install Mage - run: 'go get -u github.com/magefile/mage - - mage -h' - name: Install Helm run: 'wget https://get.helm.sh/helm-v3.6.0-linux-amd64.tar.gz @@ -569,7 +409,7 @@ jobs: - name: Setup Go environment uses: actions/setup-go@v2.1.3 with: - go-version: 1.15 + go-version: 1.19 - name: Setup Python uses: actions/setup-python@v2.2.2 with: @@ -579,13 +419,9 @@ jobs: - name: Install Python Packages run: pip install -r requirements.txt - name: Install Kind - run: 'GO111MODULE="on" go get sigs.k8s.io/kind@v0.13.0 + run: 'GO111MODULE="on" go install sigs.k8s.io/kind@v0.13.0 kind' - - name: Install Mage - run: 'go get -u github.com/magefile/mage - - mage -h' - name: Install Helm run: 'wget https://get.helm.sh/helm-v3.6.0-linux-amd64.tar.gz diff --git a/bug_reproduction_test_plans/cass-operator-intermediate-state-1.yaml b/bug_reproduction_test_plans/cass-operator-intermediate-state-1.yaml index c54b0b92bf8..61eaa1d2829 100644 --- a/bug_reproduction_test_plans/cass-operator-intermediate-state-1.yaml +++ b/bug_reproduction_test_plans/cass-operator-intermediate-state-1.yaml @@ -11,5 +11,5 @@ actions: occurrence: 1 observationPoint: when: afterControllerWrite - by: github.com/datastax/cass-operator/operator/pkg/reconciliation.(*ReconcileCassandraDatacenter) + by: github.com/datastax/cass-operator/operator/pkg/reconciliation.(*ReconcileCassandraDatacenter).Reconcile expression: trigger1 diff --git a/bug_reproduction_test_plans/cass-operator-intermediate-state-2.yaml b/bug_reproduction_test_plans/cass-operator-intermediate-state-2.yaml index 6d4a4595922..eb03e898e00 100644 --- a/bug_reproduction_test_plans/cass-operator-intermediate-state-2.yaml +++ b/bug_reproduction_test_plans/cass-operator-intermediate-state-2.yaml @@ -15,5 +15,5 @@ actions: occurrence: 2 observationPoint: when: afterControllerWrite - by: github.com/datastax/cass-operator/operator/pkg/reconciliation.(*ReconcileCassandraDatacenter) + by: github.com/datastax/cass-operator/operator/pkg/reconciliation.(*ReconcileCassandraDatacenter).Reconcile expression: trigger1 diff --git a/bug_reproduction_test_plans/casskop-intermediate-state-1.yaml b/bug_reproduction_test_plans/casskop-intermediate-state-1.yaml index 7bd762ae605..3ebe1c17b8f 100644 --- a/bug_reproduction_test_plans/casskop-intermediate-state-1.yaml +++ b/bug_reproduction_test_plans/casskop-intermediate-state-1.yaml @@ -13,5 +13,5 @@ actions: occurrence: 1 observationPoint: when: afterControllerWrite - by: github.com/Orange-OpenSource/casskop/pkg/controller/cassandracluster.(*ReconcileCassandraCluster) + by: github.com/Orange-OpenSource/casskop/pkg/controller/cassandracluster.(*ReconcileCassandraCluster).Reconcile expression: trigger1 diff --git a/bug_reproduction_test_plans/mongodb-operator-indirect-2.yaml b/bug_reproduction_test_plans/mongodb-operator-indirect-2.yaml index a045b1ee4f6..fd2203d9c2d 100644 --- a/bug_reproduction_test_plans/mongodb-operator-indirect-2.yaml +++ b/bug_reproduction_test_plans/mongodb-operator-indirect-2.yaml @@ -30,7 +30,7 @@ actions: occurrence: 1 observationPoint: when: afterControllerWrite - by: github.com/percona/percona-server-mongodb-operator/pkg/controller/perconaservermongodb.(*ReconcilePerconaServerMongoDB) + by: github.com/percona/percona-server-mongodb-operator/pkg/controller/perconaservermongodb.(*ReconcilePerconaServerMongoDB).Reconcile expression: trigger1 - actionType: resumeController pauseAt: afterControllerWrite diff --git a/bug_reproduction_test_plans/mongodb-operator-intermediate-state-1.yaml b/bug_reproduction_test_plans/mongodb-operator-intermediate-state-1.yaml index 9d6a06d193f..ad1e579118c 100644 --- a/bug_reproduction_test_plans/mongodb-operator-intermediate-state-1.yaml +++ b/bug_reproduction_test_plans/mongodb-operator-intermediate-state-1.yaml @@ -11,5 +11,5 @@ actions: occurrence: 1 observationPoint: when: afterControllerWrite - by: github.com/percona/percona-server-mongodb-operator/pkg/controller/perconaservermongodb.(*ReconcilePerconaServerMongoDB) + by: github.com/percona/percona-server-mongodb-operator/pkg/controller/perconaservermongodb.(*ReconcilePerconaServerMongoDB).Reconcile expression: trigger1 diff --git a/bug_reproduction_test_plans/mongodb-operator-intermediate-state-2.yaml b/bug_reproduction_test_plans/mongodb-operator-intermediate-state-2.yaml index 417d4566efe..4fdaf2ad577 100644 --- a/bug_reproduction_test_plans/mongodb-operator-intermediate-state-2.yaml +++ b/bug_reproduction_test_plans/mongodb-operator-intermediate-state-2.yaml @@ -11,5 +11,5 @@ actions: occurrence: 1 observationPoint: when: afterControllerWrite - by: github.com/percona/percona-server-mongodb-operator/pkg/controller/perconaservermongodb.(*ReconcilePerconaServerMongoDB) + by: github.com/percona/percona-server-mongodb-operator/pkg/controller/perconaservermongodb.(*ReconcilePerconaServerMongoDB).Reconcile expression: trigger1 diff --git a/bug_reproduction_test_plans/nifikop-intermediate-state-1.yaml b/bug_reproduction_test_plans/nifikop-intermediate-state-1.yaml index 4b48e459356..e897d344b67 100644 --- a/bug_reproduction_test_plans/nifikop-intermediate-state-1.yaml +++ b/bug_reproduction_test_plans/nifikop-intermediate-state-1.yaml @@ -13,5 +13,5 @@ actions: occurrence: 1 observationPoint: when: afterControllerWrite - by: github.com/Orange-OpenSource/nifikop/controllers.(*NifiClusterReconciler) + by: github.com/Orange-OpenSource/nifikop/controllers.(*NifiClusterReconciler).Reconcile expression: trigger1 diff --git a/bug_reproduction_test_plans/nifikop-intermediate-state-2.yaml b/bug_reproduction_test_plans/nifikop-intermediate-state-2.yaml index 874602e3ddb..061e5f0dbc2 100644 --- a/bug_reproduction_test_plans/nifikop-intermediate-state-2.yaml +++ b/bug_reproduction_test_plans/nifikop-intermediate-state-2.yaml @@ -17,5 +17,5 @@ actions: occurrence: 2 observationPoint: when: afterControllerWrite - by: github.com/Orange-OpenSource/nifikop/controllers.(*NifiClusterReconciler) + by: github.com/Orange-OpenSource/nifikop/controllers.(*NifiClusterReconciler).Reconcile expression: trigger1 diff --git a/bug_reproduction_test_plans/rabbitmq-operator-intermediate-state-1.yaml b/bug_reproduction_test_plans/rabbitmq-operator-intermediate-state-1.yaml index 8219f327c03..47535a5ec53 100644 --- a/bug_reproduction_test_plans/rabbitmq-operator-intermediate-state-1.yaml +++ b/bug_reproduction_test_plans/rabbitmq-operator-intermediate-state-1.yaml @@ -11,5 +11,5 @@ actions: occurrence: 1 observationPoint: when: afterControllerWrite - by: github.com/rabbitmq/cluster-operator/controllers.(*RabbitmqClusterReconciler) + by: github.com/rabbitmq/cluster-operator/controllers.(*RabbitmqClusterReconciler).Reconcile expression: trigger1 diff --git a/bug_reproduction_test_plans/xtradb-operator-intermediate-state-1.yaml b/bug_reproduction_test_plans/xtradb-operator-intermediate-state-1.yaml index c21a06241ef..da9dd53fe2a 100644 --- a/bug_reproduction_test_plans/xtradb-operator-intermediate-state-1.yaml +++ b/bug_reproduction_test_plans/xtradb-operator-intermediate-state-1.yaml @@ -11,5 +11,5 @@ actions: occurrence: 1 observationPoint: when: afterControllerWrite - by: github.com/percona/percona-xtradb-cluster-operator/pkg/controller/pxc.(*ReconcilePerconaXtraDBCluster) + by: github.com/percona/percona-xtradb-cluster-operator/pkg/controller/pxc.(*ReconcilePerconaXtraDBCluster).Reconcile expression: trigger1 diff --git a/bug_reproduction_test_plans/xtradb-operator-intermediate-state-2.yaml b/bug_reproduction_test_plans/xtradb-operator-intermediate-state-2.yaml index badbae04128..607dee29108 100644 --- a/bug_reproduction_test_plans/xtradb-operator-intermediate-state-2.yaml +++ b/bug_reproduction_test_plans/xtradb-operator-intermediate-state-2.yaml @@ -11,5 +11,5 @@ actions: occurrence: 1 observationPoint: when: afterControllerWrite - by: github.com/percona/percona-xtradb-cluster-operator/pkg/controller/pxc.(*ReconcilePerconaXtraDBCluster) + by: github.com/percona/percona-xtradb-cluster-operator/pkg/controller/pxc.(*ReconcilePerconaXtraDBCluster).Reconcile expression: trigger1 diff --git a/bug_reproduction_test_plans/xtradb-operator-intermediate-state-3.yaml b/bug_reproduction_test_plans/xtradb-operator-intermediate-state-3.yaml index f19e280004c..1a6d7758e68 100644 --- a/bug_reproduction_test_plans/xtradb-operator-intermediate-state-3.yaml +++ b/bug_reproduction_test_plans/xtradb-operator-intermediate-state-3.yaml @@ -11,5 +11,5 @@ actions: occurrence: 1 observationPoint: when: afterControllerWrite - by: github.com/percona/percona-xtradb-cluster-operator/pkg/controller/pxc.(*ReconcilePerconaXtraDBCluster) + by: github.com/percona/percona-xtradb-cluster-operator/pkg/controller/pxc.(*ReconcilePerconaXtraDBCluster).Reconcile expression: trigger1 diff --git a/bug_reproduction_test_plans/zookeeper-operator-indirect-1.yaml b/bug_reproduction_test_plans/zookeeper-operator-indirect-1.yaml index 39d7a705810..b5ca32e7b58 100644 --- a/bug_reproduction_test_plans/zookeeper-operator-indirect-1.yaml +++ b/bug_reproduction_test_plans/zookeeper-operator-indirect-1.yaml @@ -14,7 +14,7 @@ actions: occurrence: 1 observationPoint: when: afterControllerWrite - by: github.com/pravega/zookeeper-operator/pkg/controller/zookeepercluster.(*ReconcileZookeeperCluster) + by: github.com/pravega/zookeeper-operator/pkg/controller/zookeepercluster.(*ReconcileZookeeperCluster).Reconcile expression: trigger1 - actionType: resumeController pauseAt: afterControllerWrite diff --git a/build.py b/build.py index 4990f49eda0..d3b5d8858f8 100644 --- a/build.py +++ b/build.py @@ -184,12 +184,6 @@ def install_lib_for_controller( controller_config.apimachinery_version, ) - install_module( - "sigs.k8s.io/controller-runtime@{}".format( - controller_config.controller_runtime_version - ), - sieve_dep_src_dir, - ) install_module( "k8s.io/client-go@{}".format(controller_config.client_go_version), sieve_dep_src_dir, @@ -228,11 +222,6 @@ def update_go_mod_for_controller( go_mod_file.write( "replace sieve.client => ./sieve-dependency/src/sieve.client\n" ) - go_mod_file.write( - "replace sigs.k8s.io/controller-runtime => ./sieve-dependency/src/sigs.k8s.io/controller-runtime@{}\n".format( - controller_config.controller_runtime_version - ) - ) go_mod_file.write( "replace k8s.io/client-go => ./sieve-dependency/src/k8s.io/client-go@{}\n".format( controller_config.client_go_version @@ -250,36 +239,6 @@ def update_go_mod_for_controller( ) ) - # TODO: do we need to modify go.mod in controller-runtime and client-go? - controller_runtime_go_mod = os.path.join( - sieve_dep_src_dir, - "sigs.k8s.io/controller-runtime@{}/go.mod".format( - controller_config.controller_runtime_version - ), - ) - with open( - controller_runtime_go_mod, - "a", - ) as go_mod_file: - go_mod_file.write("require sieve.client v0.0.0\n") - go_mod_file.write("replace sieve.client => ../../sieve.client\n") - go_mod_file.write( - "replace k8s.io/client-go => ../../k8s.io/client-go@{}\n".format( - controller_config.client_go_version - ) - ) - - client_go_go_mod = os.path.join( - sieve_dep_src_dir, - "k8s.io/client-go@{}/go.mod".format(controller_config.client_go_version), - ) - with open( - client_go_go_mod, - "a", - ) as go_mod_file: - go_mod_file.write("require sieve.client v0.0.0\n") - go_mod_file.write("replace sieve.client => ../../sieve.client\n") - # copy the build.sh and Dockerfile shutil.copy( os.path.join(controller_config_dir, "build", "build.sh"), @@ -289,10 +248,10 @@ def update_go_mod_for_controller( os.path.join(controller_config_dir, "build", "Dockerfile"), os.path.join(application_dir, controller_config.dockerfile_path), ) - os.chdir(application_dir) - os_system("git add -A >> /dev/null") - os_system('git commit -m "import the lib" >> /dev/null') - os.chdir(ORIGINAL_DIR) + # os.chdir(application_dir) + # os_system("git add -A >> /dev/null") + # os_system('git commit -m "import the lib" >> /dev/null') + # os.chdir(ORIGINAL_DIR) def instrument_controller( @@ -304,16 +263,12 @@ def instrument_controller( "project": controller_config.controller_name, "mode": mode, "app_file_path": os.path.join(ORIGINAL_DIR, application_dir), - "controller_runtime_filepath": "{}/{}/sieve-dependency/src/sigs.k8s.io/controller-runtime@{}".format( - ORIGINAL_DIR, - application_dir, - controller_config.controller_runtime_version, - ), "client_go_filepath": "{}/{}/sieve-dependency/src/k8s.io/client-go@{}".format( ORIGINAL_DIR, application_dir, controller_config.client_go_version, ), + "annotated_reconcile_functions": controller_config.annotated_reconcile_functions, "apis_to_instrument": controller_config.apis_to_instrument, } json.dump(instrumentation_config, open("config.json", "w"), indent=4) @@ -359,25 +314,6 @@ def update_go_mod_for_controller_with_vendor( application_dir = os.path.join("app", controller_config.controller_name) with open(os.path.join(application_dir, "go.mod"), "a") as go_mod_file: go_mod_file.write("require sieve.client v0.0.0\n") - with open( - os.path.join( - application_dir, - controller_config.vendored_controller_runtime_path, - "go.mod", - ), - "a", - ) as go_mod_file: - go_mod_file.write("require sieve.client v0.0.0\n") - with open( - os.path.join( - application_dir, - controller_config.vendored_client_go_path, - "go.mod", - ), - "a", - ) as go_mod_file: - go_mod_file.write("require sieve.client v0.0.0\n") - # copy the build.sh and Dockerfile shutil.copy( os.path.join(controller_config_dir, "build", "build.sh"), @@ -402,11 +338,6 @@ def instrument_controller_with_vendor( "project": controller_config.controller_name, "mode": mode, "app_file_path": os.path.join(ORIGINAL_DIR, application_dir), - "controller_runtime_filepath": os.path.join( - ORIGINAL_DIR, - application_dir, - controller_config.vendored_controller_runtime_path, - ), "client_go_filepath": os.path.join( ORIGINAL_DIR, application_dir, diff --git a/docs/reprod.md b/docs/reprod.md index 5304b5114f3..c4c04192e8f 100644 --- a/docs/reprod.md +++ b/docs/reprod.md @@ -4,6 +4,8 @@ Before reproducing the bugs, please: - Check out to the `osdi-ae` branch by `git fetch origin && git checkout osdi-ae` - Ensure your local environment meets all the [requirements](https://github.com/sieve-project/sieve#requirements), and set `container_registry` in your `config.json` to `ghcr.io/sieve-project/action` (the default value). +**Note: after upgrading to Go 1.19 we are no longer able to build the version of cass-operator and elastic-operator used in our evaluation. To reproduce the bugs, please refer to [osdi-ae](https://github.com/sieve-project/sieve/tree/osdi-ae) branch as mentioned above.** + ## 31 intermediate-, stale-, and unobservable-state bugs Sieve can consistently reproduce all the 31 intermediate-, stale-, and unobservable-state bugs. diff --git a/evaluation_sanity_check/check.py b/evaluation_sanity_check/check.py index 36a60d199b9..ffae7f4e23e 100644 --- a/evaluation_sanity_check/check.py +++ b/evaluation_sanity_check/check.py @@ -52,7 +52,7 @@ def check_massive_testing_results(current_dir, previous_dir): def check_bug_reproduction_test_plans(): gen_configs = glob.glob( os.path.join( - "sieve_learn_results/*-controller/*/learn/learn.yaml/*/*.yaml", + "sieve_learn_results/*/*/learn/learn.yaml/*/*.yaml", ) ) diff --git a/examples/cass-operator/config.json b/examples/cass-operator/config.json index 91c1ad954e8..13ac4262dce 100644 --- a/examples/cass-operator/config.json +++ b/examples/cass-operator/config.json @@ -3,7 +3,6 @@ "github_link": "https://github.com/datastax/cass-operator.git", "commit": "dbd4f7a10533bb2298aed0d40ea20bfd8c133da2", "kubernetes_version": "v1.18.9", - "controller_runtime_version": "v0.5.2", "client_go_version": "v0.17.4", "dockerfile_path": "operator/docker/base/Dockerfile", "controller_image_name": "datastax/cass-operator:latest", @@ -11,6 +10,9 @@ "custom_resource_definitions": [ "cassandradatacenter" ], + "annotated_reconcile_functions": { + "operator/pkg/reconciliation/handler.go": "github.com/datastax/cass-operator/operator/pkg/reconciliation.(*ReconcileCassandraDatacenter).Reconcile" + }, "controller_pod_label": "cass-operator", "controller_deployment_file_path": "examples/cass-operator/deploy/controller-manifest.yaml", "test_setting": { diff --git a/examples/cassandra-operator/config.json b/examples/cassandra-operator/config.json index e63f3d47933..ffe59b1e777 100644 --- a/examples/cassandra-operator/config.json +++ b/examples/cassandra-operator/config.json @@ -6,7 +6,6 @@ "bd8077a478997f63862848d66d4912c59e4c46ff" ], "kubernetes_version": "v1.18.9", - "controller_runtime_version": "v0.4.0", "client_go_version": "v0.0.0-20190918160344-1fbdaa4c8d90", "dockerfile_path": "docker/cassandra-operator/Dockerfile", "controller_image_name": "cassandra-operator:latest", @@ -16,6 +15,9 @@ "cassandracluster", "cassandrabackup" ], + "annotated_reconcile_functions": { + "pkg/controller/cassandradatacenter/cassandradatacenter_controller.go": "github.com/instaclustr/cassandra-operator/pkg/controller/cassandradatacenter.(*ReconcileCassandraDataCenter).Reconcile" + }, "controller_pod_label": "cassandra-operator", "controller_deployment_file_path": "examples/cassandra-operator/deploy/bundle.yaml", "end_state_checker_mask": { diff --git a/examples/casskop-operator/config.json b/examples/casskop-operator/config.json index 58501f3dc57..a5eed2d5dbc 100644 --- a/examples/casskop-operator/config.json +++ b/examples/casskop-operator/config.json @@ -3,7 +3,6 @@ "github_link": "https://github.com/Orange-OpenSource/casskop.git", "commit": "f87c8e05c1a2896732fc5f3a174f1eb99e936907", "kubernetes_version": "v1.18.9", - "controller_runtime_version": "v0.6.0", "client_go_version": "v0.18.2", "dockerfile_path": "build/Dockerfile", "controller_image_name": "orangeopensource/casskop-operator:latest", @@ -13,6 +12,9 @@ "cassandrarestore", "cassandrabackup" ], + "annotated_reconcile_functions": { + "pkg/controller/cassandracluster/cassandracluster_controller.go": "github.com/Orange-OpenSource/casskop/pkg/controller/cassandracluster.(*ReconcileCassandraCluster).Reconcile" + }, "controller_pod_label": "casskop-operator", "controller_deployment_file_path": "examples/casskop-operator/deploy/values.yaml" } \ No newline at end of file diff --git a/examples/elastic-operator/config.json b/examples/elastic-operator/config.json index 1dd58c80f19..e1593928098 100644 --- a/examples/elastic-operator/config.json +++ b/examples/elastic-operator/config.json @@ -3,7 +3,6 @@ "github_link": "https://github.com/elastic/cloud-on-k8s.git", "commit": "660bc92fbfca469af552a833d8f6a4834c629649", "kubernetes_version": "v1.18.9", - "controller_runtime_version": "v0.11.0", "client_go_version": "v0.23.0", "dockerfile_path": "Dockerfile", "controller_image_name": "elastic/elastic-operator:latest", @@ -11,6 +10,9 @@ "custom_resource_definitions": [ "elasticsearch" ], + "annotated_reconcile_functions": { + "pkg/controller/elasticsearch/elasticsearch_controller.go": "github.com/elastic/cloud-on-k8s/pkg/controller/elasticsearch.(*ReconcileElasticsearch).Reconcile" + }, "controller_pod_label": "elastic-operator", "controller_deployment_file_path": "examples/elastic-operator/deploy/operator.yaml" } \ No newline at end of file diff --git a/examples/mongodb-operator/config.json b/examples/mongodb-operator/config.json index 056b4d02114..aac5d45b298 100644 --- a/examples/mongodb-operator/config.json +++ b/examples/mongodb-operator/config.json @@ -3,7 +3,6 @@ "github_link": "https://github.com/percona/percona-server-mongodb-operator.git", "commit": "c12b69e2c41efc67336a890039394250420f60bb", "kubernetes_version": "v1.18.9", - "controller_runtime_version": "v0.5.2", "client_go_version": "v0.17.2", "dockerfile_path": "build/Dockerfile", "controller_image_name": "percona/mongodb-operator:latest", @@ -13,6 +12,9 @@ "perconaservermongodbbackup", "perconaservermongodbrestore" ], + "annotated_reconcile_functions": { + "pkg/controller/perconaservermongodb/psmdb_controller.go": "github.com/percona/percona-server-mongodb-operator/pkg/controller/perconaservermongodb.(*ReconcilePerconaServerMongoDB).Reconcile" + }, "controller_pod_label": "mongodb-operator", "controller_deployment_file_path": "examples/mongodb-operator/deploy/bundle.yaml", "test_setting": { diff --git a/examples/nifikop-operator/config.json b/examples/nifikop-operator/config.json index 0a75ee41fdf..0f48afccd71 100644 --- a/examples/nifikop-operator/config.json +++ b/examples/nifikop-operator/config.json @@ -3,7 +3,6 @@ "github_link": "https://github.com/Orange-OpenSource/nifikop.git", "commit": "1546e0242107bf2f2c1256db50f47c79956dd1c6", "kubernetes_version": "v1.18.9", - "controller_runtime_version": "v0.7.2", "client_go_version": "v0.20.2", "dockerfile_path": "Dockerfile", "controller_image_name": "orangeopensource/nifikop-operator:latest", @@ -11,6 +10,9 @@ "custom_resource_definitions": [ "nificluster" ], + "annotated_reconcile_functions": { + "controllers/nificluster_controller.go": "github.com/Orange-OpenSource/nifikop/controllers.(*NifiClusterReconciler).Reconcile" + }, "controller_pod_label": "nifikop-operator", "controller_deployment_file_path": "examples/nifikop-operator/deploy/values.yaml", "end_state_checker_mask": { diff --git a/examples/rabbitmq-operator/config.json b/examples/rabbitmq-operator/config.json index ffc54d49c23..dceede8bac3 100644 --- a/examples/rabbitmq-operator/config.json +++ b/examples/rabbitmq-operator/config.json @@ -3,7 +3,6 @@ "github_link": "https://github.com/rabbitmq/cluster-operator.git", "commit": "4f13b9a942ad34fece0171d2174aa0264b10e947", "kubernetes_version": "v1.18.9", - "controller_runtime_version": "v0.8.3", "client_go_version": "v0.20.2", "dockerfile_path": "Dockerfile", "controller_image_name": "rabbitmq/rabbitmq-operator:latest", @@ -11,6 +10,9 @@ "custom_resource_definitions": [ "rabbitmqcluster" ], + "annotated_reconcile_functions": { + "controllers/rabbitmqcluster_controller.go": "github.com/rabbitmq/cluster-operator/controllers.(*RabbitmqClusterReconciler).Reconcile" + }, "controller_pod_label": "rabbitmq-operator", "controller_deployment_file_path": "examples/rabbitmq-operator/deploy/cluster-operator.yaml", "test_setting": { diff --git a/examples/xtradb-operator/config.json b/examples/xtradb-operator/config.json index 873eb67edbe..a99da92e901 100644 --- a/examples/xtradb-operator/config.json +++ b/examples/xtradb-operator/config.json @@ -3,7 +3,6 @@ "github_link": "https://github.com/percona/percona-xtradb-cluster-operator.git", "commit": "29092c9b145af6eaf5cbff534287483bec4167b6", "kubernetes_version": "v1.18.9", - "controller_runtime_version": "v0.6.2", "client_go_version": "v0.18.6", "dockerfile_path": "build/Dockerfile", "controller_image_name": "percona/xtradb-operator:latest", @@ -14,6 +13,9 @@ "perconaxtradbclusterrestore", "perconaxtradbbackup" ], + "annotated_reconcile_functions": { + "pkg/controller/pxc/controller.go": "github.com/percona/percona-xtradb-cluster-operator/pkg/controller/pxc.(*ReconcilePerconaXtraDBCluster).Reconcile" + }, "controller_pod_label": "xtradb-operator", "controller_deployment_file_path": "examples/xtradb-operator/deploy/bundle.yaml", "test_setting": { diff --git a/examples/yugabyte-operator/config.json b/examples/yugabyte-operator/config.json index 12230a4d2e1..ce41a11225f 100644 --- a/examples/yugabyte-operator/config.json +++ b/examples/yugabyte-operator/config.json @@ -3,7 +3,6 @@ "github_link": "https://github.com/yugabyte/yugabyte-operator.git", "commit": "966ef1978ed5d714119548b2c4343925fe49f882", "kubernetes_version": "v1.18.9", - "controller_runtime_version": "v0.5.2", "client_go_version": "v0.17.4", "apimachinery_version": "v0.17.4", "dockerfile_path": "build/Dockerfile", @@ -12,6 +11,9 @@ "custom_resource_definitions": [ "ybcluster" ], + "annotated_reconcile_functions": { + "pkg/controller/ybcluster/ybcluster_controller.go": "github.com/yugabyte/yugabyte-operator/pkg/controller/ybcluster.(*ReconcileYBCluster).Reconcile" + }, "controller_pod_label": "yugabyte-operator", "controller_deployment_file_path": "examples/yugabyte-operator/deploy/operator.yaml", "state_update_summary_checker_mask": { diff --git a/examples/zookeeper-operator/config.json b/examples/zookeeper-operator/config.json index ab3e4e95be8..785b2ecbb88 100644 --- a/examples/zookeeper-operator/config.json +++ b/examples/zookeeper-operator/config.json @@ -3,7 +3,6 @@ "github_link": "https://github.com/pravega/zookeeper-operator.git", "commit": "cda03d2f270bdfb51372192766123904f6d88278", "kubernetes_version": "v1.18.9", - "controller_runtime_version": "v0.5.2", "client_go_version": "v0.17.2", "dockerfile_path": "Dockerfile", "controller_image_name": "pravega/zookeeper-operator:latest", @@ -11,6 +10,9 @@ "custom_resource_definitions": [ "zookeepercluster" ], + "annotated_reconcile_functions": { + "pkg/controller/zookeepercluster/zookeepercluster_controller.go": "github.com/pravega/zookeeper-operator/pkg/controller/zookeepercluster.(*ReconcileZookeeperCluster).Reconcile" + }, "controller_pod_label": "zookeeper-operator", "controller_deployment_file_path": "examples/zookeeper-operator/deploy/default_ns/operator.yaml", "end_state_checker_mask": { diff --git a/gen_github_action.py b/gen_github_action.py index 686602a88e4..3b0c97e4fbc 100755 --- a/gen_github_action.py +++ b/gen_github_action.py @@ -6,10 +6,10 @@ from datetime import datetime operators_for_CI = { - "cass-operator": ["recreate", "scaledown-scaleup"], + # "cass-operator": ["recreate", "scaledown-scaleup"], "cassandra-operator": ["recreate", "scaledown-scaleup"], "casskop-operator": ["recreate", "scaledown-to-zero", "reducepdb"], - "elastic-operator": ["recreate", "scaledown-scaleup"], + # "elastic-operator": ["recreate", "scaledown-scaleup"], "mongodb-operator": [ "recreate", "scaleup-scaledown", @@ -78,7 +78,7 @@ def job_template(self_hosted): { "name": "Setup Go environment", "uses": "actions/setup-go@v2.1.3", - "with": {"go-version": 1.15}, + "with": {"go-version": 1.19}, }, { "name": "Setup Python", @@ -95,12 +95,12 @@ def job_template(self_hosted): }, { "name": "Install Kind", - "run": 'GO111MODULE="on" go get sigs.k8s.io/kind@v0.13.0\nkind', - }, - { - "name": "Install Mage", - "run": "go get -u github.com/magefile/mage\nmage -h", + "run": 'GO111MODULE="on" go install sigs.k8s.io/kind@v0.13.0\nkind', }, + # { + # "name": "Install Mage", + # "run": "go get -u github.com/magefile/mage\nmage -h", + # }, { "name": "Install Helm", "run": "wget https://get.helm.sh/helm-v3.6.0-linux-amd64.tar.gz\ntar -zxvf helm-v3.6.0-linux-amd64.tar.gz\nsudo mv linux-amd64/helm /usr/local/bin/helm\nhelm", @@ -154,9 +154,9 @@ def generate_controller_image_build_jobs(self_hosted): for operator in operators_for_CI: job = job_template(self_hosted) build_modes = [ - "learn", - "test", - "vanilla", + sieve_modes.LEARN, + sieve_modes.TEST, + sieve_modes.VANILLA, ] build_image = [ { @@ -223,8 +223,8 @@ def generate_test_jobs(self_hosted): for operator in operators_for_CI: job = job_template(self_hosted) build_modes = [ - "learn", - "test", + sieve_modes.LEARN, + sieve_modes.TEST, sieve_modes.VANILLA, ] workload_set = set(operators_for_CI[operator]) diff --git a/go.work.sum b/go.work.sum index d452ee4163a..f35a3af5d4f 100644 --- a/go.work.sum +++ b/go.work.sum @@ -3,8 +3,16 @@ github.com/evanphx/json-patch v4.9.0+incompatible h1:kLcOMZeuLAJvL2BPWLMIj5oaZQo github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I= github.com/go-logr/logr v0.1.0 h1:M1Tv3VzNlEHg6uyACnRdtrploV2P7wZqH8BoQMtz0cg= github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e h1:1r7pUrabqp18hOBcwBwiTsbnFeTZHV9eER/QT5JVZxY= +github.com/google/uuid v1.1.1 h1:Gkbcsh/GbpXz7lPftLA3P6TYMwjCLYm83jiFQZF/3gY= +github.com/hashicorp/golang-lru v0.5.1 h1:0hERBMJE1eitiLkihrMvRVBYAkpHzc/J3QdDN+dAcgU= github.com/hpcloud/tail v1.0.0 h1:nfCOvKYfkgYP8hkirhJocXT2+zOD8yUNjXaWfTlyFKI= github.com/onsi/ginkgo v1.11.0 h1:JAKSXpt1YjtLA7YpPiqO9ss6sNXEsPfSGdwN0UHqzrw= +github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= +github.com/stretchr/objx v0.5.0 h1:1zr/of2m5FGMsad5YfcqgdqdWrIhu+EBEJRhR1U7z/c= +golang.org/x/crypto v0.0.0-20210921155107-089bfa567519 h1:7I4JAnoQBe7ZtJcBaYHi5UtiO8tQHbUSXxL+pnGRANg= +golang.org/x/net v0.3.0 h1:VWL6FNY2bEEmsGVKabSlHu5Irp34xmMRoqb/9lF9lxk= +golang.org/x/term v0.3.0 h1:qoo4akIqOcDME5bhc/NgxUdovd6BSS2uMsVjB56q1xI= +golang.org/x/text v0.5.0 h1:OLmvp0KP+FVG99Ct/qFiL/Fhk4zp4QQnZ7b2U+5piUM= golang.org/x/tools v0.0.0-20200825202427-b303f430e36d h1:W07d4xkoAUSNOkOzdzXCdFGxT7o2rW4q8M34tB2i//k= gopkg.in/fsnotify.v1 v1.4.7 h1:xOHLXZwVvI9hhs+cLKq5+I5onOuwQLhQwiu63xxlHs4= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= diff --git a/sieve.py b/sieve.py index eec7df0b343..4c8434294e5 100644 --- a/sieve.py +++ b/sieve.py @@ -285,19 +285,14 @@ def setup_cluster(test_context: TestContext): or test_context.mode == sieve_modes.GEN_ORACLE ): print("Test plan: {}".format(test_context.test_plan)) - generate_learn_plan( - test_context.test_plan, - test_context.controller_config.custom_resource_definitions, - ) + generate_plan_for_learn_mode(test_context) elif test_context.mode == sieve_modes.VANILLA: print("Test plan: {}".format(test_context.test_plan)) - generate_vanilla_plan(test_context.test_plan) + generate_plan_for_vanilla_mode(test_context) else: assert test_context.mode == sieve_modes.TEST print("Test plan: {}".format(test_context.test_plan)) - os_system( - "cp {} {}".format(test_context.original_test_plan, test_context.test_plan) - ) + generate_plan_for_test_mode(test_context) # when testing stale-state, we need to pause the apiserver # if workers talks to the paused apiserver, the whole cluster will be slowed down @@ -585,18 +580,30 @@ def run_test(test_context: TestContext) -> TestResult: ) -def generate_learn_plan(learn_plan, crd_list): - learn_plan_map = {} - learn_plan_map["crdList"] = crd_list +def generate_plan_for_test_mode(test_context: TestContext): + test_plan_content = yaml.load(open(test_context.original_test_plan)) + test_plan_content["annotatedReconcileStackFrame"] = [ + i for i in test_context.controller_config.annotated_reconcile_functions.values() + ] + yaml.dump(test_plan_content, open(test_context.test_plan, "w"), sort_keys=False) + + +def generate_plan_for_learn_mode(test_context: TestContext): + crd_list = test_context.controller_config.custom_resource_definitions + learn_plan_content = {} + learn_plan_content["crdList"] = crd_list # hardcode rate limiter to disabled for now - learn_plan_map["rateLimiterEnabled"] = False - learn_plan_map["rateLimiterInterval"] = 3 - yaml.dump(learn_plan_map, open(learn_plan, "w"), sort_keys=False) + learn_plan_content["rateLimiterEnabled"] = False + learn_plan_content["rateLimiterInterval"] = 3 + learn_plan_content["annotatedReconcileStackFrame"] = [ + i for i in test_context.controller_config.annotated_reconcile_functions.values() + ] + yaml.dump(learn_plan_content, open(test_context.test_plan, "w"), sort_keys=False) -def generate_vanilla_plan(vanilla_plan): - vanilla_plan_map = {} - yaml.dump(vanilla_plan_map, open(vanilla_plan, "w"), sort_keys=False) +def generate_plan_for_vanilla_mode(test_context: TestContext): + vanilla_plan_content = {} + yaml.dump(vanilla_plan_content, open(test_context.test_plan, "w"), sort_keys=False) def get_test_workload_from_test_plan(test_plan_file): diff --git a/sieve_analyzer/analyze.py b/sieve_analyzer/analyze.py index 8dfc95ac98f..c1c2ef0e356 100644 --- a/sieve_analyzer/analyze.py +++ b/sieve_analyzer/analyze.py @@ -41,24 +41,23 @@ def sanity_check_sieve_log(path): assert operator_hear_id in operator_hear_status, line operator_hear_status[operator_hear_id] += 1 elif SIEVE_BEFORE_RECONCILE_MARK in line: - reconciler_type = parse_reconcile(line).reconciler_type - if reconciler_type not in reconcile_status: - reconcile_status[reconciler_type] = 0 - reconcile_status[reconciler_type] += 1 - assert reconcile_status[reconciler_type] == 1, line + reconcile_fun = parse_reconcile(line).reconcile_fun + if reconcile_fun not in reconcile_status: + reconcile_status[reconcile_fun] = 0 + reconcile_status[reconcile_fun] += 1 + assert reconcile_status[reconcile_fun] == 1, line elif SIEVE_AFTER_RECONCILE_MARK in line: - reconciler_type = parse_reconcile(line).reconciler_type - assert reconciler_type in reconcile_status, line - reconcile_status[reconciler_type] -= 1 - assert reconcile_status[reconciler_type] == 0, line + reconcile_fun = parse_reconcile(line).reconcile_fun + assert reconcile_fun in reconcile_status, line + reconcile_status[reconcile_fun] -= 1 + assert reconcile_status[reconcile_fun] == 0, line for key in operator_write_status: assert operator_write_status[key] == 1 or operator_write_status[key] == 2 for key in operator_hear_status: assert operator_hear_status[key] == 1 or operator_hear_status[key] == 2 for key in reconcile_status: assert ( - reconcile_status[reconciler_type] == 0 - or reconcile_status[reconciler_type] == 1 + reconcile_status[reconcile_fun] == 0 or reconcile_status[reconcile_fun] == 1 ) @@ -103,7 +102,7 @@ def parse_reconciler_events(test_context: TestContext, path): # we need to record all the ongoing controllers # there could be multiple workers running for a single controller # so we need to count each worker for each controller - # ongoing_reconcile = { reconciler_type -> number of ongoing workers for this controller } + # ongoing_reconcile = { reconcile_fun -> number of ongoing workers for this controller } ongoing_reconciles = {} lines = open(path).readlines() for i in range(len(lines)): @@ -118,7 +117,7 @@ def parse_reconciler_events(test_context: TestContext, path): # though it should not happen at all. # TODO: handle the writes that are not in any reconcile operator_write = parse_operator_write(line) - if operator_write.reconciler_type not in cur_reconcile_per_type: + if operator_write.reconcile_fun not in cur_reconcile_per_type: if not test_context.controller_config.loosen_reconciler_boundary: continue # Do deepcopy here to ensure the later changes to the two sets @@ -130,9 +129,9 @@ def parse_reconciler_events(test_context: TestContext, path): operator_write.id ] operator_write.end_timestamp = i - if operator_write.reconciler_type in cur_reconcile_per_type: - prev_reconcile = prev_reconcile_per_type[operator_write.reconciler_type] - cur_reconcile = cur_reconcile_per_type[operator_write.reconciler_type] + if operator_write.reconcile_fun in cur_reconcile_per_type: + prev_reconcile = prev_reconcile_per_type[operator_write.reconcile_fun] + cur_reconcile = cur_reconcile_per_type[operator_write.reconcile_fun] earliest_timestamp = -1 if prev_reconcile is not None: earliest_timestamp = prev_reconcile.end_timestamp @@ -146,20 +145,18 @@ def parse_reconciler_events(test_context: TestContext, path): for key in cur_reconcile_is_trivial: cur_reconcile_is_trivial[key] = False operator_nk_write = parse_operator_non_k8s_write(line) - if operator_nk_write.reconciler_type not in cur_reconcile_per_type: + if operator_nk_write.reconcile_fun not in cur_reconcile_per_type: if not test_context.controller_config.loosen_reconciler_boundary: continue operator_nk_write.start_timestamp = operator_nk_write_start_timestamp_map[ operator_nk_write.id ] operator_nk_write.end_timestamp = i - if operator_nk_write.reconciler_type in cur_reconcile_per_type: + if operator_nk_write.reconcile_fun in cur_reconcile_per_type: prev_reconcile = prev_reconcile_per_type[ - operator_nk_write.reconciler_type - ] - cur_reconcile = cur_reconcile_per_type[ - operator_nk_write.reconciler_type + operator_nk_write.reconcile_fun ] + cur_reconcile = cur_reconcile_per_type[operator_nk_write.reconcile_fun] earliest_timestamp = -1 if prev_reconcile is not None: earliest_timestamp = prev_reconcile.end_timestamp @@ -170,10 +167,10 @@ def parse_reconciler_events(test_context: TestContext, path): elif SIEVE_AFTER_CACHE_READ_MARK in line: # TODO: handle the reads that are not in any reconcile operator_read = parse_operator_read(line) - if operator_read.reconciler_type not in cur_reconcile_per_type: + if operator_read.reconcile_fun not in cur_reconcile_per_type: continue operator_read.end_timestamp = i - cur_reconcile = cur_reconcile_per_type[operator_read.reconciler_type] + cur_reconcile = cur_reconcile_per_type[operator_read.reconcile_fun] operator_read.reconcile_id = cur_reconcile.reconcile_id ts_to_event_map[operator_read.end_timestamp] = operator_read if operator_read.etype == "Get": @@ -184,39 +181,39 @@ def parse_reconciler_events(test_context: TestContext, path): reconcile_begin = parse_reconcile(line) reconcile_begin.end_timestamp = i ts_to_event_map[reconcile_begin.end_timestamp] = reconcile_begin - reconciler_type = reconcile_begin.reconciler_type - if reconciler_type not in ongoing_reconciles: - ongoing_reconciles[reconciler_type] = 1 + reconcile_fun = reconcile_begin.reconcile_fun + if reconcile_fun not in ongoing_reconciles: + ongoing_reconciles[reconcile_fun] = 1 else: - ongoing_reconciles[reconciler_type] += 1 + ongoing_reconciles[reconcile_fun] += 1 # let's assume there should be only one worker for each controller here - assert ongoing_reconciles[reconciler_type] == 1 - if reconciler_type not in cur_reconcile_per_type: - prev_reconcile_per_type[reconciler_type] = None - cur_reconcile_per_type[reconciler_type] = reconcile_begin + assert ongoing_reconciles[reconcile_fun] == 1 + if reconcile_fun not in cur_reconcile_per_type: + prev_reconcile_per_type[reconcile_fun] = None + cur_reconcile_per_type[reconcile_fun] = reconcile_begin else: if not test_context.common_config.compress_trivial_reconcile_enabled: - prev_reconcile_per_type[reconciler_type] = cur_reconcile_per_type[ - reconciler_type + prev_reconcile_per_type[reconcile_fun] = cur_reconcile_per_type[ + reconcile_fun ] - cur_reconcile_per_type[reconciler_type] = reconcile_begin + cur_reconcile_per_type[reconcile_fun] = reconcile_begin elif ( test_context.common_config.compress_trivial_reconcile_enabled - and not cur_reconcile_is_trivial[reconciler_type] + and not cur_reconcile_is_trivial[reconcile_fun] ): - prev_reconcile_per_type[reconciler_type] = cur_reconcile_per_type[ - reconciler_type + prev_reconcile_per_type[reconcile_fun] = cur_reconcile_per_type[ + reconcile_fun ] - cur_reconcile_per_type[reconciler_type] = reconcile_begin - cur_reconcile_is_trivial[reconciler_type] = True + cur_reconcile_per_type[reconcile_fun] = reconcile_begin + cur_reconcile_is_trivial[reconcile_fun] = True elif SIEVE_AFTER_RECONCILE_MARK in line: reconcile_end = parse_reconcile(line) reconcile_end.end_timestamp = i ts_to_event_map[reconcile_end.end_timestamp] = reconcile_end - reconciler_type = reconcile_end.reconciler_type - ongoing_reconciles[reconciler_type] -= 1 - if ongoing_reconciles[reconciler_type] == 0: - del ongoing_reconciles[reconciler_type] + reconcile_fun = reconcile_end.reconcile_fun + ongoing_reconciles[reconcile_fun] -= 1 + if ongoing_reconciles[reconcile_fun] == 0: + del ongoing_reconciles[reconcile_fun] # Clear the read keys and types set since all the ongoing reconciles are done if len(ongoing_reconciles) == 0: read_keys_this_reconcile = set() diff --git a/sieve_analyzer/event_graph.py b/sieve_analyzer/event_graph.py index ada0169209a..ad5fa3ca509 100644 --- a/sieve_analyzer/event_graph.py +++ b/sieve_analyzer/event_graph.py @@ -448,8 +448,7 @@ def compute_event_diff(self): operator_read.end_timestamp < operator_write.start_timestamp ) if ( - operator_read.reconciler_type - == operator_write.reconciler_type + operator_read.reconcile_fun == operator_write.reconcile_fun and operator_read.reconcile_id == operator_write.reconcile_id ): diff --git a/sieve_client/common.go b/sieve_client/common.go index f5bb517a70a..0efc2433711 100644 --- a/sieve_client/common.go +++ b/sieve_client/common.go @@ -19,10 +19,10 @@ import ( const LEARN string = "learn" const TEST string = "test" -const UNKNOWN_RECONCILER_TYPE = "Unknown" +const UNKNOWN_RECONCILE_FUN = "Unknown" -// TODO(xudong): make SIEVE_SERVER_ADDR configurable -const SIEVE_SERVER_ADDR string = "kind-control-plane:12345" +// TODO(xudong): make DEFAULT_SIEVE_SERVER_ADDR configurable +const DEFAULT_SIEVE_SERVER_ADDR string = "kind-control-plane:12345" const HTTP_GET string = "GET" const HTTP_POST string = "POST" @@ -48,6 +48,10 @@ var configLoadingLock sync.Mutex var triggerDefinitionsByResourceKey map[string][]map[interface{}]interface{} = make(map[string][]map[interface{}]interface{}) var triggerDefinitionsByAnnotatedAPI map[string][]map[interface{}]interface{} = make(map[string][]map[interface{}]interface{}) var actions map[string][]map[interface{}]interface{} = make(map[string][]map[interface{}]interface{}) +var annotatedReconcileFunctions = make(map[string]interface{}) +var sieveServerAddr string = "" +var crds []string + var apiserverHostname string = "" var rpcClient *rpc.Client = nil @@ -248,7 +252,42 @@ func loadActions(action map[interface{}]interface{}) error { return nil } -func loadActionsAndTriggers(testPlan map[string]interface{}) error { +func loadSieveServerAddr(plan map[string]interface{}) error { + if val, ok := plan["sieveServerAddr"]; ok { + sieveServerAddr = val.(string) + } else { + sieveServerAddr = DEFAULT_SIEVE_SERVER_ADDR + } + return nil +} + +func loadReconcileFuns(learnPlan map[string]interface{}) error { + if cs, ok := learnPlan["annotatedReconcileStackFrame"]; ok { + switch v := cs.(type) { + case []interface{}: + for _, c := range v { + annotatedReconcileFunctions[c.(string)] = exists + } + case []string: + for _, c := range v { + annotatedReconcileFunctions[c] = exists + } + default: + return fmt.Errorf("annotatedReconcileStackFrame wrong type") + } + } else { + return fmt.Errorf("not find annotatedReconcileStackFrame from config") + } + return nil +} + +func loadTestPlan(testPlan map[string]interface{}) error { + if err := loadSieveServerAddr(testPlan); err != nil { + return err + } + if err := loadReconcileFuns(testPlan); err != nil { + return err + } actions, ok := testPlan["actions"].([]interface{}) if !ok { return fmt.Errorf("cannot convert testPlan[\"actions\"] to []interface{}") @@ -275,6 +314,38 @@ func loadActionsAndTriggers(testPlan map[string]interface{}) error { return nil } +func loadCRDs(learnPlan map[string]interface{}) error { + crds = []string{} + if cs, ok := learnPlan["crdList"]; ok { + switch v := cs.(type) { + case []interface{}: + for _, c := range v { + crds = append(crds, c.(string)) + } + case []string: + crds = append(crds, v...) + default: + return fmt.Errorf("crdList wrong type") + } + } else { + return fmt.Errorf("not find crdList from config") + } + return nil +} + +func loadLearnPlan(learnPlan map[string]interface{}) error { + if err := loadCRDs(learnPlan); err != nil { + return err + } + if err := loadReconcileFuns(learnPlan); err != nil { + return err + } + if err := loadSieveServerAddr(learnPlan); err != nil { + return err + } + return nil +} + func loadSieveConfigFromEnv(testMode bool) error { if config != nil { return nil @@ -295,10 +366,17 @@ func loadSieveConfigFromEnv(testMode bool) error { log.Printf("config from env:\n%v\n", configFromEnv) config = configFromEnv if testMode { - err = loadActionsAndTriggers(configFromEnv) + err = loadTestPlan(configFromEnv) + if err != nil { + printConfigError(err) + log.Println("failure in loadTestPlan") + return nil + } + } else { + err = loadLearnPlan(configFromEnv) if err != nil { printConfigError(err) - log.Println("failure in loadActionsAndTriggers") + log.Println("failure in loadLearnPlan") return nil } } @@ -349,10 +427,17 @@ func loadSieveConfigFromConfigMap(eventType, key string, object interface{}, tes log.Printf("config from configMap:\n%v\n", configFromConfigMapData) config = configFromConfigMapData if testMode { - err = loadActionsAndTriggers(configFromConfigMapData) + err = loadTestPlan(configFromConfigMapData) + if err != nil { + printConfigError(err) + log.Println("failure in loadTestPlan") + return nil + } + } else { + err = loadLearnPlan(configFromConfigMapData) if err != nil { printConfigError(err) - log.Println("failure in loadActionsAndTriggers") + log.Println("failure in loadLearnPlan") return nil } } @@ -400,39 +485,15 @@ func initRPCClient() error { return nil } var err error - hostPort := SIEVE_SERVER_ADDR - if val, ok := config["serverEndpoint"]; ok { - hostPort = val.(string) - } - rpcClient, err = rpc.Dial("tcp", hostPort) + rpcServerAddr := sieveServerAddr + rpcClient, err = rpc.Dial("tcp", rpcServerAddr) if err != nil { - log.Printf("error in setting up connection to %s due to %v\n", hostPort, err) + log.Printf("error in setting up connection to %s due to %v\n", rpcServerAddr, err) return err } return nil } -func getCRDs() []string { - crds := []string{} - if cs, ok := config["crdList"]; ok { - switch v := cs.(type) { - case []interface{}: - for _, c := range v { - crds = append(crds, c.(string)) - } - case []string: - for _, c := range v { - crds = append(crds, c) - } - default: - log.Println("crdList wrong type") - } - } else { - log.Println("do not find crdList from config") - } - return crds -} - func checkResponse(response Response) { if !response.Ok { log.Printf("Sieve client receives bad response: %s\n", response.Message) @@ -478,53 +539,18 @@ func extractNameNamespaceFromObj(object interface{}) (string, string) { return "", "" } -func isSameObjectClientSide(object interface{}, namespace string, name string) bool { - extractedName, extractedNamespace := extractNameNamespaceFromObj(object) - return extractedNamespace == namespace && extractedName == name -} - -func getReconcilerFromStackTrace() string { - // reflect.TypeOf(c.Do).String(): *controllers.NifiClusterTaskReconciler - stacktrace := string(debug.Stack()) - // log.Println(stacktrace) - stacks := strings.Split(stacktrace, "\n") - var stacksPruned []string - for _, stack := range stacks { - if !strings.HasPrefix(stack, "\t") { - stacksPruned = append(stacksPruned, stack) +func getMatchedReconcileStackFrame() string { + for _, stackframe := range strings.Split(string(debug.Stack()), "\n") { + if strings.HasPrefix(stackframe, "\t") { + continue } - } - reconcilerType := "" - for i := range stacksPruned { - // We parse the stacktrace from bottom - index := len(stacksPruned) - 1 - i - stack := stacksPruned[index] - if strings.HasPrefix(stack, "sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).reconcileHandler(") { - if index > 0 { - upper_stack := stacksPruned[index-1] - if strings.HasPrefix(upper_stack, "sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Reconcile(") { - if index > 1 { - upper_upper_stack := stacksPruned[index-2] - if strings.Contains(upper_upper_stack, ".Reconcile(") && !strings.HasPrefix(upper_upper_stack, "sigs.k8s.io/controller-runtime/") { - reconcilerType = upper_upper_stack[:strings.Index(upper_upper_stack, ".Reconcile(")] - break - } else { - break - } - } - } else if strings.Contains(upper_stack, ".Reconcile(") && !strings.HasPrefix(upper_stack, "sigs.k8s.io/controller-runtime/") { - reconcilerType = upper_stack[:strings.Index(upper_stack, ".Reconcile(")] - break - } else { - break - } + for annotatedReconcileFun := range annotatedReconcileFunctions { + if strings.HasPrefix(stackframe, annotatedReconcileFun+"(") { + return annotatedReconcileFun } } } - if reconcilerType == "" { - reconcilerType = UNKNOWN_RECONCILER_TYPE - } - return reconcilerType + return UNKNOWN_RECONCILE_FUN } func getResourceNamespaceNameFromAPIKey(key string) (string, string, error) { diff --git a/sieve_client/learn_client.go b/sieve_client/learn_client.go index 65960251657..cefe14fbf81 100644 --- a/sieve_client/learn_client.go +++ b/sieve_client/learn_client.go @@ -2,9 +2,7 @@ package sieve import ( "encoding/json" - "fmt" "log" - "reflect" "strings" "k8s.io/apimachinery/pkg/api/errors" @@ -21,7 +19,6 @@ func isCRD(rType string, crds []string) bool { } func triggerReconcile(object interface{}) bool { - crds := getCRDs() rType := getResourceTypeFromObj(object) if isCRD(rType, crds) { return true @@ -95,16 +92,16 @@ func NotifyLearnAfterControllerRecv(recvID int, operationType string, object int checkResponse(response) } -func NotifyLearnBeforeReconcile(reconciler interface{}) { +func NotifyLearnBeforeReconcile(stackFrame string) { if err := loadSieveConfigFromEnv(false); err != nil { return } if err := initRPCClient(); err != nil { return } - reconcilerName := fmt.Sprintf("%s.(*%s)", reflect.TypeOf(reconciler).Elem().PkgPath(), reflect.TypeOf(reconciler).Elem().Name()) + log.Printf("NotifyLearnBeforeReconcile %s", stackFrame) request := &NotifyLearnBeforeReconcileRequest{ - ReconcilerName: reconcilerName, + ReconcilerName: stackFrame, } var response Response err := rpcClient.Call("LearnListener.NotifyLearnBeforeReconcile", request, &response) @@ -115,16 +112,16 @@ func NotifyLearnBeforeReconcile(reconciler interface{}) { checkResponse(response) } -func NotifyLearnAfterReconcile(reconciler interface{}) { +func NotifyLearnAfterReconcile(stackFrame string) { if err := loadSieveConfigFromEnv(false); err != nil { return } if err := initRPCClient(); err != nil { return } - reconcilerName := fmt.Sprintf("%s.(*%s)", reflect.TypeOf(reconciler).Elem().PkgPath(), reflect.TypeOf(reconciler).Elem().Name()) + log.Printf("NotifyLearnBeforeReconcile %s", stackFrame) request := &NotifyLearnBeforeReconcileRequest{ - ReconcilerName: reconcilerName, + ReconcilerName: stackFrame, } var response Response err := rpcClient.Call("LearnListener.NotifyLearnAfterReconcile", request, &response) @@ -145,8 +142,8 @@ func NotifyLearnAfterCacheGet(key string, item interface{}, exists bool) { if err := initRPCClient(); err != nil { return } - reconcilerType := getReconcilerFromStackTrace() - if reconcilerType == UNKNOWN_RECONCILER_TYPE { + reconcileFun := getMatchedReconcileStackFrame() + if reconcileFun == UNKNOWN_RECONCILE_FUN { return } serializedObj, err := json.Marshal(item) @@ -166,12 +163,12 @@ func NotifyLearnAfterCacheGet(key string, item interface{}, exists bool) { name := tokens[1] log.Printf("NotifyLearnAfterCacheGet %s %s %s %s", resourceType, namespace, name, string(serializedObj)) request := &NotifyLearnAfterCacheGetRequest{ - ResourceType: resourceType, - Namespace: namespace, - Name: name, - Object: string(serializedObj), - ReconcilerType: reconcilerType, - Error: NO_ERROR, + ResourceType: resourceType, + Namespace: namespace, + Name: name, + Object: string(serializedObj), + ReconcileFun: reconcileFun, + Error: NO_ERROR, } var response Response err = rpcClient.Call("LearnListener.NotifyLearnAfterCacheGet", request, &response) @@ -192,8 +189,8 @@ func NotifyLearnAfterCacheList(items []interface{}, listErr error) { if err := initRPCClient(); err != nil { return } - reconcilerType := getReconcilerFromStackTrace() - if reconcilerType == UNKNOWN_RECONCILER_TYPE { + reconcileFun := getMatchedReconcileStackFrame() + if reconcileFun == UNKNOWN_RECONCILE_FUN { return } serializedObjList, err := json.Marshal(items) @@ -210,10 +207,10 @@ func NotifyLearnAfterCacheList(items []interface{}, listErr error) { resourceType := getResourceTypeFromObj(items[0]) log.Printf("NotifyLearnAfterCacheList %s %s", resourceType, string(serializedObjList)) request := &NotifyLearnAfterCacheListRequest{ - ResourceType: resourceType, - ObjectList: string(serializedObjList), - ReconcilerType: reconcilerType, - Error: NO_ERROR, + ResourceType: resourceType, + ObjectList: string(serializedObjList), + ReconcileFun: reconcileFun, + Error: NO_ERROR, } var response Response err = rpcClient.Call("LearnListener.NotifyLearnAfterCacheList", request, &response) @@ -225,14 +222,15 @@ func NotifyLearnAfterCacheList(items []interface{}, listErr error) { } func NotifyLearnBeforeRestCall(verb string, pathPrefix string, subpath string, namespace string, namespaceSet bool, resourceType string, resourceName string, subresource string, object interface{}) int { + log.Printf("NotifyLearnBeforeRestCall") if err := loadSieveConfigFromEnv(false); err != nil { return -1 } if err := initRPCClient(); err != nil { return -1 } - reconcilerType := getReconcilerFromStackTrace() - if reconcilerType == UNKNOWN_RECONCILER_TYPE { + reconcileFun := getMatchedReconcileStackFrame() + if reconcileFun == UNKNOWN_RECONCILE_FUN { return -1 } controllerOperationType := HttpVerbToControllerOperation(verb, resourceName, subresource) @@ -265,6 +263,8 @@ func NotifyLearnBeforeRestCall(verb string, pathPrefix string, subpath string, n } func NotifyLearnAfterRestCall(controllerOperationID int, verb string, pathPrefix string, subpath string, namespace string, namespaceSet bool, resourceType string, resourceName string, subresource string, object interface{}, serializationErr error, respErr error) { + log.Printf("NotifyLearnAfterRestCall") + if err := loadSieveConfigFromEnv(false); err != nil { return } @@ -277,8 +277,8 @@ func NotifyLearnAfterRestCall(controllerOperationID int, verb string, pathPrefix if err := initRPCClient(); err != nil { return } - reconcilerType := getReconcilerFromStackTrace() - if reconcilerType == UNKNOWN_RECONCILER_TYPE { + reconcileFun := getMatchedReconcileStackFrame() + if reconcileFun == UNKNOWN_RECONCILE_FUN { return } serializedObj, err := json.Marshal(object) @@ -299,7 +299,7 @@ func NotifyLearnAfterRestCall(controllerOperationID int, verb string, pathPrefix request := &NotifyLearnAfterRestWriteRequest{ ControllerOperationID: controllerOperationID, ControllerOperationType: controllerOperationType, - ReconcilerType: reconcilerType, + ReconcileFun: reconcileFun, ResourceType: pluralToSingular(resourceType), Namespace: namespace, Name: resourceName, @@ -323,13 +323,13 @@ func NotifyLearnBeforeAnnotatedAPICall(moduleName string, filePath string, recei if err := initRPCClient(); err != nil { return -1 } - reconcilerType := getReconcilerFromStackTrace() + reconcileFun := getMatchedReconcileStackFrame() request := &NotifyLearnBeforeAnnotatedAPICallRequest{ - ModuleName: moduleName, - FilePath: filePath, - ReceiverType: receiverType, - FunName: funName, - ReconcilerType: reconcilerType, + ModuleName: moduleName, + FilePath: filePath, + ReceiverType: receiverType, + FunName: funName, + ReconcileFun: reconcileFun, } var response Response err := rpcClient.Call("LearnListener.NotifyLearnBeforeAnnotatedAPICall", request, &response) @@ -351,14 +351,14 @@ func NotifyLearnAfterAnnotatedAPICall(invocationID int, moduleName string, fileP if err := initRPCClient(); err != nil { return } - reconcilerType := getReconcilerFromStackTrace() + reconcileFun := getMatchedReconcileStackFrame() request := &NotifyLearnAfterAnnotatedAPICallRequest{ - InvocationID: invocationID, - ModuleName: moduleName, - FilePath: filePath, - ReceiverType: receiverType, - FunName: funName, - ReconcilerType: reconcilerType, + InvocationID: invocationID, + ModuleName: moduleName, + FilePath: filePath, + ReceiverType: receiverType, + FunName: funName, + ReconcileFun: reconcileFun, } var response Response err := rpcClient.Call("LearnListener.NotifyLearnAfterAnnotatedAPICall", request, &response) diff --git a/sieve_client/test_client.go b/sieve_client/test_client.go index 86dbb24f42c..5269afaa264 100644 --- a/sieve_client/test_client.go +++ b/sieve_client/test_client.go @@ -80,8 +80,8 @@ func NotifyTestBeforeCacheGet(key string, items []interface{}) { if err := initRPCClient(); err != nil { return } - reconcilerType := getReconcilerFromStackTrace() - if reconcilerType == UNKNOWN_RECONCILER_TYPE { + reconcileFun := getMatchedReconcileStackFrame() + if reconcileFun == UNKNOWN_RECONCILE_FUN { return } if len(items) == 0 { @@ -102,8 +102,8 @@ func NotifyTestAfterCacheGet(key string, item interface{}, exists bool) { if !exists { return } - reconcilerType := getReconcilerFromStackTrace() - if reconcilerType == UNKNOWN_RECONCILER_TYPE { + reconcileFun := getMatchedReconcileStackFrame() + if reconcileFun == UNKNOWN_RECONCILE_FUN { return } resourceKey := path.Join(getResourceTypeFromObj(item), key) @@ -116,14 +116,14 @@ func NotifyTestAfterCacheGet(key string, item interface{}, exists bool) { if !checkKVPairInTriggerObservationPoint(resourceKey, "when", "afterControllerWrite", false) { return } - if !checkKVPairInTriggerObservationPoint(resourceKey, "by", reconcilerType, false) { + if !checkKVPairInTriggerObservationPoint(resourceKey, "by", reconcileFun, false) { return } log.Printf("NotifyTestAfterCacheGet %s %s", resourceKey, string(serializedObj)) request := &NotifyTestAfterControllerGetRequest{ - ResourceKey: resourceKey, - ReconcilerType: reconcilerType, - Object: string(serializedObj), + ResourceKey: resourceKey, + ReconcileFun: reconcileFun, + Object: string(serializedObj), } var response Response err = rpcClient.Call("TestCoordinator.NotifyTestAfterControllerGet", request, &response) @@ -141,8 +141,8 @@ func NotifyTestBeforeCacheList(items []interface{}) { if err := initRPCClient(); err != nil { return } - reconcilerType := getReconcilerFromStackTrace() - if reconcilerType == UNKNOWN_RECONCILER_TYPE { + reconcileFun := getMatchedReconcileStackFrame() + if reconcileFun == UNKNOWN_RECONCILE_FUN { return } if len(items) == 0 { @@ -166,8 +166,8 @@ func NotifyTestAfterCacheList(items []interface{}, listErr error) { if len(items) == 0 { return } - reconcilerType := getReconcilerFromStackTrace() - if reconcilerType == UNKNOWN_RECONCILER_TYPE { + reconcileFun := getMatchedReconcileStackFrame() + if reconcileFun == UNKNOWN_RECONCILE_FUN { return } serializedObjList, err := json.Marshal(items) @@ -180,14 +180,14 @@ func NotifyTestAfterCacheList(items []interface{}, listErr error) { if !checkKVPairInTriggerObservationPoint(resourceType, "when", "afterControllerWrite", true) { return } - if !checkKVPairInTriggerObservationPoint(resourceType, "by", reconcilerType, true) { + if !checkKVPairInTriggerObservationPoint(resourceType, "by", reconcileFun, true) { return } log.Printf("NotifyTestAfterCacheList %s %s", resourceType, string(serializedObjList)) request := &NotifyTestAfterControllerListRequest{ - ResourceType: resourceType, - ReconcilerType: reconcilerType, - ObjectList: string(serializedObjList), + ResourceType: resourceType, + ReconcileFun: reconcileFun, + ObjectList: string(serializedObjList), } var response Response err = rpcClient.Call("TestCoordinator.NotifyTestAfterControllerList", request, &response) @@ -289,8 +289,8 @@ func NotifyTestBeforeRestCall(verb string, pathPrefix string, subpath string, na if err := initRPCClient(); err != nil { return 1 } - reconcilerType := getReconcilerFromStackTrace() - if reconcilerType == UNKNOWN_RECONCILER_TYPE { + reconcileFun := getMatchedReconcileStackFrame() + if reconcileFun == UNKNOWN_RECONCILE_FUN { return 1 } serializedObj, err := json.Marshal(object) @@ -309,15 +309,15 @@ func NotifyTestBeforeRestCall(verb string, pathPrefix string, subpath string, na if !checkKVPairInTriggerObservationPoint(resourceKey, "when", "beforeControllerWrite", false) { return -1 } - if !checkKVPairInTriggerObservationPoint(resourceKey, "by", reconcilerType, false) { + if !checkKVPairInTriggerObservationPoint(resourceKey, "by", reconcileFun, false) { return -1 } - log.Printf("NotifyTestBeforeRestWrite %s %s %s %s %s %s\n", verb, resourceKey, reconcilerType, pathPrefix, subpath, string(serializedObj)) + log.Printf("NotifyTestBeforeRestWrite %s %s %s %s %s %s\n", verb, resourceKey, reconcileFun, pathPrefix, subpath, string(serializedObj)) request := &NotifyTestBeforeControllerWriteRequest{ - WriteType: controllerOperationType, - ResourceKey: resourceKey, - ReconcilerType: reconcilerType, - Object: string(serializedObj), + WriteType: controllerOperationType, + ResourceKey: resourceKey, + ReconcileFun: reconcileFun, + Object: string(serializedObj), } var response Response err = rpcClient.Call("TestCoordinator.NotifyTestBeforeControllerWrite", request, &response) @@ -343,8 +343,8 @@ func NotifyTestAfterRestCall(controllerOperationID int, verb string, pathPrefix if err := initRPCClient(); err != nil { return } - reconcilerType := getReconcilerFromStackTrace() - if reconcilerType == UNKNOWN_RECONCILER_TYPE { + reconcileFun := getMatchedReconcileStackFrame() + if reconcileFun == UNKNOWN_RECONCILE_FUN { return } serializedObj, err := json.Marshal(object) @@ -363,15 +363,15 @@ func NotifyTestAfterRestCall(controllerOperationID int, verb string, pathPrefix if !checkKVPairInTriggerObservationPoint(resourceKey, "when", "afterControllerWrite", false) { return } - if !checkKVPairInTriggerObservationPoint(resourceKey, "by", reconcilerType, false) { + if !checkKVPairInTriggerObservationPoint(resourceKey, "by", reconcileFun, false) { return } - log.Printf("NotifyTestAfterRestWrite %s %s %s %s %s %s\n", verb, resourceKey, reconcilerType, pathPrefix, subpath, string(serializedObj)) + log.Printf("NotifyTestAfterRestWrite %s %s %s %s %s %s\n", verb, resourceKey, reconcileFun, pathPrefix, subpath, string(serializedObj)) request := &NotifyTestAfterControllerWriteRequest{ - WriteType: controllerOperationType, - ReconcilerType: reconcilerType, - ResourceKey: resourceKey, - Object: string(serializedObj), + WriteType: controllerOperationType, + ReconcileFun: reconcileFun, + ResourceKey: resourceKey, + Object: string(serializedObj), } var response Response err = rpcClient.Call("TestCoordinator.NotifyTestAfterControllerWrite", request, &response) @@ -437,14 +437,14 @@ func NotifyTestBeforeAnnotatedAPICall(moduleName string, filePath string, receiv if !checkKVPairInAnnotatedAPICallTriggerCondition(receiverType + funName) { return -1 } - reconcilerType := getReconcilerFromStackTrace() + reconcileFun := getMatchedReconcileStackFrame() log.Printf("NotifyTestBeforeAnnotatedAPICall %s %s %s %s\n", moduleName, filePath, receiverType, funName) request := &NotifyTestBeforeAnnotatedAPICallRequest{ - ModuleName: moduleName, - FilePath: filePath, - ReceiverType: receiverType, - FunName: funName, - ReconcilerType: reconcilerType, + ModuleName: moduleName, + FilePath: filePath, + ReceiverType: receiverType, + FunName: funName, + ReconcileFun: reconcileFun, } var response Response err := rpcClient.Call("TestCoordinator.NotifyTestBeforeAnnotatedAPICall", request, &response) @@ -466,14 +466,14 @@ func NotifyTestAfterAnnotatedAPICall(invocationID int, moduleName string, filePa if !checkKVPairInAnnotatedAPICallTriggerCondition(receiverType + funName) { return } - reconcilerType := getReconcilerFromStackTrace() + reconcileFun := getMatchedReconcileStackFrame() log.Printf("NotifyTestAfterAnnotatedAPICall %s %s %s %s\n", moduleName, filePath, receiverType, funName) request := &NotifyTestAfterAnnotatedAPICallRequest{ - ModuleName: moduleName, - FilePath: filePath, - ReceiverType: receiverType, - FunName: funName, - ReconcilerType: reconcilerType, + ModuleName: moduleName, + FilePath: filePath, + ReceiverType: receiverType, + FunName: funName, + ReconcileFun: reconcileFun, } var response Response err := rpcClient.Call("TestCoordinator.NotifyTestAfterAnnotatedAPICall", request, &response) diff --git a/sieve_client/types.go b/sieve_client/types.go index ab3a15bf496..1f7882904b7 100644 --- a/sieve_client/types.go +++ b/sieve_client/types.go @@ -34,7 +34,7 @@ type NotifyLearnBeforeRestWriteRequest struct { type NotifyLearnAfterRestWriteRequest struct { ControllerOperationID int ControllerOperationType string - ReconcilerType string + ReconcileFun string ResourceType string Namespace string Name string @@ -48,7 +48,7 @@ type NotifyLearnBeforeRestReadRequest struct { type NotifyLearnAfterRestReadRequest struct { ControllerOperationID int ControllerOperationType string - ReconcilerType string + ReconcileFun string ResourceType string Namespace string Name string @@ -57,36 +57,36 @@ type NotifyLearnAfterRestReadRequest struct { } type NotifyLearnBeforeAnnotatedAPICallRequest struct { - ModuleName string - FilePath string - ReceiverType string - FunName string - ReconcilerType string + ModuleName string + FilePath string + ReceiverType string + FunName string + ReconcileFun string } type NotifyLearnAfterAnnotatedAPICallRequest struct { - InvocationID int - ModuleName string - FilePath string - ReceiverType string - FunName string - ReconcilerType string + InvocationID int + ModuleName string + FilePath string + ReceiverType string + FunName string + ReconcileFun string } type NotifyLearnAfterCacheGetRequest struct { - ResourceType string - Namespace string - Name string - Object string - ReconcilerType string - Error string + ResourceType string + Namespace string + Name string + Object string + ReconcileFun string + Error string } type NotifyLearnAfterCacheListRequest struct { - ResourceType string - ObjectList string - ReconcilerType string - Error string + ResourceType string + ObjectList string + ReconcileFun string + Error string } type NotifyTestBeforeAPIServerRecvRequest struct { @@ -116,29 +116,29 @@ type NotifyTestAfterControllerRecvRequest struct { } type NotifyTestAfterControllerGetRequest struct { - ResourceKey string - ReconcilerType string - Object string + ResourceKey string + ReconcileFun string + Object string } type NotifyTestAfterControllerListRequest struct { - ResourceType string - ReconcilerType string - ObjectList string + ResourceType string + ReconcileFun string + ObjectList string } type NotifyTestBeforeControllerWriteRequest struct { - WriteType string - ResourceKey string - ReconcilerType string - Object string + WriteType string + ResourceKey string + ReconcileFun string + Object string } type NotifyTestAfterControllerWriteRequest struct { - WriteType string - ResourceKey string - ReconcilerType string - Object string + WriteType string + ResourceKey string + ReconcileFun string + Object string } type NotifyTestBeforeControllerWritePauseRequest struct { @@ -164,17 +164,17 @@ type NotifyTestAfterControllerReadPauseRequest struct { } type NotifyTestBeforeAnnotatedAPICallRequest struct { - ModuleName string - FilePath string - ReceiverType string - FunName string - ReconcilerType string + ModuleName string + FilePath string + ReceiverType string + FunName string + ReconcileFun string } type NotifyTestAfterAnnotatedAPICallRequest struct { - ModuleName string - FilePath string - ReceiverType string - FunName string - ReconcilerType string + ModuleName string + FilePath string + ReceiverType string + FunName string + ReconcileFun string } diff --git a/sieve_common/config.py b/sieve_common/config.py index 13c61085769..228074c47e2 100644 --- a/sieve_common/config.py +++ b/sieve_common/config.py @@ -112,7 +112,6 @@ def __init__( commit, cherry_pick_commits, kubernetes_version, - controller_runtime_version, client_go_version, apimachinery_version, go_mod, @@ -125,6 +124,7 @@ def __init__( test_command, loosen_reconciler_boundary, custom_resource_definitions, + annotated_reconcile_functions, controller_pod_label, container_name, controller_deployment_file_path, @@ -137,7 +137,6 @@ def __init__( self.commit = commit self.cherry_pick_commits = cherry_pick_commits self.kubernetes_version = kubernetes_version - self.controller_runtime_version = controller_runtime_version self.client_go_version = client_go_version self.apimachinery_version = apimachinery_version self.go_mod = go_mod @@ -150,6 +149,7 @@ def __init__( self.test_command = test_command self.loosen_reconciler_boundary = loosen_reconciler_boundary self.custom_resource_definitions = custom_resource_definitions + self.annotated_reconcile_functions = annotated_reconcile_functions self.controller_pod_label = controller_pod_label self.container_name = container_name self.controller_deployment_file_path = controller_deployment_file_path @@ -169,7 +169,6 @@ def load_controller_config(controller_config_dir): if "cherry_pick_commits" in controller_config else [], kubernetes_version=controller_config["kubernetes_version"], - controller_runtime_version=controller_config["controller_runtime_version"], client_go_version=controller_config["client_go_version"], apimachinery_version=controller_config["apimachinery_version"] if "apimachinery_version" in controller_config @@ -196,6 +195,9 @@ def load_controller_config(controller_config_dir): if "loosen_reconciler_boundary" in controller_config else False, custom_resource_definitions=controller_config["custom_resource_definitions"], + annotated_reconcile_functions=controller_config[ + "annotated_reconcile_functions" + ], controller_pod_label=controller_config["controller_pod_label"], container_name=controller_config["container_name"] if "container_name" in controller_config diff --git a/sieve_common/k8s_event.py b/sieve_common/k8s_event.py index bc3ce2cf40b..c7809adf930 100644 --- a/sieve_common/k8s_event.py +++ b/sieve_common/k8s_event.py @@ -27,7 +27,7 @@ DEFAULT_NS = "default" -UNKNOWN_RECONCILER_TYPE = "unknown" +UNKNOWN_RECONCILE_FUN = "unknown" class APIEventTypes: @@ -361,14 +361,14 @@ def __init__( file_path: str, recv_type: str, fun_name: str, - reconciler_type: str, + reconcile_fun: str, ): self.__id = int(id) self.__module = module self.__file_path = file_path self.__recv_type = recv_type self.__fun_name = fun_name - self.__reconciler_type = reconciler_type + self.__reconcile_fun = reconcile_fun self.__reconcile_id = -1 self.__start_timestamp = -1 self.__end_timestamp = -1 @@ -397,8 +397,8 @@ def fun_name(self): return self.__fun_name @property - def reconciler_type(self): - return self.__reconciler_type + def reconcile_fun(self): + return self.__reconcile_fun @property def reconcile_id(self): @@ -424,9 +424,9 @@ def range_end_timestamp(self): def signature_counter(self): return self.__signature_counter - @reconciler_type.setter - def reconciler_type(self, reconciler_type: str): - self.__reconciler_type = reconciler_type + @reconcile_fun.setter + def reconcile_fun(self, reconcile_fun: str): + self.__reconcile_fun = reconcile_fun @reconcile_id.setter def reconcile_id(self, reconcile_id: int): @@ -458,7 +458,7 @@ def __init__( self, id: str, etype: str, - reconciler_type: str, + reconcile_fun: str, error: str, rtype: str, namespace: str, @@ -470,7 +470,7 @@ def __init__( assert etype != OperatorWriteTypes.DELETEALLOF self.__etype = etype self.__rtype = rtype - self.__reconciler_type = reconciler_type + self.__reconcile_fun = reconcile_fun self.__reconcile_id = -1 self.__error = error self.__obj_str = obj_str @@ -503,8 +503,8 @@ def rtype(self): return self.__rtype @property - def reconciler_type(self): - return self.__reconciler_type + def reconcile_fun(self): + return self.__reconcile_fun @property def reconcile_id(self): @@ -578,9 +578,9 @@ def prev_etype(self): def signature_counter(self): return self.__signature_counter - @reconciler_type.setter - def reconciler_type(self, reconciler_type: str): - self.__reconciler_type = reconciler_type + @reconcile_fun.setter + def reconcile_fun(self, reconcile_fun: str): + self.__reconcile_fun = reconcile_fun @reconcile_id.setter def reconcile_id(self, reconcile_id: int): @@ -636,14 +636,14 @@ def __init__( rtype: str, namespace: str, name: str, - reconciler_type: str, + reconcile_fun: str, error: str, obj_str: str, ): self.__etype = etype self.__from_cache = True if from_cache == "true" else False self.__rtype = rtype - self.__reconciler_type = reconciler_type + self.__reconcile_fun = reconcile_fun self.__reconcile_id = -1 self.__error = error self.__key_to_obj = {} @@ -682,8 +682,8 @@ def rtype(self): return self.__rtype @property - def reconciler_type(self): - return self.__reconciler_type + def reconcile_fun(self): + return self.__reconcile_fun @property def reconcile_id(self): @@ -742,14 +742,14 @@ def id(self): class ReconcileBegin: - def __init__(self, reconciler_type: str, reconcile_id: str): - self.__reconciler_type = reconciler_type + def __init__(self, reconcile_fun: str, reconcile_id: str): + self.__reconcile_fun = reconcile_fun self.__reconcile_id = reconcile_id self.__end_timestamp = -1 @property - def reconciler_type(self): - return self.__reconciler_type + def reconcile_fun(self): + return self.__reconcile_fun @property def reconcile_id(self): @@ -765,14 +765,14 @@ def end_timestamp(self, end_timestamp: int): class ReconcileEnd: - def __init__(self, reconciler_type: str, reconcile_id: str): - self.__reconciler_type = reconciler_type + def __init__(self, reconcile_fun: str, reconcile_id: str): + self.__reconcile_fun = reconcile_fun self.__reconcile_id = reconcile_id self.__end_timestamp = -1 @property - def reconciler_type(self): - return self.__reconciler_type + def reconcile_fun(self): + return self.__reconcile_fun @property def reconcile_id(self): diff --git a/sieve_instrumentation/go.mod b/sieve_instrumentation/go.mod index 5dcfb8bee4f..bf1f966947e 100644 --- a/sieve_instrumentation/go.mod +++ b/sieve_instrumentation/go.mod @@ -3,13 +3,9 @@ module instrumentation go 1.13 require ( - github.com/dave/dst v0.26.2 - github.com/davecgh/go-spew v1.1.1 // indirect - github.com/kr/pretty v0.2.0 // indirect - github.com/stretchr/testify v1.6.1 // indirect - golang.org/x/mod v0.3.0 // indirect - golang.org/x/tools v0.0.0-20200616133436-c1934b75d054 // indirect - golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect - gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 // indirect - gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776 // indirect + github.com/dave/dst v0.27.2 + github.com/kr/pretty v0.3.1 // indirect + github.com/stretchr/testify v1.8.1 // indirect + golang.org/x/tools v0.4.0 // indirect + gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect ) diff --git a/sieve_instrumentation/go.sum b/sieve_instrumentation/go.sum index ed2b97e806b..46c9e021b04 100644 --- a/sieve_instrumentation/go.sum +++ b/sieve_instrumentation/go.sum @@ -1,58 +1,101 @@ -github.com/dave/dst v0.26.2 h1:lnxLAKI3tx7MgLNVDirFCsDTlTG9nKTk7GcptKcWSwY= -github.com/dave/dst v0.26.2/go.mod h1:UMDJuIRPfyUCC78eFuB+SV/WI8oDeyFDvM/JR6NI3IU= +github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= +github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= +github.com/dave/astrid v0.0.0-20170323122508-8c2895878b14/go.mod h1:Sth2QfxfATb/nW4EsrSi2KyJmbcniZ8TgTaji17D6ms= +github.com/dave/brenda v1.1.0/go.mod h1:4wCUr6gSlu5/1Tk7akE5X7UorwiQ8Rij0SKH3/BGMOM= +github.com/dave/courtney v0.3.0/go.mod h1:BAv3hA06AYfNUjfjQr+5gc6vxeBVOupLqrColj+QSD8= +github.com/dave/dst v0.27.2 h1:4Y5VFTkhGLC1oddtNwuxxe36pnyLxMFXT51FOzH8Ekc= +github.com/dave/dst v0.27.2/go.mod h1:jHh6EOibnHgcUW3WjKHisiooEkYwqpHLBSX1iOBhEyc= github.com/dave/gopackages v0.0.0-20170318123100-46e7023ec56e/go.mod h1:i00+b/gKdIDIxuLDFob7ustLAVqhsZRk2qVZrArELGQ= -github.com/dave/jennifer v1.2.0/go.mod h1:fIb+770HOpJ2fmN9EPPKOqm1vMGhB+TwXKMZhrIygKg= +github.com/dave/jennifer v1.5.0 h1:HmgPN93bVDpkQyYbqhCHj5QlgvUkvEOzMyEvKLgCRrg= +github.com/dave/jennifer v1.5.0/go.mod h1:4MnyiFIlZS3l5tSDn8VnzE6ffAhYBMB2SZntBsZGUok= github.com/dave/kerr v0.0.0-20170318121727-bc25dd6abe8e/go.mod h1:qZqlPyPvfsDJt+3wHJ1EvSXDuVjFTK0j2p/ca+gtsb8= +github.com/dave/patsy v0.0.0-20210517141501-957256f50cba/go.mod h1:qfR88CgEGLoiqDaE+xxDCi5QA5v4vUoW0UCX2Nd5Tlc= github.com/dave/rebecca v0.9.1/go.mod h1:N6XYdMD/OKw3lkF3ywh8Z6wPGuwNFDNtWYEMFWEmXBA= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/google/pprof v0.0.0-20181127221834-b4f47329b966/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= -github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= -github.com/kr/pretty v0.2.0 h1:s5hAObm+yFO5uHYt5dYjxi2rXrsnmRpJx4OYvIWUaQs= -github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= +github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= +github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= +github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= -github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= +github.com/kr/pty v1.1.8/go.mod h1:O1sed60cT9XZ5uDucP5qwvh+TE3NnUj51EiZO/lmSfw= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= +github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= +github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= +github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/sergi/go-diff v1.0.0 h1:Kpca3qRNrduNnOQeazBd0ysaKrUJiIuISHxogkT9RPQ= -github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= +github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8= +github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= +github.com/sergi/go-diff v1.2.0 h1:XU+rvMAioB0UC3q1MFrIQy4Vo5/4VsRDQQXHsEya6xQ= +github.com/sergi/go-diff v1.2.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0= -github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -golang.org/x/arch v0.0.0-20180920145803-b19384d3c130/go.mod h1:cYlCBUl1MsqxdiKgmc4uh7TxZfWSFLOGSRR090WDxt8= +github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= +github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= +github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= +github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= +github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk= +github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= +github.com/yuin/goldmark v1.4.1/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= +github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.3.0 h1:RM4zey1++hCTbCVQfnWeKs9/IEsaBLA8vTkd0WVtmH4= -golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/mod v0.5.1/go.mod h1:5OXOZSfqPIIbmVBIIKWRFfZjPR0E5r58TLhUjH0a2Ro= +golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= +golang.org/x/mod v0.7.0 h1:LapD9S96VoQRhi/GrNTqeBJFrUjs5UHCAtTlgwA5oZA= +golang.org/x/mod v0.7.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= +golang.org/x/net v0.3.0/go.mod h1:MBQ8lrhLObU/6UmLb4fmbmk5OcyYmqtbGd/9yIeKjEE= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sys v0.0.0-20180903190138-2b024373dcd9/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.1.0 h1:wsuoTGHzEhffawBOhz5CYhcrV4IdKZbEyZjBMuTp12o= +golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.3.0 h1:w8ZOecv6NaNa/zC8944JTU3vz4u6Lagfk4RPQxv92NQ= +golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= +golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= +golang.org/x/term v0.3.0/go.mod h1:q750SLmJuPmVoN1blW3UFBPREJfb1KmY3vwxfr+nFDA= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= +golang.org/x/text v0.5.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20200509030707-2212a7e161a5/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200616133436-c1934b75d054 h1:HHeAlu5H9b71C+Fx0K+1dGgVFN1DM1/wz4aoGOA5qS8= -golang.org/x/tools v0.0.0-20200616133436-c1934b75d054/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.1.8/go.mod h1:nABZi5QlRsZVlzPpHl034qft6wpY4eDcsTt5AaioBiU= +golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= +golang.org/x/tools v0.4.0 h1:7mTAgkunk3fr4GAloyyCasadO6h9zSsQZbwvcaIciV4= +golang.org/x/tools v0.4.0/go.mod h1:UE5sM2OK9E/d67R0ANs2xJizIymRP5gJU295PvKXxjQ= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/src-d/go-billy.v4 v4.3.0 h1:KtlZ4c1OWbIs4jCv5ZXrTqG8EQocr0g/d4DjNg70aek= -gopkg.in/src-d/go-billy.v4 v4.3.0/go.mod h1:tm33zBoOwxjYHZIE+OV8bxTWFMJLrconzFMd38aARFk= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= +gopkg.in/src-d/go-billy.v4 v4.3.2 h1:0SQA1pRztfTFx2miS8sA97XvooFeNOmvUenF4o0EcVg= +gopkg.in/src-d/go-billy.v4 v4.3.2/go.mod h1:nDjArDMp+XMs1aFAESLRjfGSgfvoYN0hDfzEk0GjC98= +gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776 h1:tQIYjPdBoyREyB9XMu+nnTclpTYkz2zFM+lzLJFO4gQ= -gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/sieve_instrumentation/common.go b/sieve_instrumentation/instrumentation.go similarity index 93% rename from sieve_instrumentation/common.go rename to sieve_instrumentation/instrumentation.go index 25233b65575..5db40d5eabb 100644 --- a/sieve_instrumentation/common.go +++ b/sieve_instrumentation/instrumentation.go @@ -65,9 +65,16 @@ func findTypeDecl(f *dst.File, typeName string) (int, int, *dst.TypeSpec) { return -1, -1, nil } -func parseSourceFile(ifilepath, pkg string, customizedImportMap map[string]string) *dst.File { +// Bad hack: we should report this issue +func auxiliaryImportMap() map[string]string { importMap := map[string]string{} importMap["k8s.io/klog/v2"] = "klog" + importMap["github.com/robfig/cron/v3"] = "cron" + return importMap +} + +func parseSourceFile(ifilepath, pkg string, customizedImportMap map[string]string) *dst.File { + importMap := auxiliaryImportMap() for k, v := range customizedImportMap { importMap[k] = v } @@ -95,8 +102,7 @@ func insertField(list *[]*dst.Field, index int, instrumentation *dst.Field) { } func writeInstrumentedFile(ofilepath, pkg string, f *dst.File, customizedImportMap map[string]string) { - importMap := map[string]string{} - importMap["k8s.io/klog/v2"] = "klog" + importMap := auxiliaryImportMap() for k, v := range customizedImportMap { importMap[k] = v } @@ -113,6 +119,37 @@ func writeInstrumentedFile(ofilepath, pkg string, f *dst.File, customizedImportM autoInstrFile.Write(buf.Bytes()) } +func instrumentAnnotatedReconcile(ifilepath, ofilepath, pkg, funName, recvType, stackFrame string) { + f := parseSourceFile(ifilepath, pkg, map[string]string{}) + _, funcDecl := findFuncDecl(f, funName, recvType) + + if funcDecl != nil { + index := 0 + beforeReconcileInstrumentation := &dst.ExprStmt{ + X: &dst.CallExpr{ + Fun: &dst.Ident{Name: "NotifyLearnBeforeReconcile", Path: "sieve.client"}, + Args: []dst.Expr{&dst.Ident{Name: fmt.Sprintf("\"%s\"", stackFrame)}}, + }, + } + beforeReconcileInstrumentation.Decs.End.Append("//sieve") + insertStmt(&funcDecl.Body.List, index, beforeReconcileInstrumentation) + + index += 1 + afterReconcileInstrumentation := &dst.DeferStmt{ + Call: &dst.CallExpr{ + Fun: &dst.Ident{Name: "NotifyLearnAfterReconcile", Path: "sieve.client"}, + Args: []dst.Expr{&dst.Ident{Name: fmt.Sprintf("\"%s\"", stackFrame)}}, + }, + } + afterReconcileInstrumentation.Decs.End.Append("//sieve") + insertStmt(&funcDecl.Body.List, index, afterReconcileInstrumentation) + } else { + panic(fmt.Errorf("cannot find function reconcileHandler")) + } + + writeInstrumentedFile(ofilepath, pkg, f, map[string]string{}) +} + func instrumentAnnotatedAPI(ifilepath, ofilepath, module, filePath, pkg, funName, recvTypeName, mode string, customizedImportMap map[string]string, instrumentBefore bool) { f := parseSourceFile(ifilepath, pkg, customizedImportMap) _, funcDecl := findFuncDecl(f, funName, recvTypeName) diff --git a/sieve_instrumentation/learn_instr.go b/sieve_instrumentation/learn_instr.go deleted file mode 100644 index 3192dcd3e39..00000000000 --- a/sieve_instrumentation/learn_instr.go +++ /dev/null @@ -1,37 +0,0 @@ -package main - -import ( - "fmt" - - "github.com/dave/dst" -) - -func instrumentControllerGoForLearn(ifilepath, ofilepath string) { - f := parseSourceFile(ifilepath, "controller", map[string]string{}) - _, funcDecl := findFuncDecl(f, "reconcileHandler", "*Controller") - if funcDecl != nil { - index := 0 - beforeReconcileInstrumentation := &dst.ExprStmt{ - X: &dst.CallExpr{ - Fun: &dst.Ident{Name: "NotifyLearnBeforeReconcile", Path: "sieve.client"}, - Args: []dst.Expr{&dst.Ident{Name: "c.Do"}}, - }, - } - beforeReconcileInstrumentation.Decs.End.Append("//sieve") - insertStmt(&funcDecl.Body.List, index, beforeReconcileInstrumentation) - - index += 1 - afterReconcileInstrumentation := &dst.DeferStmt{ - Call: &dst.CallExpr{ - Fun: &dst.Ident{Name: "NotifyLearnAfterReconcile", Path: "sieve.client"}, - Args: []dst.Expr{&dst.Ident{Name: "c.Do"}}, - }, - } - afterReconcileInstrumentation.Decs.End.Append("//sieve") - insertStmt(&funcDecl.Body.List, index, afterReconcileInstrumentation) - } else { - panic(fmt.Errorf("cannot find function reconcileHandler")) - } - - writeInstrumentedFile(ofilepath, "controller", f, map[string]string{}) -} diff --git a/sieve_instrumentation/instr.go b/sieve_instrumentation/main.go similarity index 86% rename from sieve_instrumentation/instr.go rename to sieve_instrumentation/main.go index 025c9d89018..5310bee0bb9 100644 --- a/sieve_instrumentation/instr.go +++ b/sieve_instrumentation/main.go @@ -6,6 +6,7 @@ import ( "log" "os" "path" + "strings" "encoding/json" ) @@ -24,8 +25,8 @@ func instrumentKubernetesForLearn(k8s_filepath string) { func instrumentControllerForLearn(configMap map[string]interface{}) { application_file_path := configMap["app_file_path"].(string) - controller_runtime_filepath := configMap["controller_runtime_filepath"].(string) client_go_filepath := configMap["client_go_filepath"].(string) + annotated_reconcile_functions := configMap["annotated_reconcile_functions"].(map[string]interface{}) apis_to_instrument := configMap["apis_to_instrument"].([]interface{}) sharedInformerGoFile := path.Join(client_go_filepath, "tools", "cache", "shared_informer.go") @@ -40,13 +41,15 @@ func instrumentControllerForLearn(configMap map[string]interface{}) { fmt.Printf("instrumenting %s\n", storeGoFile) instrumentStoreGoForAll(storeGoFile, storeGoFile, "Learn") - controllerGoFile := path.Join(controller_runtime_filepath, "pkg", "internal", "controller", "controller.go") - fmt.Printf("instrumenting %s\n", controllerGoFile) - instrumentControllerGoForLearn(controllerGoFile, controllerGoFile) - - // splitGoFile := path.Join(controller_runtime_filepath, "pkg", "client", "split.go") - // fmt.Printf("instrumenting %s\n", splitGoFile) - // instrumentSplitGoForAll(splitGoFile, splitGoFile, "Learn") + for filePath, stackFrame := range annotated_reconcile_functions { + source_file_to_instrument := path.Join(application_file_path, filePath) + tokens := strings.Split(strings.Split(stackFrame.(string), "/")[len(strings.Split(stackFrame.(string), "/"))-1], ".") + pkg := tokens[len(tokens)-3] + recvType := strings.Trim(tokens[len(tokens)-2], "()") + funName := tokens[len(tokens)-1] + fmt.Printf("instrumenting %s\n", source_file_to_instrument) + instrumentAnnotatedReconcile(source_file_to_instrument, source_file_to_instrument, pkg, funName, recvType, stackFrame.(string)) + } for _, api_to_instrument := range apis_to_instrument { entry := api_to_instrument.(map[string]interface{}) @@ -63,12 +66,12 @@ func instrumentControllerForLearn(configMap map[string]interface{}) { } } source_file_to_instrument := path.Join(application_file_path, "sieve-dependency", "src", module, filePath) + fmt.Printf("instrumenting %s\n", source_file_to_instrument) instrumentAnnotatedAPI(source_file_to_instrument, source_file_to_instrument, module, filePath, pkg, funName, recvType, "Learn", customizedImportMap, true) } } func instrumentControllerForTest(configMap map[string]interface{}) { - // controller_runtime_filepath := configMap["controller_runtime_filepath"].(string) client_go_filepath := configMap["client_go_filepath"].(string) application_file_path := configMap["app_file_path"].(string) apis_to_instrument := configMap["apis_to_instrument"].([]interface{}) @@ -100,6 +103,7 @@ func instrumentControllerForTest(configMap map[string]interface{}) { } } source_file_to_instrument := path.Join(application_file_path, "sieve-dependency", "src", module, filePath) + fmt.Printf("instrumenting %s\n", source_file_to_instrument) instrumentAnnotatedAPI(source_file_to_instrument, source_file_to_instrument, module, filePath, pkg, funName, recvType, "Test", customizedImportMap, true) } } diff --git a/sieve_instrumentation/test_instr.go b/sieve_instrumentation/test_instr.go deleted file mode 100644 index 205b79ea67c..00000000000 --- a/sieve_instrumentation/test_instr.go +++ /dev/null @@ -1,69 +0,0 @@ -package main - -import ( - "fmt" - - "github.com/dave/dst" -) - -func instrumentInformerCacheGoForTest(ifilepath, ofilepath string) { - f := parseSourceFile(ifilepath, "cache", map[string]string{}) - - instrumentInformerCacheRead(f, "Get", "Test") - instrumentInformerCacheRead(f, "List", "Test") - - writeInstrumentedFile(ofilepath, "cache", f, map[string]string{}) -} - -func instrumentInformerCacheRead(f *dst.File, etype, mode string) { - funNameBefore := "Notify" + mode + "BeforeController" + etype + "Pause" - funNameAfter := "Notify" + mode + "AfterController" + etype + "Pause" - _, funcDecl := findFuncDecl(f, etype, "*informerCache") - if funcDecl != nil { - if _, ok := funcDecl.Body.List[len(funcDecl.Body.List)-1].(*dst.ReturnStmt); ok { - if etype == "Get" { - beforeGetInstrumentation := &dst.ExprStmt{ - X: &dst.CallExpr{ - Fun: &dst.Ident{Name: funNameBefore, Path: "sieve.client"}, - Args: []dst.Expr{&dst.Ident{Name: "\"Get\""}, &dst.Ident{Name: "key"}, &dst.Ident{Name: "out"}}, - }, - } - beforeGetInstrumentation.Decs.End.Append("//sieve") - insertStmt(&funcDecl.Body.List, len(funcDecl.Body.List)-1, beforeGetInstrumentation) - - afterGetInstrumentation := &dst.DeferStmt{ - Call: &dst.CallExpr{ - Fun: &dst.Ident{Name: funNameAfter, Path: "sieve.client"}, - Args: []dst.Expr{&dst.Ident{Name: "\"Get\""}, &dst.Ident{Name: "key"}, &dst.Ident{Name: "out"}}, - }, - } - afterGetInstrumentation.Decs.End.Append("//sieve") - insertStmt(&funcDecl.Body.List, len(funcDecl.Body.List)-1, afterGetInstrumentation) - } else if etype == "List" { - beforeListInstrumentation := &dst.ExprStmt{ - X: &dst.CallExpr{ - Fun: &dst.Ident{Name: funNameBefore, Path: "sieve.client"}, - Args: []dst.Expr{&dst.Ident{Name: "\"List\""}, &dst.Ident{Name: "out"}}, - }, - } - beforeListInstrumentation.Decs.End.Append("//sieve") - insertStmt(&funcDecl.Body.List, len(funcDecl.Body.List)-1, beforeListInstrumentation) - - afterListInstrumentation := &dst.DeferStmt{ - Call: &dst.CallExpr{ - Fun: &dst.Ident{Name: funNameAfter, Path: "sieve.client"}, - Args: []dst.Expr{&dst.Ident{Name: "\"List\""}, &dst.Ident{Name: "out"}}, - }, - } - afterListInstrumentation.Decs.End.Append("//sieve") - insertStmt(&funcDecl.Body.List, len(funcDecl.Body.List)-1, afterListInstrumentation) - } else { - panic(fmt.Errorf("wrong type %s for operator read", etype)) - } - } else { - panic(fmt.Errorf("last stmt of %s is not return", etype)) - } - } else { - panic(fmt.Errorf("cannot find function %s", etype)) - } -} diff --git a/sieve_perturbation_policies/intermediate_state.py b/sieve_perturbation_policies/intermediate_state.py index 23e160a35f7..560d28c0619 100644 --- a/sieve_perturbation_policies/intermediate_state.py +++ b/sieve_perturbation_policies/intermediate_state.py @@ -131,7 +131,7 @@ def generate_intermediate_state_test_plan_for_controller_write( "condition": condition, "observationPoint": { "when": "afterControllerWrite", - "by": operator_write.reconciler_type, + "by": operator_write.reconcile_fun, }, } ], @@ -165,7 +165,7 @@ def generate_intermediate_state_test_plan_for_annotated_api_invocation( }, "observationPoint": { "when": "afterAnnotatedAPICall", - "by": api_invocation.reconciler_type, + "by": api_invocation.reconcile_fun, }, } ], diff --git a/sieve_server/learn_server.go b/sieve_server/learn_server.go index 1f334c1861b..8860a44f6ed 100644 --- a/sieve_server/learn_server.go +++ b/sieve_server/learn_server.go @@ -195,7 +195,7 @@ func (s *learnServer) NotifyLearnBeforeRestWrite(request *sieve.NotifyLearnBefor } func (s *learnServer) NotifyLearnAfterRestWrite(request *sieve.NotifyLearnAfterRestWriteRequest, response *sieve.Response) error { - s.notificationCh <- notificationWrapper{ntype: afterRestWriteForLearn, payload: fmt.Sprintf("%d\t%s\t%s\t%s\t%s\t%s\t%s\t%s", request.ControllerOperationID, request.ControllerOperationType, request.ReconcilerType, request.Error, request.ResourceType, request.Namespace, request.Name, request.ObjectBody)} + s.notificationCh <- notificationWrapper{ntype: afterRestWriteForLearn, payload: fmt.Sprintf("%d\t%s\t%s\t%s\t%s\t%s\t%s\t%s", request.ControllerOperationID, request.ControllerOperationType, request.ReconcileFun, request.Error, request.ResourceType, request.Namespace, request.Name, request.ObjectBody)} *response = sieve.Response{Message: request.ControllerOperationType, Ok: true} return nil } @@ -211,7 +211,7 @@ func (s *learnServer) NotifyLearnBeforeRestRead(request *sieve.NotifyLearnBefore } func (s *learnServer) NotifyLearnAfterRestRead(request *sieve.NotifyLearnAfterRestReadRequest, response *sieve.Response) error { - s.notificationCh <- notificationWrapper{ntype: afterRestReadForLearn, payload: fmt.Sprintf("%d\t%s\t%s\t%s\t%s\t%s\t%s\t%s", request.ControllerOperationID, request.ControllerOperationType, request.ReconcilerType, request.Error, request.ResourceType, request.Namespace, request.Name, request.ObjectBody)} + s.notificationCh <- notificationWrapper{ntype: afterRestReadForLearn, payload: fmt.Sprintf("%d\t%s\t%s\t%s\t%s\t%s\t%s\t%s", request.ControllerOperationID, request.ControllerOperationType, request.ReconcileFun, request.Error, request.ResourceType, request.Namespace, request.Name, request.ObjectBody)} *response = sieve.Response{Message: "OK", Ok: true} return nil } @@ -227,19 +227,19 @@ func (s *learnServer) NotifyLearnBeforeAnnotatedAPICall(request *sieve.NotifyLea } func (s *learnServer) NotifyLearnAfterAnnotatedAPICall(request *sieve.NotifyLearnAfterAnnotatedAPICallRequest, response *sieve.Response) error { - s.notificationCh <- notificationWrapper{ntype: afterAnnotatedAPICallForLearn, payload: fmt.Sprintf("%d\t%s\t%s\t%s\t%s\t%s", request.InvocationID, request.ModuleName, request.FilePath, request.ReceiverType, request.FunName, request.ReconcilerType)} + s.notificationCh <- notificationWrapper{ntype: afterAnnotatedAPICallForLearn, payload: fmt.Sprintf("%d\t%s\t%s\t%s\t%s\t%s", request.InvocationID, request.ModuleName, request.FilePath, request.ReceiverType, request.FunName, request.ReconcileFun)} *response = sieve.Response{Message: request.FunName, Ok: true} return nil } func (s *learnServer) NotifyLearnAfterCacheGet(request *sieve.NotifyLearnAfterCacheGetRequest, response *sieve.Response) error { - s.notificationCh <- notificationWrapper{ntype: afterControllerReadForLearn, payload: fmt.Sprintf("Get\t%s\t%s\t%s\t%s\t%s\t%s", request.ResourceType, request.Namespace, request.Name, request.ReconcilerType, request.Error, request.Object)} + s.notificationCh <- notificationWrapper{ntype: afterControllerReadForLearn, payload: fmt.Sprintf("Get\t%s\t%s\t%s\t%s\t%s\t%s", request.ResourceType, request.Namespace, request.Name, request.ReconcileFun, request.Error, request.Object)} *response = sieve.Response{Message: "Get", Ok: true} return nil } func (s *learnServer) NotifyLearnAfterCacheList(request *sieve.NotifyLearnAfterCacheListRequest, response *sieve.Response) error { - s.notificationCh <- notificationWrapper{ntype: afterControllerReadForLearn, payload: fmt.Sprintf("List\t%s\t%s\t%s\t%s", request.ResourceType, request.ReconcilerType, request.Error, request.ObjectList)} + s.notificationCh <- notificationWrapper{ntype: afterControllerReadForLearn, payload: fmt.Sprintf("List\t%s\t%s\t%s\t%s", request.ResourceType, request.ReconcileFun, request.Error, request.ObjectList)} *response = sieve.Response{Message: "List", Ok: true} return nil } diff --git a/sieve_server/test_coordinator.go b/sieve_server/test_coordinator.go index 3abf5cf3c37..0d91d6c8784 100644 --- a/sieve_server/test_coordinator.go +++ b/sieve_server/test_coordinator.go @@ -443,25 +443,25 @@ func (tc *testCoordinator) NotifyTestAfterControllerRecv(request *sieve.NotifyTe } func (tc *testCoordinator) NotifyTestAfterControllerGet(request *sieve.NotifyTestAfterControllerGetRequest, response *sieve.Response) error { - log.Printf("NotifyTestAfterControllerGet\t%s\t%s\t%s", request.ResourceKey, request.ReconcilerType, request.Object) - tc.InitializeObjectStatesEntry(request.ReconcilerType, beforeControllerWrite, request.ResourceKey) - tc.InitializeObjectStatesEntry(request.ReconcilerType, afterControllerWrite, request.ResourceKey) - tc.WriteToObjectStates(request.ReconcilerType, beforeControllerWrite, request.ResourceKey, request.Object) - tc.WriteToObjectStates(request.ReconcilerType, afterControllerWrite, request.ResourceKey, request.Object) + log.Printf("NotifyTestAfterControllerGet\t%s\t%s\t%s", request.ResourceKey, request.ReconcileFun, request.Object) + tc.InitializeObjectStatesEntry(request.ReconcileFun, beforeControllerWrite, request.ResourceKey) + tc.InitializeObjectStatesEntry(request.ReconcileFun, afterControllerWrite, request.ResourceKey) + tc.WriteToObjectStates(request.ReconcileFun, beforeControllerWrite, request.ResourceKey, request.Object) + tc.WriteToObjectStates(request.ReconcileFun, afterControllerWrite, request.ResourceKey, request.Object) *response = sieve.Response{Message: "", Ok: true} return nil } func (tc *testCoordinator) NotifyTestAfterControllerList(request *sieve.NotifyTestAfterControllerListRequest, response *sieve.Response) error { - log.Printf("NotifyTestAfterControllerList\t%s\t%s\t%s", request.ResourceType, request.ReconcilerType, request.ObjectList) + log.Printf("NotifyTestAfterControllerList\t%s\t%s\t%s", request.ResourceType, request.ReconcileFun, request.ObjectList) objects := strToSlice(request.ObjectList) for _, objectState := range objects { name, namespace := extractNameNamespaceFromObjMap(objectState) resourceKey := generateResourceKey(request.ResourceType, namespace, name) - tc.InitializeObjectStatesEntry(request.ReconcilerType, beforeControllerWrite, resourceKey) - tc.InitializeObjectStatesEntry(request.ReconcilerType, afterControllerWrite, resourceKey) - tc.WriteToObjectStates(request.ReconcilerType, beforeControllerWrite, resourceKey, mapToStr(objectState)) - tc.WriteToObjectStates(request.ReconcilerType, afterControllerWrite, resourceKey, mapToStr(objectState)) + tc.InitializeObjectStatesEntry(request.ReconcileFun, beforeControllerWrite, resourceKey) + tc.InitializeObjectStatesEntry(request.ReconcileFun, afterControllerWrite, resourceKey) + tc.WriteToObjectStates(request.ReconcileFun, beforeControllerWrite, resourceKey, mapToStr(objectState)) + tc.WriteToObjectStates(request.ReconcileFun, afterControllerWrite, resourceKey, mapToStr(objectState)) } *response = sieve.Response{Message: "", Ok: true} return nil @@ -485,20 +485,20 @@ func (tc *testCoordinator) NotifyTestAfterControllerWritePause(request *sieve.No func (tc *testCoordinator) NotifyTestBeforeControllerWrite(request *sieve.NotifyTestBeforeControllerWriteRequest, response *sieve.Response) error { handlerName := "NotifyTestBeforeControllerWrite" - log.Printf("%s\t%s\t%s\t%s\t%s", handlerName, request.WriteType, request.ResourceKey, request.ReconcilerType, request.Object) - tc.InitializeObjectStatesEntry(request.ReconcilerType, beforeControllerWrite, request.ResourceKey) - prevObjectStateStr := tc.ReadFromObjectStates(request.ReconcilerType, beforeControllerWrite, request.ResourceKey) + log.Printf("%s\t%s\t%s\t%s\t%s", handlerName, request.WriteType, request.ResourceKey, request.ReconcileFun, request.Object) + tc.InitializeObjectStatesEntry(request.ReconcileFun, beforeControllerWrite, request.ResourceKey) + prevObjectStateStr := tc.ReadFromObjectStates(request.ReconcileFun, beforeControllerWrite, request.ResourceKey) switch request.WriteType { case WRITE_CREATE: - tc.SendObjectCreateNotificationAndBlock(handlerName, request.ResourceKey, beforeControllerWrite, request.ReconcilerType) + tc.SendObjectCreateNotificationAndBlock(handlerName, request.ResourceKey, beforeControllerWrite, request.ReconcileFun) case WRITE_UPDATE, WRITE_PATCH, WRITE_STATUS_UPDATE, WRITE_STATUS_PATCH: prevObjectState := strToMap(prevObjectStateStr) trimKindApiversion(prevObjectState) curObjectState := strToMap(request.Object) trimKindApiversion(curObjectState) - tc.SendObjectUpdateNotificationAndBlock(handlerName, request.ResourceKey, beforeControllerWrite, request.ReconcilerType, prevObjectState, curObjectState) + tc.SendObjectUpdateNotificationAndBlock(handlerName, request.ResourceKey, beforeControllerWrite, request.ReconcileFun, prevObjectState, curObjectState) case WRITE_DELETE: - tc.SendObjectDeleteNotificationAndBlock(handlerName, request.ResourceKey, beforeControllerWrite, request.ReconcilerType) + tc.SendObjectDeleteNotificationAndBlock(handlerName, request.ResourceKey, beforeControllerWrite, request.ReconcileFun) default: log.Printf("do not support %s\n", request.WriteType) } @@ -509,20 +509,20 @@ func (tc *testCoordinator) NotifyTestBeforeControllerWrite(request *sieve.Notify func (tc *testCoordinator) NotifyTestAfterControllerWrite(request *sieve.NotifyTestAfterControllerWriteRequest, response *sieve.Response) error { handlerName := "NotifyTestAfterControllerWrite" - log.Printf("%s\t%s\t%s\t%s\t%s", handlerName, request.WriteType, request.ResourceKey, request.ReconcilerType, request.Object) - tc.InitializeObjectStatesEntry(request.ReconcilerType, afterControllerWrite, request.ResourceKey) - prevObjectStateStr := tc.ReadFromObjectStates(request.ReconcilerType, afterControllerWrite, request.ResourceKey) + log.Printf("%s\t%s\t%s\t%s\t%s", handlerName, request.WriteType, request.ResourceKey, request.ReconcileFun, request.Object) + tc.InitializeObjectStatesEntry(request.ReconcileFun, afterControllerWrite, request.ResourceKey) + prevObjectStateStr := tc.ReadFromObjectStates(request.ReconcileFun, afterControllerWrite, request.ResourceKey) switch request.WriteType { case WRITE_CREATE: - tc.SendObjectCreateNotificationAndBlock(handlerName, request.ResourceKey, afterControllerWrite, request.ReconcilerType) + tc.SendObjectCreateNotificationAndBlock(handlerName, request.ResourceKey, afterControllerWrite, request.ReconcileFun) case WRITE_UPDATE, WRITE_PATCH, WRITE_STATUS_UPDATE, WRITE_STATUS_PATCH: prevObjectState := strToMap(prevObjectStateStr) trimKindApiversion(prevObjectState) curObjectState := strToMap(request.Object) trimKindApiversion(curObjectState) - tc.SendObjectUpdateNotificationAndBlock(handlerName, request.ResourceKey, afterControllerWrite, request.ReconcilerType, prevObjectState, curObjectState) + tc.SendObjectUpdateNotificationAndBlock(handlerName, request.ResourceKey, afterControllerWrite, request.ReconcileFun, prevObjectState, curObjectState) case WRITE_DELETE: - tc.SendObjectDeleteNotificationAndBlock(handlerName, request.ResourceKey, afterControllerWrite, request.ReconcilerType) + tc.SendObjectDeleteNotificationAndBlock(handlerName, request.ResourceKey, afterControllerWrite, request.ReconcileFun) default: log.Printf("do not support %s\n", request.WriteType) } @@ -549,16 +549,16 @@ func (tc *testCoordinator) NotifyTestAfterControllerReadPause(request *sieve.Not func (tc *testCoordinator) NotifyTestBeforeAnnotatedAPICall(request *sieve.NotifyTestBeforeAnnotatedAPICallRequest, response *sieve.Response) error { handlerName := "NotifyTestBeforeAnnotatedAPICall" - log.Printf("%s\t%s\t%s\t%s\t%s\t%s", handlerName, request.ModuleName, request.FilePath, request.ReceiverType, request.FunName, request.ReconcilerType) - tc.SendAnnotatedAPICallNotificationAndBlock(handlerName, request.ModuleName, request.FilePath, request.ReceiverType, request.FunName, beforeAnnotatedAPICall, request.ReconcilerType) + log.Printf("%s\t%s\t%s\t%s\t%s\t%s", handlerName, request.ModuleName, request.FilePath, request.ReceiverType, request.FunName, request.ReconcileFun) + tc.SendAnnotatedAPICallNotificationAndBlock(handlerName, request.ModuleName, request.FilePath, request.ReceiverType, request.FunName, beforeAnnotatedAPICall, request.ReconcileFun) *response = sieve.Response{Message: "", Ok: true} return nil } func (tc *testCoordinator) NotifyTestAfterAnnotatedAPICall(request *sieve.NotifyTestAfterAnnotatedAPICallRequest, response *sieve.Response) error { handlerName := "NotifyTestAfterAnnotatedAPICall" - log.Printf("%s\t%s\t%s\t%s\t%s\t%s", handlerName, request.ModuleName, request.FilePath, request.ReceiverType, request.FunName, request.ReconcilerType) - tc.SendAnnotatedAPICallNotificationAndBlock(handlerName, request.ModuleName, request.FilePath, request.ReceiverType, request.FunName, afterAnnotatedAPICall, request.ReconcilerType) + log.Printf("%s\t%s\t%s\t%s\t%s\t%s", handlerName, request.ModuleName, request.FilePath, request.ReceiverType, request.FunName, request.ReconcileFun) + tc.SendAnnotatedAPICallNotificationAndBlock(handlerName, request.ModuleName, request.FilePath, request.ReceiverType, request.FunName, afterAnnotatedAPICall, request.ReconcileFun) *response = sieve.Response{Message: "", Ok: true} return nil }