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

config, sccs: add required parameters #1332

Merged
merged 2 commits into from May 31, 2022
Merged

Conversation

maiqueb
Copy link
Contributor

@maiqueb maiqueb commented Apr 19, 2022

What this PR does / why we need it:
According to openshift's API specification the following
attributes are required:

  • allowHostDirVolumePlugin
  • allowHostIPC
  • allowHostNetwork
  • allowHostPID
  • allowHostPorts
  • allowPrivilegedContainer
  • readOnlyRootFilesystem

This commits adds the required parameters to the SCCs that were missing
them.

Furthermore, there's this openshift documentation bug, in which the volumes
attribute is missing from the API.

Special notes for your reviewer:

Release note:

Add the required attributes to comply with the openshift SCC API.

@kubevirt-bot kubevirt-bot added release-note Denotes a PR that will be considered when it comes time to generate release notes. dco-signoff: yes Indicates the PR's author has DCO signed all their commits. labels Apr 19, 2022
@phoracek
Copy link
Member

@maiqueb the commit message does not contain the [0] link, would you please add it?

@qinqon
Copy link
Collaborator

qinqon commented Apr 19, 2022

/lgtm
/approve

@kubevirt-bot kubevirt-bot added lgtm Indicates that a PR is ready to be merged. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Apr 19, 2022
@qinqon
Copy link
Collaborator

qinqon commented Apr 19, 2022

/lgtm cancel

@kubevirt-bot kubevirt-bot removed the lgtm Indicates that a PR is ready to be merged. label Apr 19, 2022
@qinqon
Copy link
Collaborator

qinqon commented Apr 19, 2022

/hold
we do not change data directory we modify the originals using the scripts under hack/components.

@kubevirt-bot kubevirt-bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Apr 19, 2022
@qinqon qinqon closed this Apr 19, 2022
@qinqon qinqon reopened this Apr 19, 2022
@maiqueb maiqueb force-pushed the adjust-sccs branch 2 times, most recently from e26bf94 to 6547407 Compare April 20, 2022 09:24
@maiqueb
Copy link
Contributor Author

maiqueb commented Apr 20, 2022

/hold cancel

@qinqon seems this is now working (at least, it managed to pass the unit tests).

@kubevirt-bot kubevirt-bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Apr 20, 2022
@maiqueb
Copy link
Contributor Author

maiqueb commented Apr 20, 2022

Had to change the multus SCC since it does require access to the host network, as per its spec.

@maiqueb
Copy link
Contributor Author

maiqueb commented Apr 20, 2022

/hold

On second thought, lets try to get feedback first from the community.

@kubevirt-bot kubevirt-bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Apr 20, 2022
@usrbinkat
Copy link

usrbinkat commented Apr 25, 2022

I've started testing on microshift (where bug was first observed). I could use guidance on best method to test, as testing on microshift requires deviating from Makefile & ./cluster/*.sh scripts.

I deployed the operator with image docker.io/katamo/cluster-network-addons-operator:b5ac93f

Still getting the same error:

$ kubectl describe networkaddonsconfig cluster

Events:
  Type     Reason                 Age                  From     Message
  ----     ------                 ----                 ----     -------
  Warning  Failed: Failing        24m                  cluster  Operator failed: Unable to apply desired configuration
  Warning  Failed: FailedToApply  11m (x18 over 24m)   cluster  Operator failed: could not apply (security.openshift.io/v1, Kind=SecurityContextConstraints) /multus: could not create (security.openshift.io/v1, Kind=SecurityContextConstraints) /multus: SecurityContextConstraints.security.openshift.io "multus" is invalid: [allowHostIPC: Required value, allowHostNetwork: Required value, allowHostPID: Required value, allowHostPorts: Required value, readOnlyRootFilesystem: Required value, volumes: Required value]
  Warning  Failed: FailedToApply  4s (x17 over 7m15s)  cluster  Operator failed: could not apply (security.openshift.io/v1, Kind=SecurityContextConstraints) /multus: could not create (security.openshift.io/v1, Kind=SecurityContextConstraints) /multus: SecurityContextConstraints.security.openshift.io "multus" is invalid: volumes: Required value

More Details:

NetworkAddonsConfig cluster

---
Name:         cluster
Namespace:    
Labels:       <none>
Annotations:  <none>
API Version:  networkaddonsoperator.network.kubevirt.io/v1
Kind:         NetworkAddonsConfig
Metadata:
  Creation Timestamp:  2022-04-25T21:41:07Z
  Generation:          1
  Managed Fields:
    API Version:  networkaddonsoperator.network.kubevirt.io/v1
    Fields Type:  FieldsV1
    fieldsV1:
      f:metadata:
        f:annotations:
          .:
          f:kubectl.kubernetes.io/last-applied-configuration:
      f:spec:
        .:
        f:imagePullPolicy:
        f:kubeMacPool:
        f:linuxBridge:
        f:macvtap:
        f:multus:
        f:nmstate:
        f:ovs:
    Manager:      kubectl-client-side-apply
    Operation:    Update
    Time:         2022-04-25T21:41:07Z
    API Version:  networkaddonsoperator.network.kubevirt.io/v1
    Fields Type:  FieldsV1
    fieldsV1:
      f:status:
        .:
        f:conditions:
        f:operatorVersion:
        f:targetVersion:
    Manager:         cluster-network-addons-operator
    Operation:       Update
    Time:            2022-04-25T21:41:26Z
  Resource Version:  12475
  Self Link:         /apis/networkaddonsoperator.network.kubevirt.io/v1/networkaddonsconfigs/cluster
  UID:               f04c1b69-0976-4dee-9b17-31e5ebd7c314
Spec:
  Image Pull Policy:  IfNotPresent
  Kube Mac Pool:
  Linux Bridge:
  Macvtap:
  Multus:
  Nmstate:
  Ovs:
Status:
  Conditions:
    Last Transition Time:  2022-04-25T21:41:26Z
    Message:               could not apply (security.openshift.io/v1, Kind=SecurityContextConstraints) /multus: could not create (security.openshift.io/v1, Kind=SecurityContextConstraints) /multus: SecurityContextConstraints.security.openshift.io "multus" is invalid: volumes: Required value
    Reason:                FailedToApply
    Status:                True
    Type:                  Degraded
    Last Transition Time:  2022-04-25T21:41:26Z
    Message:               Unable to apply desired configuration
    Reason:                Failing
    Status:                False
    Type:                  Available
    Last Transition Time:  2022-04-25T21:41:26Z
    Message:               Human interaction is needed, please fix the desired configuration
    Reason:                InvalidConfiguration
    Status:                False
    Type:                  Progressing
  Operator Version:        0.65.6
  Target Version:          0.65.6
Events:
  Type     Reason                 Age                  From     Message
  ----     ------                 ----                 ----     -------
  Warning  Failed: Failing        24m                  cluster  Operator failed: Unable to apply desired configuration
  Warning  Failed: FailedToApply  11m (x18 over 24m)   cluster  Operator failed: could not apply (security.openshift.io/v1, Kind=SecurityContextConstraints) /multus: could not create (security.openshift.io/v1, Kind=SecurityContextConstraints) /multus: SecurityContextConstraints.security.openshift.io "multus" is invalid: [allowHostIPC: Required value, allowHostNetwork: Required value, allowHostPID: Required value, allowHostPorts: Required value, readOnlyRootFilesystem: Required value, volumes: Required value]
  Warning  Failed: FailedToApply  4s (x17 over 7m15s)  cluster  Operator failed: could not apply (security.openshift.io/v1, Kind=SecurityContextConstraints) /multus: could not create (security.openshift.io/v1, Kind=SecurityContextConstraints) /multus: SecurityContextConstraints.security.openshift.io "multus" is invalid: volumes: Required value
Operator Deployment

---
apiVersion: v1
items:
- apiVersion: apps/v1
  kind: Deployment
  metadata:
    annotations:
      deployment.kubernetes.io/revision: "1"
      kubectl.kubernetes.io/last-applied-configuration: |
        {"apiVersion":"apps/v1","kind":"Deployment","metadata":{"annotations":{"networkaddonsoperator.network.kubevirt.io/version":"0.65.6"},"labels":{"prometheus.cnao.io":"true"},"name":"cluster-network-addons-operator","namespace":"cluster-network-addons"},"spec":{"replicas":1,"selector":{"matchLabels":{"name":"cluster-network-addons-operator"}},"strategy":{"type":"Recreate"},"template":{"metadata":{"annotations":{"description":"cluster-network-addons-operator manages the lifecycle of different Kubernetes network components on top of Kubernetes cluster"},"labels":{"name":"cluster-network-addons-operator","prometheus.cnao.io":"true"}},"spec":{"containers":[{"env":[{"name":"MULTUS_IMAGE","value":"quay.io/kubevirt/cluster-network-addon-multus@sha256:32867c73cda4d605651b898dc85fea67d93191c47f27e1ad9e9f2b9041c518de"},{"name":"LINUX_BRIDGE_IMAGE","value":"quay.io/kubevirt/cni-default-plugins@sha256:5d9442c26f8750d44f97175f36dbd74bef503f782b9adefcfd08215d065c437a"},{"name":"LINUX_BRIDGE_MARKER_IMAGE","value":"quay.io/kubevirt/bridge-marker@sha256:9d90a5bd051d71429b6d9fc34112081fe64c6d3fb02221e18ebe72d428d58092"},{"name":"NMSTATE_HANDLER_IMAGE","value":"quay.io/nmstate/kubernetes-nmstate-handler@sha256:d2ebaf60ba602bfd5e063ba271c766d41091f455b0f29d1ba1c626856146f8fa"},{"name":"OVS_CNI_IMAGE","value":"quay.io/kubevirt/ovs-cni-plugin@sha256:cf669ca4967cd26c6629efa93b7426c8e1c65fa17d5ce59deaab1237a854d81b"},{"name":"OVS_MARKER_IMAGE","value":"quay.io/kubevirt/ovs-cni-marker@sha256:c09f882c64ee6449e13ff8b0a249d1dc4653d7d94a97f5ebee61de2d3ce9d5e8"},{"name":"KUBEMACPOOL_IMAGE","value":"quay.io/kubevirt/kubemacpool@sha256:76fa87945610ea220612bf56da3ca67a5af183c8eef2c7218e31717cf0a23bd4"},{"name":"MACVTAP_CNI_IMAGE","value":"quay.io/kubevirt/macvtap-cni@sha256:961f1d1079840fa657f2e115835afdf5d0c7520623bbc302e46f2b67e36f8349"},{"name":"OPERATOR_IMAGE","value":"docker.io/katamo/cluster-network-addons-operator:b5ac93f"},{"name":"OPERATOR_NAME","value":"cluster-network-addons-operator"},{"name":"OPERATOR_VERSION","value":"0.65.6"},{"name":"OPERATOR_NAMESPACE","valueFrom":{"fieldRef":{"fieldPath":"metadata.namespace"}}},{"name":"OPERAND_NAMESPACE","valueFrom":{"fieldRef":{"fieldPath":"metadata.namespace"}}},{"name":"POD_NAME","valueFrom":{"fieldRef":{"fieldPath":"metadata.name"}}},{"name":"WATCH_NAMESPACE"},{"name":"MONITORING_NAMESPACE","value":"openshift-monitoring"},{"name":"MONITORING_SERVICE_ACCOUNT","value":"prometheus-k8s"}],"image":"docker.io/katamo/cluster-network-addons-operator:b5ac93f","imagePullPolicy":"Always","name":"cluster-network-addons-operator","ports":[{"containerPort":8080,"name":"metrics","protocol":"TCP"}],"resources":{"requests":{"cpu":"50m","memory":"30Mi"}}}],"priorityClassName":"system-cluster-critical","securityContext":{"runAsNonRoot":true},"serviceAccountName":"cluster-network-addons-operator"}}}}
      networkaddonsoperator.network.kubevirt.io/version: 0.65.6
    creationTimestamp: "2022-04-25T21:58:05Z"
    generation: 1
    labels:
      prometheus.cnao.io: "true"
    name: cluster-network-addons-operator
    namespace: cluster-network-addons
    resourceVersion: "12426"
    selfLink: /apis/apps/v1/namespaces/cluster-network-addons/deployments/cluster-network-addons-operator
    uid: 2eb8a153-4ad4-4335-ad24-260d6fc8f1b0
  spec:
    progressDeadlineSeconds: 600
    replicas: 1
    revisionHistoryLimit: 10
    selector:
      matchLabels:
        name: cluster-network-addons-operator
    strategy:
      type: Recreate
    template:
      metadata:
        annotations:
          description: cluster-network-addons-operator manages the lifecycle of different
            Kubernetes network components on top of Kubernetes cluster
        creationTimestamp: null
        labels:
          name: cluster-network-addons-operator
          prometheus.cnao.io: "true"
      spec:
        containers:
        - env:
          - name: MULTUS_IMAGE
            value: quay.io/kubevirt/cluster-network-addon-multus@sha256:32867c73cda4d605651b898dc85fea67d93191c47f27e1ad9e9f2b9041c518de
          - name: LINUX_BRIDGE_IMAGE
            value: quay.io/kubevirt/cni-default-plugins@sha256:5d9442c26f8750d44f97175f36dbd74bef503f782b9adefcfd08215d065c437a
          - name: LINUX_BRIDGE_MARKER_IMAGE
            value: quay.io/kubevirt/bridge-marker@sha256:9d90a5bd051d71429b6d9fc34112081fe64c6d3fb02221e18ebe72d428d58092
          - name: NMSTATE_HANDLER_IMAGE
            value: quay.io/nmstate/kubernetes-nmstate-handler@sha256:d2ebaf60ba602bfd5e063ba271c766d41091f455b0f29d1ba1c626856146f8fa
          - name: OVS_CNI_IMAGE
            value: quay.io/kubevirt/ovs-cni-plugin@sha256:cf669ca4967cd26c6629efa93b7426c8e1c65fa17d5ce59deaab1237a854d81b
          - name: OVS_MARKER_IMAGE
            value: quay.io/kubevirt/ovs-cni-marker@sha256:c09f882c64ee6449e13ff8b0a249d1dc4653d7d94a97f5ebee61de2d3ce9d5e8
          - name: KUBEMACPOOL_IMAGE
            value: quay.io/kubevirt/kubemacpool@sha256:76fa87945610ea220612bf56da3ca67a5af183c8eef2c7218e31717cf0a23bd4
          - name: MACVTAP_CNI_IMAGE
            value: quay.io/kubevirt/macvtap-cni@sha256:961f1d1079840fa657f2e115835afdf5d0c7520623bbc302e46f2b67e36f8349
          - name: OPERATOR_IMAGE
            value: docker.io/katamo/cluster-network-addons-operator:b5ac93f
          - name: OPERATOR_NAME
            value: cluster-network-addons-operator
          - name: OPERATOR_VERSION
            value: 0.65.6
          - name: OPERATOR_NAMESPACE
            valueFrom:
              fieldRef:
                apiVersion: v1
                fieldPath: metadata.namespace
          - name: OPERAND_NAMESPACE
            valueFrom:
              fieldRef:
                apiVersion: v1
                fieldPath: metadata.namespace
          - name: POD_NAME
            valueFrom:
              fieldRef:
                apiVersion: v1
                fieldPath: metadata.name
          - name: WATCH_NAMESPACE
          - name: MONITORING_NAMESPACE
            value: openshift-monitoring
          - name: MONITORING_SERVICE_ACCOUNT
            value: prometheus-k8s
          image: docker.io/katamo/cluster-network-addons-operator:b5ac93f
          imagePullPolicy: Always
          name: cluster-network-addons-operator
          ports:
          - containerPort: 8080
            name: metrics
            protocol: TCP
          resources:
            requests:
              cpu: 50m
              memory: 30Mi
          terminationMessagePath: /dev/termination-log
          terminationMessagePolicy: File
        dnsPolicy: ClusterFirst
        priorityClassName: system-cluster-critical
        restartPolicy: Always
        schedulerName: default-scheduler
        securityContext:
          runAsNonRoot: true
        serviceAccount: cluster-network-addons-operator
        serviceAccountName: cluster-network-addons-operator
        terminationGracePeriodSeconds: 30
  status:
    availableReplicas: 1
    conditions:
    - lastTransitionTime: "2022-04-25T21:58:14Z"
      lastUpdateTime: "2022-04-25T21:58:14Z"
      message: Deployment has minimum availability.
      reason: MinimumReplicasAvailable
      status: "True"
      type: Available
    - lastTransitionTime: "2022-04-25T21:58:05Z"
      lastUpdateTime: "2022-04-25T21:58:14Z"
      message: ReplicaSet "cluster-network-addons-operator-86c84978cf" has successfully
        progressed.
      reason: NewReplicaSetAvailable
      status: "True"
      type: Progressing
    observedGeneration: 1
    readyReplicas: 1
    replicas: 1
    updatedReplicas: 1
