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

Sonobuoy Conformance Results #204

Open
wants to merge 38 commits into
base: main
Choose a base branch
from
Open

Conversation

VestigeJ
Copy link
Contributor

Proposed Changes

Adding the ability to run sonobuoy and get the results from the run of conformance results

the command to run it exists within the makefile and it has been edited to accommodate the long timeout window that conformance results frequently hit within go/ginkgo expectations.

Types of Changes

It can be a quick test by altering the launchSonobuoyTests("quick") but the default is to run the full conformance suite from upstream. Primarily to be used during patch validation runs but it could be used more frequently in other ways to quickly check a clusters status. Although if you have a cluster running the fastest and easiest way to run conformance is to do it the simple way upstream does it with a simple yaml deployment.

---
apiVersion: v1
kind: Namespace
metadata:
  name: conformance
---
apiVersion: v1
kind: ServiceAccount
metadata:
  labels:
    component: conformance
  name: conformance-serviceaccount
  namespace: conformance
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
  labels:
    component: conformance
  name: conformance-serviceaccount-role
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: ClusterRole
  name: conformance-serviceaccount
subjects:
- kind: ServiceAccount
  name: conformance-serviceaccount
  namespace: conformance
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
  labels:
    component: conformance
  name: conformance-serviceaccount
rules:
- apiGroups:
  - '*'
  resources:
  - '*'
  verbs:
  - '*'
- nonResourceURLs:
  - '/metrics'
  - '/logs'
  - '/logs/*'
  verbs:
  - 'get'
---
apiVersion: v1
kind: Pod
metadata:
  name: e2e-conformance-test
  namespace: conformance
spec:
  containers:
  - name: conformance-container
    image: registry.k8s.io/conformance-amd64:v1.31.2 #EDIT THIS FOR YOUR CLUSTER
    imagePullPolicy: IfNotPresent
    env:
    - name: E2E_FOCUS
      value: "\\[Conformance\\]"
    - name: E2E_SKIP
      value: ""
    - name: E2E_PROVIDER
      value: "skeleton"
    - name: E2E_PARALLEL
      value: "false"
    - name: E2E_VERBOSITY
      value: "4"
    volumeMounts:
    - name: output-volume
      mountPath: /tmp/results
  volumes:
  - name: output-volume
    hostPath:
      path: /tmp/results
  restartPolicy: Never
  serviceAccountName: conformance-serviceaccount

Testing

Checklist:

  1. If your PR changes anything on or related to Jenkins, run it pointing to your branch to make sure it's okay.
    not yet

  2. Verify code lint; we should not have errors.

  3. Update the documentation if needed.

  4. Update makefile and docker run if adding new tests.

  5. Run your tests at least 4 times with all configurations needed and possible.

  6. If needed test with different os types.

Linked Issues

Further Comments

@VestigeJ
Copy link
Contributor Author

I'll be running golangci-lint run a lot more before creating PRs in the future.... Apologies

cluster.Config.Product) + " https://127.0.0.1:6443/healthz",
}

servers, err := shared.GetNodesByRoles("control-plane")
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: servers -> cpNodes

Copy link
Contributor Author

Choose a reason for hiding this comment

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

controlPlaneNodes is my replacement string again long for comprehension considering it shouldn't be a string that is typed often but that is read more than re-typed.

shared/cluster.go Outdated Show resolved Hide resolved
shared/cluster.go Outdated Show resolved Hide resolved
@mdrahman-suse
Copy link
Contributor

I'll be running golangci-lint run a lot more before creating PRs in the future.... Apologies

No worries, you can just run make pre-commit before pushing the changes

sonobuoyVersion := customflag.ServiceFlag.External.SonobuoyVersion
err := shared.SonobuoyMixedOS("install", sonobuoyVersion)
// TestDisplayClusterDetails used to display cluster details.
func TestDisplayClusterDetails() {
Copy link
Contributor

@ShylajaDevadiga ShylajaDevadiga Jan 6, 2025

Choose a reason for hiding this comment

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

Are we not using this here? https://github.com/rancher/distros-test-framework/blob/main/pkg/template/helper.go#L79
Update path is all tests thats using this method

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This method is still exposed publicly from the conformance file

os.Exit(1)
}

return true
Copy link
Contributor

Choose a reason for hiding this comment

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

return is not needed as its not used

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants