Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: moves the admission-webhook code into pkg/webhook from api #516

Merged
merged 5 commits into from
Jun 26, 2024

Conversation

cyberchen98
Copy link
Contributor

@cyberchen98 cyberchen98 commented Jun 19, 2024

User description

What type of PR is this?

  • API-change
  • BUG
  • Improvement
  • Documentation
  • Feature
  • Test and CI
  • Code Refactoring

Which issue(s) this PR fixes:
#333

What this PR does / why we need it:

  • Moved all admission-webhook related files and directories from api/ to
    pkg/webhook/
  • Implement enhanced CR validation in webhook (will be done in following PR)

Special notes for your reviewer:

Not Available

Additional documentation (e.g. design docs, usage docs, etc.):

Not Available


PR Type

Enhancement, Tests


Description

  • Moved all admission-webhook related files and directories from api/ to pkg/webhook/.
  • Added new webhook implementations for CNSet, DNSet, LogSet, MatrixOneCluster, ProxySet, and WebUI in pkg/webhook.
  • Added corresponding tests for the new webhook implementations.
  • Updated logging and utility functions.
  • Updated dependencies and Makefile for new webhook structure.

Changes walkthrough 📝

Relevant files
Enhancement
16 files
cnset_webhook.go
Remove CNSet webhook from api/core/v1alpha1                           