kind: List
metadata:
  resourceVersion: ""
  selfLink: ""

@maiqueb
Copy link
Contributor Author

maiqueb commented Apr 26, 2022

@usrbinkat weird... It seems it is executing 2 multus SCCs - the first one is missing the following list of capabilities: allowHostIPC, allowHostNetwork, allowHostPID, allowHostPorts, readOnlyRootFilesystem, volumes. I honestly do not understand where it comes from. At all.

The second one, is only missing the volumes capability, and I assume is the one I have just edited - since the capability list matches what I added in this PR. Somehow, it says that the volumes are required - but it is not marked as such in the openshift API.

@sonarcloud
Copy link

sonarcloud bot commented Apr 27, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@maiqueb
Copy link
Contributor Author

maiqueb commented Apr 27, 2022

/test pull-e2e-cluster-network-addons-operator-workflow-k8s

1 similar comment
@maiqueb
Copy link
Contributor Author

maiqueb commented Apr 27, 2022

/test pull-e2e-cluster-network-addons-operator-workflow-k8s

@usrbinkat
Copy link

@maiqueb I tested image docker.io/katamo/cluster-network-addons-operator:cdd6cf1 built from commit cdd6cf1

Here is pastebin output of: kubectl get all -A

Looks like an improvement. We're seeing the same scc error on the linux-bridge component now though. Looking at your patch, I wonder if we also need an scc patch in hack/components/bump-linux-bridge.sh?

Warning   Failed: FailedToApply   networkaddonsconfig/cluster    Operator failed: could not apply (security.openshift.io/v1, Kind=SecurityContextConstraints) /linux-bridge: could not create (security.openshift.io/v1, Kind=SecurityContextConstraints) /linux-bridge: SecurityContextConstraints.security.openshift.io "linux-bridge" is invalid: volumes: Required value

I also attempted to run a VM with multus interface on microshift in the current condition and got the following results.

Event Logs
# VMI Events
Events:
  Type     Reason            Age                 From                       Message
  ----     ------            ----                ----                       -------
  Normal   SuccessfulCreate  75s                 virtualmachine-controller  Created virtual machine pod virt-launcher-kargo3-htb6t
  Warning  SyncFailed        33s (x14 over 74s)  virt-handler               failed to configure vmi network: setup failed, err: failed plugging phase1 at nic 'net1': Link not found

# Kube Events
  Warning  SyncFailed        virtualmachineinstance/kargo3                  failed to detect VMI pod: dial unix //pods/2a2ba989-807a-44ee-b8e8-f8f8a9b2dbcb/volumes/kubernetes.io~empty-dir/sockets/launcher-sock: connect: connection refused
virt-launcher pod logs
{"component":"virt-launcher","level":"info","msg":"Collected all requested hook sidecar sockets","pos":"manager.go:76","timestamp":"2022-04-27T19:09:44.606356Z"}
{"component":"virt-launcher","level":"info","msg":"Sorted all collected sidecar sockets per hook point based on their priority and name: map[]","pos":"manager.go:79","timestamp":"2022-04-27T19:09:44.606459Z"}
{"component":"virt-launcher","level":"info","msg":"Connecting to libvirt daemon: qemu:///system","pos":"libvirt.go:495","timestamp":"2022-04-27T19:09:44.609580Z"}
{"component":"virt-launcher","level":"info","msg":"Connecting to libvirt daemon failed: virError(Code=38, Domain=7, Message='Failed to connect socket to '/var/run/libvirt/libvirt-sock': No such file or directory')","pos":"libvirt.go:503","timestamp":"2022-04-27T19:09:44.612940Z"}
{"component":"virt-launcher","level":"info","msg":"libvirt version: 7.6.0, package: 6.el8s (CBS \u003ccbs@centos.org\u003e, 2021-10-29-15:04:36, )","subcomponent":"libvirt","thread":"40","timestamp":"2022-04-27T19:09:44.641000Z"}
{"component":"virt-launcher","level":"info","msg":"hostname: kargo3","subcomponent":"libvirt","thread":"40","timestamp":"2022-04-27T19:09:44.641000Z"}
{"component":"virt-launcher","level":"error","msg":"internal error: Child process (dmidecode -q -t 0,1,2,3,4,11,17) unexpected exit status 1: /dev/mem: No such file or directory","pos":"virCommandWait:2749","subcomponent":"libvirt","thread":"40","timestamp":"2022-04-27T19:09:44.641000Z"}
{"component":"virt-launcher","level":"info","msg":"Connected to libvirt daemon","pos":"libvirt.go:511","timestamp":"2022-04-27T19:09:45.119274Z"}
{"component":"virt-launcher","level":"info","msg":"Registered libvirt event notify callback","pos":"client.go:509","timestamp":"2022-04-27T19:09:45.130444Z"}
{"component":"virt-launcher","level":"info","msg":"Marked as ready","pos":"virt-launcher.go:80","timestamp":"2022-04-27T19:09:45.131330Z"}
panic: timed out waiting for domain to be defined