api/core/v1alpha1/cnset_webhook.go

  • Removed the CNSet webhook implementation from the api/core/v1alpha1
    directory.
  • +0/-136 
    dnset_webhook.go
    Remove DNSet webhook from api/core/v1alpha1                           

    api/core/v1alpha1/dnset_webhook.go

  • Removed the DNSet webhook implementation from the api/core/v1alpha1
    directory.
  • +0/-99   
    matrixonecluster_webhook.go
    Remove MatrixOneCluster webhook from api/core/v1alpha1     

    api/core/v1alpha1/matrixonecluster_webhook.go

  • Removed the MatrixOneCluster webhook implementation from the
    api/core/v1alpha1 directory.
  • +0/-138 
    common_helpers.go
    Update logging in common_helpers.go                                           

    api/core/v1alpha1/common_helpers.go

    • Updated logging to use logf.Log.WithName.
    +2/-1     
    logset_helpers.go
    Add setDefaultRetentionPolicy to LogSetSpec                           

    api/core/v1alpha1/logset_helpers.go

    • Added setDefaultRetentionPolicy method to LogSetSpec.
    +32/-0   
    logset_types.go
    Add defaultStoreFailureTimeout constant                                   

    api/core/v1alpha1/logset_types.go

    • Added defaultStoreFailureTimeout constant.
    +5/-0     
    main.go
    Update webhook registration in main.go                                     

    cmd/operator/main.go

    • Updated webhook registration to use the new package structure.
    +2/-1     
    cnset_webhook.go
    Add CNSet webhook implementation                                                 

    pkg/webhook/cnset_webhook.go

    • Added CNSet webhook implementation in the pkg/webhook directory.
    +158/-0 
    dnset_webhook.go
    Add DNSet webhook implementation                                                 

    pkg/webhook/dnset_webhook.go

    • Added DNSet webhook implementation in the pkg/webhook directory.
    +120/-0 
    logset_webhook.go
    Add LogSet webhook implementation                                               

    pkg/webhook/logset_webhook.go

    • Added LogSet webhook implementation in the pkg/webhook directory.
    +103/-83
    matrixonecluster_webhook.go
    Add MatrixOneCluster webhook implementation                           

    pkg/webhook/matrixonecluster_webhook.go

  • Added MatrixOneCluster webhook implementation in the pkg/webhook
    directory.
  • +174/-0 
    proxy_webhook.go
    Add ProxySet webhook implementation                                           

    pkg/webhook/proxy_webhook.go

  • Added ProxySet webhook implementation in the pkg/webhook directory.
  • +31/-14 
    utils.go
    Add utility functions for webhooks                                             

    pkg/webhook/utils.go

    • Added utility functions for webhooks.
    +97/-0   
    webhook.go
    Add centralized webhook registration                                         

    pkg/webhook/webhook.go

  • Added centralized webhook registration in the pkg/webhook directory.
  • +44/-0   
    webui_webhook.go
    Add WebUI webhook implementation                                                 

    pkg/webhook/webui_webhook.go

    • Added WebUI webhook implementation in the pkg/webhook directory.
    +32/-15 
    Makefile
    Add envtest setup for unit tests                                                 

    Makefile

    • Added envtest setup for unit tests.
    +13/-1   
    Tests
    7 files
    cnset_webhook_test.go
    Add tests for CNSet webhook                                                           

    pkg/webhook/cnset_webhook_test.go

    • Added tests for CNSet webhook in the pkg/webhook directory.
    +31/-28 
    dnset_webhook_test.go
    Add tests for DNSet webhook                                                           

    pkg/webhook/dnset_webhook_test.go

    • Added tests for DNSet webhook in the pkg/webhook directory.
    +27/-24 
    logset_webhook_test.go
    Add tests for LogSet webhook                                                         

    pkg/webhook/logset_webhook_test.go

    • Added tests for LogSet webhook in the pkg/webhook directory.
    +19/-16 
    matrixonecluster_webhook_test.go
    Add tests for MatrixOneCluster webhook                                     

    pkg/webhook/matrixonecluster_webhook_test.go

  • Added tests for MatrixOneCluster webhook in the pkg/webhook directory.

  • +89/-86 
    proxy_webhook_test.go
    Add tests for ProxySet webhook                                                     

    pkg/webhook/proxy_webhook_test.go

    • Added tests for ProxySet webhook in the pkg/webhook directory.
    +11/-9   
    webhook_suite_test.go
    Add test suite setup for webhooks                                               

    pkg/webhook/webhook_suite_test.go

    • Added test suite setup for webhooks.
    +7/-5     
    matrixonecluster_test.go
    Update e2e tests for new webhook constants                             

    test/e2e/matrixonecluster_test.go

    • Updated e2e tests to use new webhook constants.
    +2/-1     
    Dependencies
    2 files
    go.mod
    Update dependencies for new webhook implementation             

    go.mod

    • Updated dependencies for new webhook implementation.
    +3/-0     
    go.sum
    Update dependencies for new webhook implementation             

    go.sum

    • Updated dependencies for new webhook implementation.
    +3/-0     

    💡 PR-Agent usage:
    Comment /help on the PR to get a list of all available PR-Agent tools and their descriptions

    Copy link

    PR-Agent was enabled for this repository. To continue using it, please link your git user with your CodiumAI identity here.

    PR Reviewer Guide 🔍

    ⏱️ Estimated effort to review [1-5] 4
    🧪 Relevant tests No
    🔒 Security concerns No
    ⚡ Key issues to review Possible Bug:
    The refactoring of webhook registration and handling in pkg/webhook might introduce issues with the webhook lifecycle, especially if the new setup functions in individual webhook files like cnset_webhook.go and dnset_webhook.go are not correctly managing the lifecycle events.
    Code Duplication:
    There seems to be a significant amount of duplicated logic in the Default and ValidateCreate methods across different webhook handlers. Consider abstracting common functionality into shared methods or a base struct to improve maintainability.
    Error Handling:
    The error handling in the new webhook setup does not robustly handle potential runtime errors. Ensure that all possible error paths are accounted for and that errors are handled or logged appropriately.

    Copy link

    PR-Agent was enabled for this repository. To continue using it, please link your git user with your CodiumAI identity here.

    PR Code Suggestions ✨

    CategorySuggestion                                                                                                                                    Score
    Possible bug
    Add a nil check for spec.Replicas before dereferencing it

    *Add a check to ensure spec.Replicas is not nil before comparing it with lrs to avoid
    potential nil pointer dereference.

    pkg/webhook/logset_webhook.go [230]

    -} else if *lrs > int(spec.Replicas) {
    +} else if spec.Replicas != nil && *lrs > int(*spec.Replicas) {
     
    • Apply this suggestion
    Suggestion importance[1-10]: 8

    Why: This is a valid and important suggestion to prevent a potential runtime panic due to nil pointer dereference when accessing spec.Replicas.

    8
    Add a nil check for spec.SharedStorage.S3 before assigning pvcPolicy to S3RetentionPolicy

    To avoid potential nil pointer dereference, add a check to ensure
    spec.SharedStorage.S3.S3RetentionPolicy is not nil before assigning pvcPolicy to it.

    pkg/webhook/logset_webhook.go [126-127]

     case pvcPolicy != nil && s3Policy == nil:
    -  spec.SharedStorage.S3.S3RetentionPolicy = pvcPolicy
    +  if spec.SharedStorage.S3 != nil {
    +    spec.SharedStorage.S3.S3RetentionPolicy = pvcPolicy
    +  }
     
    • Apply this suggestion
    Suggestion importance[1-10]: 8

    Why: This suggestion correctly addresses a potential nil pointer dereference, ensuring that spec.SharedStorage.S3 is not nil before accessing its S3RetentionPolicy.

    8
    Add a nil check for moc.Spec.DN before calling m.dn.ValidateSpecCreate

    The validateMutateCommon function should check if moc.Spec.DN is nil before calling
    m.dn.ValidateSpecCreate(moc.GetTN()) to avoid potential nil pointer dereference.

    pkg/webhook/matrixonecluster_webhook.go [141]

    -errs = append(errs, m.dn.ValidateSpecCreate(moc.GetTN())...)
    +if moc.Spec.DN != nil {
    +    errs = append(errs, m.dn.ValidateSpecCreate(moc.GetTN())...)
    +}
     
    Suggestion importance[1-10]: 8

    Why: The suggestion correctly identifies a potential nil pointer dereference issue in the validateMutateCommon function, which is a critical bug fix.

    8
    Add a nil check for spec.ScalingConfig before accessing its fields

    In the DefaultSpec method, add a nil check for spec.ScalingConfig before accessing its
    fields to prevent potential nil pointer dereference.

    pkg/webhook/cnset_webhook.go [84-87]

    -if spec.ScalingConfig.StoreDrainEnabled != nil && *spec.ScalingConfig.StoreDrainEnabled {
    -    if spec.ScalingConfig.StoreDrainTimeout == nil {
    -        spec.ScalingConfig.StoreDrainTimeout = &metav1.Duration{Duration: defaultStoreDrainTimeout}
    +if spec.ScalingConfig != nil {
    +    if spec.ScalingConfig.StoreDrainEnabled != nil && *spec.ScalingConfig.StoreDrainEnabled {
    +        if spec.ScalingConfig.StoreDrainTimeout == nil {
    +            spec.ScalingConfig.StoreDrainTimeout = &metav1.Duration{Duration: defaultStoreDrainTimeout}
    +        }
         }
     }
     
    • Apply this suggestion
    Suggestion importance[1-10]: 8

    Why: This suggestion correctly addresses a potential nil pointer dereference by adding a necessary nil check before accessing spec.ScalingConfig fields, which is crucial for preventing runtime errors.

    8
    Add a nil check for moc.Spec.CNGroups before iterating over it

    In the Default method of matrixOneClusterDefaulter, add a nil check for moc.Spec.CNGroups
    before iterating over it to prevent potential nil pointer dereference.

    pkg/webhook/matrixonecluster_webhook.go [83-85]

    -for i := range moc.Spec.CNGroups {
    -    m.cn.DefaultSpec(&moc.Spec.CNGroups[i].CNSetSpec)
    +if moc.Spec.CNGroups != nil {
    +    for i := range moc.Spec.CNGroups {
    +        m.cn.DefaultSpec(&moc.Spec.CNGroups[i].CNSetSpec)
    +    }
     }
     
    • Apply this suggestion
    Suggestion importance[1-10]: 8

    Why: The suggestion is valid as it prevents a potential nil pointer dereference by adding a nil check before iterating over moc.Spec.CNGroups, which is essential for robust code.

    8
    Add validation for the Replicas field to ensure it is always greater than zero

    Consider adding validation for the Replicas field to ensure it is always greater than
    zero, which can prevent potential runtime errors.

    pkg/webhook/matrixonecluster_webhook_test.go [46]

    -Replicas: 3,
    +Replicas: func() int {
    +  if replicas := 3; replicas > 0 {
    +    return replicas
    +  }
    +  t.Fatalf("Replicas must be greater than zero")
    +  return 0
    +}(),
     
    • Apply this suggestion
    Suggestion importance[1-10]: 6

    Why: Adding validation for the Replicas field to ensure it's greater than zero is important for preventing runtime errors and ensuring the integrity of the application state. This suggestion addresses a potential bug, enhancing the robustness of the code.

    6
    Maintainability
    Refactor to use a helper function for creating v1alpha1.MatrixOneCluster instances to reduce code duplication

    Consider using a helper function to create instances of v1alpha1.MatrixOneCluster to avoid
    code duplication and improve maintainability. This will make the code cleaner and easier
    to update in the future.

    pkg/webhook/matrixonecluster_webhook_test.go [37-65]

    -v06 := &v1alpha1.MatrixOneCluster{
    -  ObjectMeta: metav1.ObjectMeta{
    -    Name:      "mo-" + randomString(5),
    -    Namespace: "default",
    -  },
    -  Spec: v1alpha1.MatrixOneClusterSpec{
    -    LogService: v1alpha1.LogSetSpec{
    -      PodSet: v1alpha1.PodSet{
    -        Replicas: 3,
    +func createMatrixOneCluster(name, namespace string, logReplicas, tnReplicas, tpReplicas int) *v1alpha1.MatrixOneCluster {
    +  return &v1alpha1.MatrixOneCluster{
    +    ObjectMeta: metav1.ObjectMeta{
    +      Name:      name,
    +      Namespace: namespace,
    +    },
    +    Spec: v1alpha1.MatrixOneClusterSpec{
    +      LogService: v1alpha1.LogSetSpec{
    +        PodSet: v1alpha1.PodSet{
    +          Replicas: logReplicas,
    +        },
    +        Volume: v1alpha1.Volume{
    +          Size: resource.MustParse("10Gi"),
    +        },
    +        SharedStorage: v1alpha1.SharedStorageProvider{
    +          S3: &v1alpha1.S3Provider{Path: "test/data"},
    +        },
           },
    -      Volume: v1alpha1.Volume{
    -        Size: resource.MustParse("10Gi"),
    +      TN: &v1alpha1.DNSetSpec{
    +        PodSet: v1alpha1.PodSet{
    +          Replicas: tnReplicas,
    +        },
           },
    -      SharedStorage: v1alpha1.SharedStorageProvider{
    -        S3: &v1alpha1.S3Provider{Path: "test/data"},
    +      TP: &v1alpha1.CNSetSpec{
    +        PodSet: v1alpha1.PodSet{
    +          Replicas: tpReplicas,
    +        },
           },
    +      Version: "test",
         },
    -    TN: &v1alpha1.DNSetSpec{
    -      PodSet: v1alpha1.PodSet{
    -        Replicas: 2,
    -      },
    -    },
    -    TP: &v1alpha1.CNSetSpec{
    -      PodSet: v1alpha1.PodSet{
    -        Replicas: 2,
    -      },
    -    },
    -    Version: "test",
    -  },
    +  }
     }
     
    +v06 := createMatrixOneCluster("mo-"+randomString(5), "default", 3, 2, 2)
    +
    • Apply this suggestion
    Suggestion importance[1-10]: 7

    Why: The suggestion correctly identifies code duplication in the creation of v1alpha1.MatrixOneCluster instances and proposes a helper function to improve maintainability. This is a good practice for cleaner and more maintainable code.

    7
    Refactor to use a helper function for creating v1alpha1.CNSet objects to reduce code duplication

    Consider using a helper function to create the v1alpha1.CNSet objects to avoid code
    duplication and improve maintainability.

    pkg/webhook/cnset_webhook_test.go [34-52]

    -v06 := &v1alpha1.CNSet{
    -  ObjectMeta: metav1.ObjectMeta{
    -    Name:      "cn-" + randomString(5),
    -    Namespace: "default",
    -  },
    -  Spec: v1alpha1.CNSetSpec{
    -    PodSet: v1alpha1.PodSet{
    -      Replicas: 2,
    -      MainContainer: v1alpha1.MainContainer{
    -        Image: "test",
    -      },
    +func createCNSet(name, namespace, image string, replicas int) *v1alpha1.CNSet {
    +  return &v1alpha1.CNSet{
    +    ObjectMeta: metav1.ObjectMeta{
    +      Name:      name,
    +      Namespace: namespace,
         },
    -  },
    -  Deps: v1alpha1.CNSetDeps{
    -    LogSetRef: v1alpha1.LogSetRef{
    -      LogSet: &v1alpha1.LogSet{
    -        ObjectMeta: metav1.ObjectMeta{
    -          Name:      "test",
    -          Namespace: "default",
    +    Spec: v1alpha1.CNSetSpec{
    +      PodSet: v1alpha1.PodSet{
    +        Replicas: replicas,
    +        MainContainer: v1alpha1.MainContainer{
    +          Image: image,
             },
           },
         },
    -  },
    +    Deps: v1alpha1.CNSetDeps{
    +      LogSetRef: v1alpha1.LogSetRef{
    +        LogSet: &v1alpha1.LogSet{
    +          ObjectMeta: metav1.ObjectMeta{
    +            Name:      "test",
    +            Namespace: "default",
    +          },
    +        },
    +      },
    +    },
    +  }
     }
    +v06 := createCNSet("cn-"+randomString(5), "default", "test", 2)
     
    • Apply this suggestion
    Suggestion importance[1-10]: 7

    Why: The suggestion correctly identifies repeated code patterns in the creation of v1alpha1.CNSet objects and proposes a helper function to improve maintainability. This is a good practice in coding to avoid duplication.

    7
    Best practice
    Rename the struct to follow Go's convention for exported types

    To improve readability and maintainability, consider renaming the logSetWebhook struct to
    LogSetWebhook to follow Go's convention of capitalizing the first letter of exported
    types.

    pkg/webhook/logset_webhook.go [45]

    -type logSetWebhook struct{}
    +type LogSetWebhook struct{}
     
    • Apply this suggestion
    Suggestion importance[1-10]: 6

    Why: The suggestion correctly identifies a naming convention issue for the struct logSetWebhook which should be LogSetWebhook to indicate it's exported in Go.

    6
    Ensure that the k8sClient.Create function calls are properly checked for errors

    Ensure that the k8sClient.Create function calls are properly checked for errors and handle
    them appropriately to avoid potential test failures.

    pkg/webhook/cnset_webhook_test.go [116]

    -Expect(k8sClient.Create(context.TODO(), emptyLabelKey)).NotTo(Succeed())
    +err := k8sClient.Create(context.TODO(), emptyLabelKey)
    +Expect(err).NotTo(Succeed())
     
    • Apply this suggestion
    Suggestion importance[1-10]: 6

    Why: Proper error checking for k8sClient.Create function calls is crucial in tests to ensure that failures are caught and handled correctly. This suggestion promotes better error handling practices in test code.

    6
    Use constants for repeated string literals to avoid typos and simplify future changes

    Use constants for repeated string literals like "default" namespace to avoid typos and
    make future changes easier.

    pkg/webhook/matrixonecluster_webhook_test.go [40]

    -Namespace: "default",
    +const defaultNamespace = "default"
     
    +Namespace: defaultNamespace,
    +
    • Apply this suggestion
    Suggestion importance[1-10]: 5

    Why: Using constants for repeated literals like "default" is a good practice for maintainability and avoiding typos, but it's a relatively minor improvement in the context of the entire codebase.

    5
    Possible issue
    Add error handling for the randomString function to ensure it does not return an empty string

    Add error handling for the randomString function to ensure it does not return an empty
    string, which could lead to invalid Kubernetes object names.

    pkg/webhook/matrixonecluster_webhook_test.go [39]

    -Name:      "mo-" + randomString(5),
    +name := randomString(5)
    +if name == "" {
    +  t.Fatalf("randomString returned an empty string")
    +}
    +Name:      "mo-" + name,
     
    • Apply this suggestion
    Suggestion importance[1-10]: 6

    Why: Adding error handling for the randomString function is a valid concern to prevent potential issues with invalid Kubernetes object names. However, it's a moderate improvement since the likelihood of randomString returning an empty string should be low if implemented correctly.

    6
    Add error handling for the randomString function to ensure valid object names

    Add error handling for the randomString function to ensure it does not return an empty
    string, which could lead to invalid object names.

    pkg/webhook/cnset_webhook_test.go [36]

    -Name:      "cn-" + randomString(5),
    +name := randomString(5)
    +if name == "" {
    +  // handle error, e.g., log and return
    +}
    +Name:      "cn-" + name,
     
    • Apply this suggestion
    Suggestion importance[1-10]: 6

    Why: This suggestion is valid as it addresses potential issues with the randomString function returning an empty string, which could lead to invalid Kubernetes object names. Adding error handling is a good practice to ensure robustness.

    6
    Validate the resource.MustParse input to ensure it is a valid quantity string

    Validate the resource.MustParse input to ensure it is a valid quantity string to prevent
    runtime panics.

    pkg/webhook/cnset_webhook_test.go [76]

    -Size: resource.MustParse("20Gi"),
    +size, err := resource.ParseQuantity("20Gi")
    +if err != nil {
    +  // handle error, e.g., log and return
    +}
    +Size: size,
     
    • Apply this suggestion
    Suggestion importance[1-10]: 6

    Why: The suggestion to validate the input for resource.MustParse is important to prevent runtime errors or panics due to invalid input. This is a good practice for ensuring the stability of the application.

    6
    Performance
    Cache the result of field.NewPath("spec") to improve performance

    To improve performance, consider caching the result of field.NewPath("spec") in a variable
    and reusing it instead of calling the function multiple times.

    pkg/webhook/logset_webhook.go [149-189]

    -errs = append(errs, validateMainContainer(&logSet.Spec.MainContainer, field.NewPath("spec"))...)
    -errs = append(errs, validateVolume(&spec.Volume, field.NewPath("spec").Child("volume"))...)
    -errs = append(errs, validateGoMemLimitPercent(spec.MemoryLimitPercent, field.NewPath("spec").Child("memoryLimitPercent"))...)
    +specPath := field.NewPath("spec")
    +errs = append(errs, validateMainContainer(&logSet.Spec.MainContainer, specPath)...)
    +errs = append(errs, validateVolume(&spec.Volume, specPath.Child("volume"))...)
    +errs = append(errs, validateGoMemLimitPercent(spec.MemoryLimitPercent, specPath.Child("memoryLimitPercent"))...)
     
    Suggestion importance[1-10]: 4

    Why: While caching field.NewPath("spec") might slightly improve performance, the impact is minimal given the context and frequency of calls in typical webhook operations. This is a minor optimization.

    4

    Copy link

    PR-Agent was enabled for this repository. To continue using it, please link your git user with your CodiumAI identity here.

    CI Failure Feedback 🧐

    Action: checks

    Failed stage: Run /./.github/actions/checks [❌]

    Failed test name: TestAPIs

    Failure summary:

    The action failed due to the following reasons:

  • The test TestAPIs failed because the control plane could not be started.
  • The error message indicates that the executable etcd was not found in the $PATH.
  • This caused the BeforeSuite setup to fail, leading to a panic due to an invalid memory address or
    nil pointer dereference during the AfterSuite teardown.

  • Relevant error logs:
    1:  ##[group]Operating System
    2:  Ubuntu
    ...
    
    601:  Adding to the cache ...
    602:  Successfully cached go to /opt/hostedtoolcache/go/1.18.10/x64
    603:  Added go to the path
    604:  Successfully set up Go version 1.18
    605:  [command]/opt/hostedtoolcache/go/1.18.10/x64/bin/go env GOMODCACHE
    606:  [command]/opt/hostedtoolcache/go/1.18.10/x64/bin/go env GOCACHE
    607:  /home/runner/go/pkg/mod
    608:  /home/runner/.cache/go-build
    609:  ##[warning]Restore cache failed: Some specified paths were not resolved, unable to cache dependencies.
    ...
    
    807:  go: downloading github.com/gogo/protobuf v1.3.2
    808:  go: downloading k8s.io/utils v0.0.0-20220210201930-3a6ce19ff2f9
    809:  go: downloading k8s.io/klog/v2 v2.60.1
    810:  go: downloading sigs.k8s.io/structured-merge-diff/v4 v4.2.1
    811:  go: downloading github.com/google/gofuzz v1.1.0
    812:  go: downloading github.com/mattn/go-colorable v0.1.8
    813:  go: downloading github.com/mattn/go-isatty v0.0.12
    814:  go: downloading golang.org/x/sys v0.0.0-20220209214540-3681064d5158
    815:  go: downloading golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1
    ...
    
    837:  go: downloading github.com/goccy/go-yaml v1.1.5
    838:  go: downloading golang.org/x/tools v0.0.0-20191114161115-faa69481e761
    839:  go: downloading k8s.io/apimachinery v0.0.0-20190913080033-27d36303b655
    840:  go: downloading sigs.k8s.io/controller-tools v0.2.2
    841:  go: downloading github.com/Masterminds/sprig v2.22.0+incompatible
    842:  go: downloading github.com/spf13/pflag v1.0.3
    843:  go: downloading go.uber.org/atomic v1.5.0
    844:  go: downloading go.uber.org/multierr v1.4.0
    845:  go: downloading golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543
    ...
    
    863:  go: downloading k8s.io/klog v0.4.0
    864:  go: downloading gopkg.in/yaml.v2 v2.2.2
    865:  go: downloading golang.org/x/sys v0.0.0-20191210023423-ac6580df4449
    866:  go: downloading golang.org/x/net v0.0.0-20190812203447-cdfb69ac37fc
    867:  go: downloading golang.org/x/text v0.3.2
    868:  /home/runner/work/matrixone-operator/matrixone-operator/api/bin/crd-ref-docs --source-path=core/v1alpha1 --renderer=markdown --output-path ../docs/reference/api-reference.md
    869:  �[34mINFO�[0m	crd-ref-docs	Loading configuration	{"path": "config.yaml"}
    870:  �[34mINFO�[0m	crd-ref-docs	Processing source directory	{"directory": "core/v1alpha1", "depth": 6}
    871:  �[33mWARN�[0m	crd-ref-docs	Failed to find type	{"name": "Quantity", "package": "k8s.io/apimachinery/pkg/api/resource"}
    872:  �[33mWARN�[0m	crd-ref-docs	Failed to find type	{"name": "IntOrString", "package": "k8s.io/apimachinery/pkg/util/intstr"}
    ...
    
    915:  go: downloading github.com/prometheus/client_model v0.4.1-0.20230718164431-9a2bf3000d16
    916:  go: downloading github.com/prometheus/common v0.44.0
    917:  go: downloading github.com/prometheus/procfs v0.11.1
    918:  go: downloading google.golang.org/protobuf v1.33.0
    919:  go: downloading github.com/aws/smithy-go v1.13.5
    920:  go: downloading github.com/matrixorigin/dragonboat/v4 v4.0.0-20240312080931-1b40809d7cea
    921:  go: downloading github.com/robfig/cron/v3 v3.0.1
    922:  go: downloading gopkg.in/natefinch/lumberjack.v2 v2.2.1
    923:  go: downloading github.com/cockroachdb/errors v1.9.1
    ...
    
    976:  go: downloading golang.org/x/text v0.14.0
    977:  go: downloading github.com/google/go-cmp v0.6.0
    978:  go: downloading github.com/kr/text v0.2.0
    979:  go: downloading github.com/rogpeppe/go-internal v1.10.0
    980:  go: downloading github.com/valyala/fastrand v1.1.0
    981:  go: downloading github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da
    982:  go: downloading github.com/google/btree v1.1.2
    983:  go: downloading github.com/hashicorp/go-msgpack v0.5.3
    984:  go: downloading github.com/hashicorp/go-multierror v1.1.1
    ...
    
    1034:  github.com/matrixorigin/matrixone-operator/pkg/utils		coverage: 0.0% of statements
    1035:  ok  	github.com/matrixorigin/matrixone-operator/pkg/controllers/webui	0.046s	coverage: 7.8% of statements
    1036:  Running Suite: Webhook Suite
    1037:  ============================
    1038:  Random Seed: �[1m1718791133�[0m
    1039:  Will run �[1m15�[0m of �[1m15�[0m specs
    1040:  �[1mSTEP�[0m: bootstrapping test environment
    1041:  DEBUG	controller-runtime.test-env	starting control plane
    1042:  ERROR	controller-runtime.test-env	unable to start the controlplane	{"tries": 0, "error": "exec: \"etcd\": executable file not found in $PATH"}
    ...
    
    1061:  github.com/onsi/ginkgo.runSpecsWithCustomReporters
    1062:  /home/runner/go/pkg/mod/github.com/onsi/[email protected]/ginkgo_dsl.go:245
    1063:  github.com/onsi/ginkgo.RunSpecs
    1064:  /home/runner/go/pkg/mod/github.com/onsi/[email protected]/ginkgo_dsl.go:220
    1065:  github.com/matrixorigin/matrixone-operator/pkg/webhook.TestAPIs
    1066:  /home/runner/work/matrixone-operator/matrixone-operator/pkg/webhook/webhook_suite_test.go:54
    1067:  testing.tRunner
    1068:  /home/runner/go/pkg/mod/golang.org/[email protected]/src/testing/testing.go:1689
    1069:  ERROR	controller-runtime.test-env	unable to start the controlplane	{"tries": 1, "error": "exec: \"etcd\": executable file not found in $PATH"}
    ...
    
    1088:  github.com/onsi/ginkgo.runSpecsWithCustomReporters
    1089:  /home/runner/go/pkg/mod/github.com/onsi/[email protected]/ginkgo_dsl.go:245
    1090:  github.com/onsi/ginkgo.RunSpecs
    1091:  /home/runner/go/pkg/mod/github.com/onsi/[email protected]/ginkgo_dsl.go:220
    1092:  github.com/matrixorigin/matrixone-operator/pkg/webhook.TestAPIs
    1093:  /home/runner/work/matrixone-operator/matrixone-operator/pkg/webhook/webhook_suite_test.go:54
    1094:  testing.tRunner
    1095:  /home/runner/go/pkg/mod/golang.org/[email protected]/src/testing/testing.go:1689
    1096:  ERROR	controller-runtime.test-env	unable to start the controlplane	{"tries": 2, "error": "exec: \"etcd\": executable file not found in $PATH"}
    ...
    
    1115:  github.com/onsi/ginkgo.runSpecsWithCustomReporters
    1116:  /home/runner/go/pkg/mod/github.com/onsi/[email protected]/ginkgo_dsl.go:245
    1117:  github.com/onsi/ginkgo.RunSpecs
    1118:  /home/runner/go/pkg/mod/github.com/onsi/[email protected]/ginkgo_dsl.go:220
    1119:  github.com/matrixorigin/matrixone-operator/pkg/webhook.TestAPIs
    1120:  /home/runner/work/matrixone-operator/matrixone-operator/pkg/webhook/webhook_suite_test.go:54
    1121:  testing.tRunner
    1122:  /home/runner/go/pkg/mod/golang.org/[email protected]/src/testing/testing.go:1689
    1123:  ERROR	controller-runtime.test-env	unable to start the controlplane	{"tries": 3, "error": "exec: \"etcd\": executable file not found in $PATH"}
    ...
    
    1142:  github.com/onsi/ginkgo.runSpecsWithCustomReporters
    1143:  /home/runner/go/pkg/mod/github.com/onsi/[email protected]/ginkgo_dsl.go:245
    1144:  github.com/onsi/ginkgo.RunSpecs
    1145:  /home/runner/go/pkg/mod/github.com/onsi/[email protected]/ginkgo_dsl.go:220
    1146:  github.com/matrixorigin/matrixone-operator/pkg/webhook.TestAPIs
    1147:  /home/runner/work/matrixone-operator/matrixone-operator/pkg/webhook/webhook_suite_test.go:54
    1148:  testing.tRunner
    1149:  /home/runner/go/pkg/mod/golang.org/[email protected]/src/testing/testing.go:1689
    1150:  ERROR	controller-runtime.test-env	unable to start the controlplane	{"tries": 4, "error": "exec: \"etcd\": executable file not found in $PATH"}
    ...
    
    1172:  /home/runner/go/pkg/mod/github.com/onsi/[email protected]/ginkgo_dsl.go:220
    1173:  github.com/matrixorigin/matrixone-operator/pkg/webhook.TestAPIs
    1174:  /home/runner/work/matrixone-operator/matrixone-operator/pkg/webhook/webhook_suite_test.go:54
    1175:  testing.tRunner
    1176:  /home/runner/go/pkg/mod/golang.org/[email protected]/src/testing/testing.go:1689
    1177:  �[91m�[1mFailure [0.002 seconds]�[0m
    1178:  �[91m�[1m[BeforeSuite] BeforeSuite �[0m
    1179:  �[37m/home/runner/work/matrixone-operator/matrixone-operator/pkg/webhook/webhook_suite_test.go:57�[0m
    1180:  �[91mUnexpected error:
    1181:  <*fmt.wrapError | 0xc0002c2840>: 
    1182:  unable to start control plane itself: failed to start the controlplane. retried 5 times: exec: "etcd": executable file not found in $PATH
    1183:  {
    1184:  msg: "unable to start control plane itself: failed to start the controlplane. retried 5 times: exec: \"etcd\": executable file not found in $PATH",
    1185:  err: <*fmt.wrapError | 0xc0002c2820>{
    1186:  msg: "failed to start the controlplane. retried 5 times: exec: \"etcd\": executable file not found in $PATH",
    1187:  err: <*exec.Error | 0xc0002c27e0>{
    1188:  Name: "etcd",
    1189:  Err: <*errors.errorString | 0x2a22950>{
    ...
    
    1195:  occurred�[0m
    1196:  /home/runner/work/matrixone-operator/matrixone-operator/pkg/webhook/webhook_suite_test.go:72
    1197:  �[90m------------------------------�[0m
    1198:  �[1mSTEP�[0m: tearing down the test environment
    1199:  �[91m�[1mPanic [0.000 seconds]�[0m
    1200:  �[91m�[1m[AfterSuite] AfterSuite �[0m
    1201:  �[37m/home/runner/work/matrixone-operator/matrixone-operator/pkg/webhook/webhook_suite_test.go:126�[0m
    1202:  �[91m�[1mTest Panicked�[0m
    1203:  �[91mruntime error: invalid memory address or nil pointer dereference�[0m
    ...
    
    1230:  github.com/matrixorigin/matrixone-operator/pkg/webhook.TestAPIs(0xc00012eb60)
    1231:  /home/runner/work/matrixone-operator/matrixone-operator/pkg/webhook/webhook_suite_test.go:54 +0x3c
    1232:  testing.tRunner(0xc00012eb60, 0x1b0c020)
    1233:  /home/runner/go/pkg/mod/golang.org/[email protected]/src/testing/testing.go:1689 +0xfb
    1234:  created by testing.(*T).Run in goroutine 1
    1235:  /home/runner/go/pkg/mod/golang.org/[email protected]/src/testing/testing.go:1742 +0x390
    1236:  �[90m------------------------------�[0m
    1237:  �[1m�[91mRan 15 of 0 Specs in 0.002 seconds�[0m
    1238:  �[1m�[91mFAIL!�[0m -- �[32m�[1m0 Passed�[0m | �[91m�[1m15 Failed�[0m | �[33m�[1m0 Pending�[0m | �[36m�[1m0 Skipped�[0m
    1239:  --- FAIL: TestAPIs (0.00s)
    1240:  FAIL
    1241:  coverage: 0.0% of statements
    1242:  FAIL	github.com/matrixorigin/matrixone-operator/pkg/webhook	0.019s
    1243:  FAIL
    1244:  make: *** [Makefile:106: unit] Error 1
    1245:  ##[error]Process completed with exit code 2.
    

    ✨ CI feedback usage guide:

    The CI feedback tool (/checks) automatically triggers when a PR has a failed check.
    The tool analyzes the failed checks and provides several feedbacks:

    • Failed stage
    • Failed test name
    • Failure summary
    • Relevant error logs

    In addition to being automatically triggered, the tool can also be invoked manually by commenting on a PR:

    /checks "https://github.com/{repo_name}/actions/runs/{run_number}/job/{job_number}"
    

    where {repo_name} is the name of the repository, {run_number} is the run number of the failed check, and {job_number} is the job number of the failed check.

    Configuration options

    • enable_auto_checks_feedback - if set to true, the tool will automatically provide feedback when a check is failed. Default is true.
    • excluded_checks_list - a list of checks to exclude from the feedback, for example: ["check1", "check2"]. Default is an empty list.
    • enable_help_text - if set to true, the tool will provide a help message with the feedback. Default is true.
    • persistent_comment - if set to true, the tool will overwrite a previous checks comment with the new feedback. Default is true.
    • final_update_message - if persistent_comment is true and updating a previous checks message, the tool will also create a new message: "Persistent checks updated to latest commit". Default is true.

    See more information about the checks tool in the docs.

    Copy link

    PR-Agent was enabled for this repository. To continue using it, please link your git user with your CodiumAI identity here.

    CI Failure Feedback 🧐

    Action: e2e

    Failed stage: run [❌]

    Failed test name: MatrixOneCluster test [It] Should reconcile the cluster properly

    Failure summary:

    The action failed due to multiple errors encountered during the end-to-end (e2e) tests. The primary
    reasons for the failures are:

  • A version mismatch between the Ginkgo CLI and the version of Ginkgo imported by the packages.
  • Multiple tests failed due to an internal error when calling the webhook vmatrixonecluster.kb.io. The
    specific error was failed to call webhook: Post
    "https://webhook-service.mo-system.svc:443/validate-core-matrixorigin-io-v1alpha1-matrixonecluster?timeout=10s":
    EOF.
  • The tests that failed include:
    - MatrixOneCluster test [It] Should reconcile the cluster properly

    - MatrixOneCluster test [It] Should create all sub-resources properly with maximum cluster name
    length
    - Matrix BucketClaim test [It] Should create mo cluster fail if its included logset want to
    bind an already bound bucket
    - Proxy test [It] Should set proxy service args defaults

  • Relevant error logs:
    1:  ##[group]Operating System
    2:  Ubuntu
    ...
    
    666:  go: downloading github.com/mattn/go-colorable v0.1.8
    667:  go: downloading github.com/mattn/go-isatty v0.0.12
    668:  go: downloading gopkg.in/inf.v0 v0.9.1
    669:  go: downloading sigs.k8s.io/json v0.0.0-20211208200746-9f7c6b3444d2
    670:  go: downloading github.com/go-logr/logr v1.2.0
    671:  go: downloading github.com/json-iterator/go v1.1.12
    672:  go: downloading golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd
    673:  go: downloading golang.org/x/sys v0.0.0-20220209214540-3681064d5158
    674:  go: downloading golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1
    ...
    
    914:  > Run e2e test
    915:  make[1]: Entering directory '/home/runner/work/matrixone-operator/matrixone-operator'
    916:  make[1]: Leaving directory '/home/runner/work/matrixone-operator/matrixone-operator'
    917:  �[38;5;9m�[1mGinkgo detected a version mismatch between the Ginkgo CLI and the version of Ginkgo imported by your packages:�[0m
    918:  Ginkgo CLI Version:
    919:  �[1m2.9.2�[0m
    920:  Mismatched package versions found:
    921:  �[1m2.9.5�[0m used by e2e
    922:  �[38;5;243mGinkgo will continue to attempt to run but you may see errors (including flag
    923:  parsing errors) and should either update your go.mod or your version of the
    ...
    
    977:  �[38;5;10m[SynchronizedBeforeSuite] PASSED [0.037 seconds]�[0m
    978:  �[38;5;10m�[1m[SynchronizedBeforeSuite] �[0m
    979:  �[38;5;243m/home/runner/work/matrixone-operator/matrixone-operator/test/e2e/suite_test.go:83�[0m
    980:  �[38;5;243mCaptured StdOut/StdErr Output >>�[0m
    981:  Forwarding from 127.0.0.1:9000 -> 9000
    982:  Forwarding from [::1]:9000 -> 9000
    983:  �[38;5;243m<< Captured StdOut/StdErr Output�[0m
    984:  �[38;5;243m------------------------------�[0m
    985:  �[38;5;9m• [FAILED] [0.026 seconds]�[0m
    986:  �[0mMatrixOneCluster test �[38;5;9m�[1m[It] Should reconcile the cluster properly�[0m
    987:  �[38;5;243m/home/runner/work/matrixone-operator/matrixone-operator/test/e2e/matrixonecluster_test.go:49�[0m
    988:  �[38;5;243mTimeline >>�[0m
    989:  �[1mSTEP:�[0m Create cluster �[38;5;243m@ 06/19/24 09:58:28.401�[0m
    990:  �[38;5;9m[FAILED]�[0m in [It] - /home/runner/work/matrixone-operator/matrixone-operator/test/e2e/matrixonecluster_test.go:131 �[38;5;243m@ 06/19/24 09:58:28.426�[0m
    991:  �[38;5;243m<< Timeline�[0m
    992:  �[38;5;9m[FAILED] Expected success, but got an error:
    993:  <*errors.StatusError | 0xc0002e6640>: 
    994:  Internal error occurred: failed calling webhook "vmatrixonecluster.kb.io": failed to call webhook: Post "https://webhook-service.mo-system.svc:443/validate-core-matrixorigin-io-v1alpha1-matrixonecluster?timeout=10s": EOF
    ...
    
    997:  TypeMeta: {Kind: "", APIVersion: ""},
    998:  ListMeta: {
    999:  SelfLink: "",
    1000:  ResourceVersion: "",
    1001:  Continue: "",
    1002:  RemainingItemCount: nil,
    1003:  },
    1004:  Status: "Failure",
    1005:  Message: "Internal error occurred: failed calling webhook \"vmatrixonecluster.kb.io\": failed to call webhook: Post \"https://webhook-service.mo-system.svc:443/validate-core-matrixorigin-io-v1alpha1-matrixonecluster?timeout=10s\": EOF",
    1006:  Reason: "InternalError",
    1007:  Details: {
    1008:  Name: "",
    1009:  Group: "",
    1010:  Kind: "",
    1011:  UID: "",
    1012:  Causes: [
    1013:  {
    1014:  Type: "",
    1015:  Message: "failed calling webhook \"vmatrixonecluster.kb.io\": failed to call webhook: Post \"https://webhook-service.mo-system.svc:443/validate-core-matrixorigin-io-v1alpha1-matrixonecluster?timeout=10s\": EOF",
    ...
    
    1018:  ],
    1019:  RetryAfterSeconds: 0,
    1020:  },
    1021:  Code: 500,
    1022:  },
    1023:  }�[0m
    1024:  �[38;5;9mIn �[1m[It]�[0m�[38;5;9m at: �[1m/home/runner/work/matrixone-operator/matrixone-operator/test/e2e/matrixonecluster_test.go:131�[0m �[38;5;243m@ 06/19/24 09:58:28.426�[0m
    1025:  �[38;5;243m------------------------------�[0m
    1026:  �[38;5;9m• [FAILED] [0.032 seconds]�[0m
    1027:  �[0mMatrixOneCluster test �[38;5;9m�[1m[It] Should create all sub-resources properly with maximum cluster name length�[0m
    1028:  �[38;5;243m/home/runner/work/matrixone-operator/matrixone-operator/test/e2e/matrixonecluster_test.go:290�[0m
    1029:  �[38;5;243mTimeline >>�[0m
    1030:  �[1mSTEP:�[0m Create cluster with maximum name length �[38;5;243m@ 06/19/24 09:58:28.42�[0m
    1031:  �[38;5;9m[FAILED]�[0m in [It] - /home/runner/work/matrixone-operator/matrixone-operator/test/e2e/matrixonecluster_test.go:355 �[38;5;243m@ 06/19/24 09:58:28.451�[0m
    1032:  �[38;5;243m<< Timeline�[0m
    1033:  �[38;5;9m[FAILED] Expected success, but got an error:
    1034:  <*errors.StatusError | 0xc0004ab0e0>: 
    1035:  Internal error occurred: failed calling webhook "vmatrixonecluster.kb.io": failed to call webhook: Post "https://webhook-service.mo-system.svc:443/validate-core-matrixorigin-io-v1alpha1-matrixonecluster?timeout=10s": EOF
    ...
    
    1038:  TypeMeta: {Kind: "", APIVersion: ""},
    1039:  ListMeta: {
    1040:  SelfLink: "",
    1041:  ResourceVersion: "",
    1042:  Continue: "",
    1043:  RemainingItemCount: nil,
    1044:  },
    1045:  Status: "Failure",
    1046:  Message: "Internal error occurred: failed calling webhook \"vmatrixonecluster.kb.io\": failed to call webhook: Post \"https://webhook-service.mo-system.svc:443/validate-core-matrixorigin-io-v1alpha1-matrixonecluster?timeout=10s\": EOF",
    1047:  Reason: "InternalError",
    1048:  Details: {
    1049:  Name: "",
    1050:  Group: "",
    1051:  Kind: "",
    1052:  UID: "",
    1053:  Causes: [
    1054:  {
    1055:  Type: "",
    1056:  Message: "failed calling webhook \"vmatrixonecluster.kb.io\": failed to call webhook: Post \"https://webhook-service.mo-system.svc:443/validate-core-matrixorigin-io-v1alpha1-matrixonecluster?timeout=10s\": EOF",
    ...
    
    1119:  �[38;5;243m------------------------------�[0m
    1120:  �[38;5;10m• [19.045 seconds]�[0m
    1121:  �[0mMatrix BucketClaim test �[38;5;10m�[1mShould reclaim job success when prefix not exist�[0m
    1122:  �[38;5;243m/home/runner/work/matrixone-operator/matrixone-operator/test/e2e/bucket_test.go:302�[0m
    1123:  �[38;5;243mCaptured StdOut/StdErr Output >>�[0m
    1124:  INFO	e2e/bucket_test.go:641	wait logset teardown	{"logset": "log-m8mwsn"}
    1125:  �[38;5;243m<< Captured StdOut/StdErr Output�[0m
    1126:  �[38;5;243m------------------------------�[0m
    1127:  �[38;5;9m• [FAILED] [0.018 seconds]�[0m
    1128:  �[0mMatrix BucketClaim test �[38;5;9m�[1m[It] Should create mo cluster fail if its included logset want to bind an already bound bucket�[0m
    1129:  �[38;5;243m/home/runner/work/matrixone-operator/matrixone-operator/test/e2e/bucket_test.go:419�[0m
    1130:  �[38;5;243mTimeline >>�[0m
    1131:  �[1mSTEP:�[0m create mo cluster in new namespace �[38;5;243m@ 06/19/24 10:00:51.661�[0m
    1132:  �[1mSTEP:�[0m create one mo cluster with minio s3 provider �[38;5;243m@ 06/19/24 10:00:51.665�[0m
    1133:  �[38;5;9m[FAILED]�[0m in [It] - /home/runner/work/matrixone-operator/matrixone-operator/test/e2e/bucket_test.go:431 �[38;5;243m@ 06/19/24 10:00:51.678�[0m
    1134:  �[38;5;243m<< Timeline�[0m
    1135:  �[38;5;9m[FAILED] Expected success, but got an error:
    1136:  <*errors.StatusError | 0xc00023fea0>: 
    1137:  Internal error occurred: failed calling webhook "vmatrixonecluster.kb.io": failed to call webhook: Post "https://webhook-service.mo-system.svc:443/validate-core-matrixorigin-io-v1alpha1-matrixonecluster?timeout=10s": EOF
    ...
    
    1140:  TypeMeta: {Kind: "", APIVersion: ""},
    1141:  ListMeta: {
    1142:  SelfLink: "",
    1143:  ResourceVersion: "",
    1144:  Continue: "",
    1145:  RemainingItemCount: nil,
    1146:  },
    1147:  Status: "Failure",
    1148:  Message: "Internal error occurred: failed calling webhook \"vmatrixonecluster.kb.io\": failed to call webhook: Post \"https://webhook-service.mo-system.svc:443/validate-core-matrixorigin-io-v1alpha1-matrixonecluster?timeout=10s\": EOF",
    1149:  Reason: "InternalError",
    1150:  Details: {
    1151:  Name: "",
    1152:  Group: "",
    1153:  Kind: "",
    1154:  UID: "",
    1155:  Causes: [
    1156:  {
    1157:  Type: "",
    1158:  Message: "failed calling webhook \"vmatrixonecluster.kb.io\": failed to call webhook: Post \"https://webhook-service.mo-system.svc:443/validate-core-matrixorigin-io-v1alpha1-matrixonecluster?timeout=10s\": EOF",
    ...
    
    1162:  RetryAfterSeconds: 0,
    1163:  },
    1164:  Code: 500,
    1165:  },
    1166:  }�[0m
    1167:  �[38;5;9mIn �[1m[It]�[0m�[38;5;9m at: �[1m/home/runner/work/matrixone-operator/matrixone-operator/test/e2e/bucket_test.go:431�[0m �[38;5;243m@ 06/19/24 10:00:51.678�[0m
    1168:  �[38;5;243m------------------------------�[0m
    1169:  �[38;5;10m• [17.027 seconds]�[0m
    1170:  �[0mMatrix BucketClaim test �[38;5;10m�[1mShould failure when creating logset which want bind to an already bound bucket�[0m
    1171:  �[38;5;243m/home/runner/work/matrixone-operator/matrixone-operator/test/e2e/bucket_test.go:376�[0m
    1172:  �[38;5;243mCaptured StdOut/StdErr Output >>�[0m
    1173:  INFO	e2e/bucket_test.go:641	wait logset teardown	{"logset": "log-ldj7s4"}
    1174:  �[38;5;243m<< Captured StdOut/StdErr Output�[0m
    1175:  �[38;5;243m------------------------------�[0m
    1176:  �[38;5;10m• [17.063 seconds]�[0m
    1177:  �[0mMatrix BucketClaim test �[38;5;10m�[1mShould failure when creating logset in another namespace which want bind to an already bound bucket�[0m
    1178:  �[38;5;243m/home/runner/work/matrixone-operator/matrixone-operator/test/e2e/bucket_test.go:463�[0m
    1179:  �[38;5;243mCaptured StdOut/StdErr Output >>�[0m
    1180:  INFO	e2e/bucket_test.go:641	wait logset teardown	{"logset": "log-8z5pbc"}
    1181:  �[38;5;243m<< Captured StdOut/StdErr Output�[0m
    1182:  �[38;5;243m------------------------------�[0m
    1183:  �[38;5;9m• [FAILED] [0.012 seconds]�[0m
    1184:  �[0mProxy test �[38;5;9m�[1m[It] Should set proxy service args defaults�[0m
    1185:  �[38;5;243m/home/runner/work/matrixone-operator/matrixone-operator/test/e2e/proxy_test.go:29�[0m
    1186:  �[38;5;9m[FAILED] default service args should be set
    ...
    
    1232:  �[38;5;243m/home/runner/work/matrixone-operator/matrixone-operator/test/e2e/logset_test.go:54�[0m
    1233:  �[38;5;243mCaptured StdOut/StdErr Output >>�[0m
    1234:  INFO	e2e/logset_test.go:87	wait logset ready	{"logset": "log-46f9kf"}
    1235:  INFO	e2e/logset_test.go:87	wait logset ready	{"logset": "log-46f9kf"}
    1236:  INFO	e2e/logset_test.go:87	wait logset ready	{"logset": "log-46f9kf"}
    1237:  INFO	e2e/logset_test.go:87	wait logset ready	{"logset": "log-46f9kf"}
    1238:  INFO	e2e/logset_test.go:87	wait logset ready	{"logset": "log-46f9kf"}
    1239:  INFO	e2e/logset_test.go:87	wait logset ready	{"logset": "log-46f9kf"}
    1240:  INFO	e2e/logset_test.go:107	wait failover create new pod log-3
    1241:  INFO	e2e/logset_test.go:107	wait failover create new pod log-3
    1242:  INFO	e2e/logset_test.go:107	wait failover create new pod log-3
    1243:  INFO	e2e/logset_test.go:107	wait failover create new pod log-3
    1244:  INFO	e2e/logset_test.go:107	wait failover create new pod log-3
    1245:  INFO	e2e/logset_test.go:107	wait failover create new pod log-3
    1246:  INFO	e2e/logset_test.go:107	wait failover create new pod log-3
    1247:  INFO	e2e/logset_test.go:107	wait failover create new pod log-3
    1248:  INFO	e2e/logset_test.go:107	wait failover create new pod log-3
    1249:  INFO	e2e/logset_test.go:107	wait failover create new pod log-3
    1250:  INFO	e2e/logset_test.go:107	wait failover create new pod log-3
    1251:  INFO	e2e/logset_test.go:127	wait enough pods running	{"log pods count": 3, "expect": 4}
    1252:  INFO	e2e/logset_test.go:136	wait logset teardown	{"logset": "log-46f9kf"}
    1253:  INFO	e2e/logset_test.go:151	Pod that belongs to the logset is not cleaned	{"pod": "log-46f9kf-log-1"}
    1254:  INFO	e2e/logset_test.go:151	Pod that belongs to the logset is not cleaned	{"pod": "log-46f9kf-log-1"}
    1255:  �[38;5;243m<< Captured StdOut/StdErr Output�[0m
    1256:  �[38;5;243m------------------------------�[0m
    1257:  �[38;5;9m�[1mSummarizing 4 Failures:�[0m
    1258:  �[38;5;9m[FAIL]�[0m �[0mMatrixOneCluster test �[38;5;9m�[1m[It] Should create all sub-resources properly with maximum cluster name length�[0m
    1259:  �[38;5;243m/home/runner/work/matrixone-operator/matrixone-operator/test/e2e/matrixonecluster_test.go:355�[0m
    1260:  �[38;5;9m[FAIL]�[0m �[0mMatrix BucketClaim test �[38;5;9m�[1m[It] Should create mo cluster fail if its included logset want to bind an already bound bucket�[0m
    1261:  �[38;5;243m/home/runner/work/matrixone-operator/matrixone-operator/test/e2e/bucket_test.go:431�[0m
    1262:  �[38;5;9m[FAIL]�[0m �[0mProxy test �[38;5;9m�[1m[It] Should set proxy service args defaults�[0m
    1263:  �[38;5;243m/home/runner/work/matrixone-operator/matrixone-operator/test/e2e/proxy_test.go:56�[0m
    1264:  �[38;5;9m[FAIL]�[0m �[0mMatrixOneCluster test �[38;5;9m�[1m[It] Should reconcile the cluster properly�[0m
    1265:  �[38;5;243m/home/runner/work/matrixone-operator/matrixone-operator/test/e2e/matrixonecluster_test.go:131�[0m
    1266:  �[38;5;9m�[1mRan 17 of 17 Specs in 315.223 seconds�[0m
    1267:  �[38;5;9m�[1mFAIL!�[0m -- �[38;5;10m�[1m13 Passed�[0m | �[38;5;9m�[1m4 Failed�[0m | �[38;5;11m�[1m0 Pending�[0m | �[38;5;14m�[1m0 Skipped�[0m
    ...
    
    1269:  �[38;5;228mYou're using deprecated Ginkgo functionality:�[0m
    1270:  �[38;5;228m=============================================�[0m
    1271:  �[38;5;11m--slowSpecThreshold is deprecated use --slow-spec-threshold instead and pass in a duration string (e.g. '5s', not '5.0')�[0m
    1272:  �[1mLearn more at:�[0m �[38;5;14m�[4mhttps://onsi.github.io/ginkgo/MIGRATING_TO_V2#changed--slowspecthreshold�[0m
    1273:  �[38;5;11m--stream is deprecated�[0m
    1274:  �[1mLearn more at:�[0m �[38;5;14m�[4mhttps://onsi.github.io/ginkgo/MIGRATING_TO_V2#removed--stream�[0m
    1275:  �[38;5;243mTo silence deprecations that can be silenced set the following environment variable:�[0m
    1276:  �[38;5;243mACK_GINKGO_DEPRECATIONS=2.9.2�[0m
    1277:  Test Suite Failed
    ...
    
    1279:  namespace "e2e-1718791108362825733" deleted
    1280:  Uninstall helm charts...
    1281:  release "mo" uninstalled
    1282:  Wait for charts uninstall
    1283:  Delete operator namespace
    1284:  namespace "mo-system" deleted
    1285:  > Tearing down
    1286:  Deleting cluster "mo" ...
    1287:  make: *** [Makefile:113: e2e-kind] Error 1
    1288:  ##[error]Process completed with exit code 2.
    

    ✨ CI feedback usage guide:

    The CI feedback tool (/checks) automatically triggers when a PR has a failed check.
    The tool analyzes the failed checks and provides several feedbacks:

    • Failed stage
    • Failed test name
    • Failure summary
    • Relevant error logs

    In addition to being automatically triggered, the tool can also be invoked manually by commenting on a PR:

    /checks "https://github.com/{repo_name}/actions/runs/{run_number}/job/{job_number}"
    

    where {repo_name} is the name of the repository, {run_number} is the run number of the failed check, and {job_number} is the job number of the failed check.

    Configuration options

    • enable_auto_checks_feedback - if set to true, the tool will automatically provide feedback when a check is failed. Default is true.
    • excluded_checks_list - a list of checks to exclude from the feedback, for example: ["check1", "check2"]. Default is an empty list.
    • enable_help_text - if set to true, the tool will provide a help message with the feedback. Default is true.
    • persistent_comment - if set to true, the tool will overwrite a previous checks comment with the new feedback. Default is true.
    • final_update_message - if persistent_comment is true and updating a previous checks message, the tool will also create a new message: "Persistent checks updated to latest commit". Default is true.

    See more information about the checks tool in the docs.

    Copy link

    PR-Agent was enabled for this repository. To continue using it, please link your git user with your CodiumAI identity here.

    CI Failure Feedback 🧐

    Action: checks

    Failed stage: Run /./.github/actions/checks [❌]

    Failure summary:

    The action failed due to the following reasons:

  • The crd-ref-docs tool failed to find specific types:
    - Quantity in the package
    k8s.io/apimachinery/pkg/api/resource
    - IntOrString in the package
    k8s.io/apimachinery/pkg/util/intstr
  • Multiple warnings were generated for unused parameters in the code:
    - ctx
    - obj
    - r
    - oldObj
  • The final error message indicated that issues were found, which caused the action to fail.

  • Relevant error logs:
    1:  ##[group]Operating System
    2:  Ubuntu
    ...
    
    602:  Adding to the cache ...
    603:  Successfully cached go to /opt/hostedtoolcache/go/1.18.10/x64
    604:  Added go to the path
    605:  Successfully set up Go version 1.18
    606:  [command]/opt/hostedtoolcache/go/1.18.10/x64/bin/go env GOMODCACHE
    607:  [command]/opt/hostedtoolcache/go/1.18.10/x64/bin/go env GOCACHE
    608:  /home/runner/go/pkg/mod
    609:  /home/runner/.cache/go-build
    610:  ##[warning]Restore cache failed: Some specified paths were not resolved, unable to cache dependencies.
    ...
    
    808:  go: downloading github.com/gogo/protobuf v1.3.2
    809:  go: downloading k8s.io/utils v0.0.0-20220210201930-3a6ce19ff2f9
    810:  go: downloading github.com/google/gofuzz v1.1.0
    811:  go: downloading k8s.io/klog/v2 v2.60.1
    812:  go: downloading sigs.k8s.io/structured-merge-diff/v4 v4.2.1
    813:  go: downloading github.com/mattn/go-colorable v0.1.8
    814:  go: downloading github.com/mattn/go-isatty v0.0.12
    815:  go: downloading golang.org/x/sys v0.0.0-20220209214540-3681064d5158
    816:  go: downloading golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1
    ...
    
    848:  go: downloading github.com/google/uuid v1.1.1
    849:  go: downloading github.com/huandu/xstrings v1.2.1
    850:  go: downloading github.com/imdario/mergo v0.3.5
    851:  go: downloading github.com/mitchellh/copystructure v1.0.0
    852:  go: downloading golang.org/x/crypto v0.0.0-20190611184440-5c40567a22f8
    853:  go: downloading github.com/gogo/protobuf v1.2.2-0.20190723190241-65acae22fc9d
    854:  go: downloading github.com/gobuffalo/flect v0.1.5
    855:  go: downloading k8s.io/apiextensions-apiserver v0.0.0-20190918161926-8f644eb6e783
    856:  go: downloading golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543
    ...
    
    864:  go: downloading github.com/mattn/go-colorable v0.1.4
    865:  go: downloading github.com/mattn/go-isatty v0.0.11
    866:  go: downloading golang.org/x/sys v0.0.0-20191210023423-ac6580df4449
    867:  go: downloading golang.org/x/text v0.3.2
    868:  go: downloading k8s.io/utils v0.0.0-20190801114015-581e00157fb1
    869:  /home/runner/work/matrixone-operator/matrixone-operator/api/bin/crd-ref-docs --source-path=core/v1alpha1 --renderer=markdown --output-path ../docs/reference/api-reference.md
    870:  �[34mINFO�[0m	crd-ref-docs	Loading configuration	{"path": "config.yaml"}
    871:  �[34mINFO�[0m	crd-ref-docs	Processing source directory	{"directory": "core/v1alpha1", "depth": 6}
    872:  �[33mWARN�[0m	crd-ref-docs	Failed to find type	{"name": "Quantity", "package": "k8s.io/apimachinery/pkg/api/resource"}
    873:  �[33mWARN�[0m	crd-ref-docs	Failed to find type	{"name": "IntOrString", "package": "k8s.io/apimachinery/pkg/util/intstr"}
    ...
    
    916:  go: downloading github.com/prometheus/client_model v0.4.1-0.20230718164431-9a2bf3000d16
    917:  go: downloading github.com/prometheus/common v0.44.0
    918:  go: downloading github.com/prometheus/procfs v0.11.1
    919:  go: downloading google.golang.org/protobuf v1.33.0
    920:  go: downloading github.com/aws/smithy-go v1.13.5
    921:  go: downloading github.com/matrixorigin/dragonboat/v4 v4.0.0-20240312080931-1b40809d7cea
    922:  go: downloading github.com/robfig/cron/v3 v3.0.1
    923:  go: downloading gopkg.in/natefinch/lumberjack.v2 v2.2.1
    924:  go: downloading github.com/cockroachdb/errors v1.9.1
    ...
    
    977:  go: downloading golang.org/x/text v0.14.0
    978:  go: downloading github.com/google/go-cmp v0.6.0
    979:  go: downloading github.com/kr/text v0.2.0
    980:  go: downloading github.com/rogpeppe/go-internal v1.10.0
    981:  go: downloading github.com/valyala/fastrand v1.1.0
    982:  go: downloading github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da
    983:  go: downloading github.com/google/btree v1.1.2
    984:  go: downloading github.com/hashicorp/go-msgpack v0.5.3
    985:  go: downloading github.com/hashicorp/go-multierror v1.1.1
    ...
    
    1041:  go: downloading github.com/OneOfOne/xxhash v1.2.2
    1042:  go: downloading github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72
    1043:  go: downloading github.com/benbjohnson/clock v1.1.0
    1044:  go: downloading gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c
    1045:  go: downloading github.com/BurntSushi/toml v1.2.1
    1046:  go: downloading github.com/DATA-DOG/go-sqlmock v1.5.0
    1047:  go: downloading github.com/prashantv/gostub v1.1.0
    1048:  go: downloading github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5
    1049:  go: downloading github.com/pingcap/errors v0.11.5-0.20201029093017-5a7df2af2ac7
    ...
    
    1109:  ##[warning]unused-parameter: parameter 'ctx' seems to be unused, consider removing or renaming it as _ (revive)
    1110:  ##[warning]unused-parameter: parameter 'obj' seems to be unused, consider removing or renaming it as _ (revive)
    1111:  ##[warning]unused-parameter: parameter 'r' seems to be unused, consider removing or renaming it as _ (revive)
    1112:  ##[warning]unused-parameter: parameter 'ctx' seems to be unused, consider removing or renaming it as _ (revive)
    1113:  ##[warning]unused-parameter: parameter 'oldObj' seems to be unused, consider removing or renaming it as _ (revive)
    1114:  ##[warning]unused-parameter: parameter 'ctx' seems to be unused, consider removing or renaming it as _ (revive)
    1115:  ##[warning]unused-parameter: parameter 'obj' seems to be unused, consider removing or renaming it as _ (revive)
    1116:  ##[warning]unused-parameter: parameter 'oldObj' seems to be unused, consider removing or renaming it as _ (revive)
    1117:  ##[error]issues found
    

    ✨ CI feedback usage guide:

    The CI feedback tool (/checks) automatically triggers when a PR has a failed check.
    The tool analyzes the failed checks and provides several feedbacks:

    • Failed stage
    • Failed test name
    • Failure summary
    • Relevant error logs

    In addition to being automatically triggered, the tool can also be invoked manually by commenting on a PR:

    /checks "https://github.com/{repo_name}/actions/runs/{run_number}/job/{job_number}"
    

    where {repo_name} is the name of the repository, {run_number} is the run number of the failed check, and {job_number} is the job number of the failed check.

    Configuration options

    • enable_auto_checks_feedback - if set to true, the tool will automatically provide feedback when a check is failed. Default is true.
    • excluded_checks_list - a list of checks to exclude from the feedback, for example: ["check1", "check2"]. Default is an empty list.
    • enable_help_text - if set to true, the tool will provide a help message with the feedback. Default is true.
    • persistent_comment - if set to true, the tool will overwrite a previous checks comment with the new feedback. Default is true.
    • final_update_message - if persistent_comment is true and updating a previous checks message, the tool will also create a new message: "Persistent checks updated to latest commit". Default is true.

    See more information about the checks tool in the docs.

    @cyberchen98 cyberchen98 requested review from aylei and loveRhythm1990 and removed request for aylei June 20, 2024 07:31
    Copy link
    Contributor

    @aylei aylei left a comment

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    lgtm

    @cyberchen98 cyberchen98 merged commit d98a533 into main Jun 26, 2024
    3 checks passed
    @cyberchen98 cyberchen98 deleted the wangchen/enhance-crd-validation branch June 26, 2024 02:03
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Projects
    None yet
    Development

    Successfully merging this pull request may close these issues.

    2 participants