goroutine 1 [running]:
main.waitForDomainUUID(0xc000084900, 0xc000084780, 0xc0019fa840, {0x1ca6b00, 0xc00022e000})
        cmd/virt-launcher/virt-launcher.go:250 +0x43a
main.main()
        cmd/virt-launcher/virt-launcher.go:504 +0x141a
{"component":"virt-launcher","level":"info","msg":"Reaped pid 15 with status 512","pos":"virt-launcher.go:554","timestamp":"2022-04-27T19:14:42.146151Z"}
{"component":"virt-launcher","level":"error","msg":"dirty virt-launcher shutdown: exit-code 2","pos":"virt-launcher.go:572","timestamp":"2022-04-27T19:14:42.147078Z"}

@maiqueb
Copy link
Contributor Author

maiqueb commented May 9, 2022

@maiqueb I tested image docker.io/katamo/cluster-network-addons-operator:cdd6cf1 built from commit cdd6cf1

Here is pastebin output of: kubectl get all -A

Looks like an improvement. We're seeing the same scc error on the linux-bridge component now though. Looking at your patch, I wonder if we also need an scc patch in hack/components/bump-linux-bridge.sh?

@usrbinkat it might make sense for you to remove the linux-bridge configuration from CNAO's CR - odds are microshift itself installs that plugin.

I'll ship around the idea of adding an SCC for this plugin.

Warning   Failed: FailedToApply   networkaddonsconfig/cluster    Operator failed: could not apply (security.openshift.io/v1, Kind=SecurityContextConstraints) /linux-bridge: could not create (security.openshift.io/v1, Kind=SecurityContextConstraints) /linux-bridge: SecurityContextConstraints.security.openshift.io "linux-bridge" is invalid: volumes: Required value

I also attempted to run a VM with multus interface on microshift in the current condition and got the following results.

...

@maiqueb
Copy link
Contributor Author

maiqueb commented May 24, 2022

/test pull-e2e-cluster-network-addons-operator-workflow-k8s

@maiqueb
Copy link
Contributor Author

maiqueb commented May 31, 2022

/hold cancel

The SCC issue seems to be fixed, since the provided logs no longer show any SCC issue.

There is still a deeper issue, preventing multus from creating a link on the pod's netns, which I am currently debugging.

@kubevirt-bot kubevirt-bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label May 31, 2022
@maiqueb
Copy link
Contributor Author

maiqueb commented May 31, 2022

Had to force push here because I saw the following error when testing with the following CR:

  • error
default                  3m18s       Warning   Failed: FailedToApply   networkaddonsconfig/cluster              Operator failed: could not apply (security.openshift.io/v1, Kind=SecurityContextConstraints) /bridge-marker: could not create (security.openshift.io/v1, Kind=SecurityContextConstraints) /bridge-marker: SecurityContextConstraints.security.openshift.io "bridge-marker" is invalid: [allowHostDirVolumePlugin: Required value, allowPrivilegedContainer: Required value]
  • configuration
apiVersion: networkaddonsoperator.network.kubevirt.io/v1
kind: NetworkAddonsConfig
metadata:
  annotations:
  name: cluster
spec:
  linuxBridge: {}
  multus: {}

According to openshift's API specification - [0] - the following
attributes are required:
- allowHostDirVolumePlugin
- allowHostIPC
- allowHostNetwork
- allowHostPID
- allowHostPorts
- allowPrivilegedContainer
- readOnlyRootFilesystem

This commits adds the required parameters to the SCCs that were missing
them.

[0] - https://docs.openshift.com/container-platform/4.10/rest_api/security_apis/securitycontextconstraints-security-openshift-io-v1.html

Signed-off-by: Miguel Duarte Barroso <mdbarroso@redhat.com>
The `volume` parameter is marked as required in the SCC CRD, despite
being nullable - and not listed as required in the API doc - [0].

A tracker bug requesting the API to be updated can be found in [1].

[0] - https://docs.openshift.com/container-platform/4.10/rest_api/security_apis/securitycontextconstraints-security-openshift-io-v1.html
[1] - https://bugzilla.redhat.com/show_bug.cgi?id=2079224

Signed-off-by: Miguel Duarte Barroso <mdbarroso@redhat.com>
@sonarcloud
Copy link

sonarcloud bot commented May 31, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@qinqon
Copy link
Collaborator

qinqon commented May 31, 2022

/lgtm
/approve

@kubevirt-bot kubevirt-bot added the lgtm Indicates that a PR is ready to be merged. label May 31, 2022
@kubevirt-bot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: qinqon

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kubevirt-bot kubevirt-bot merged commit 155547a into kubevirt:main May 31, 2022
@maiqueb maiqueb deleted the adjust-sccs branch May 31, 2022 15:51
@maiqueb
Copy link
Contributor Author

maiqueb commented May 31, 2022

@RamLavi could you push a release out with this change ?

I know @usrbinkat is keen on checking out this integration w/ microshift.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. dco-signoff: yes Indicates the PR's author has DCO signed all their commits. lgtm Indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/M
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants