Skip to content

Commit

Permalink
Merge pull request #173 from kubescape/list
Browse files Browse the repository at this point in the history
disable virtual CRDs with an env
  • Loading branch information
matthyx authored Nov 22, 2024
2 parents dd8eea5 + 35a6ea1 commit dbf4d6c
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions pkg/apiserver/apiserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ limitations under the License.
package apiserver

import (
"os"

"github.com/kubescape/storage/pkg/apis/softwarecomposition"
"github.com/kubescape/storage/pkg/apis/softwarecomposition/install"
"github.com/kubescape/storage/pkg/registry"
Expand Down Expand Up @@ -177,6 +179,11 @@ func (c completedConfig) New() (*WardleServer, error) {
"workloadconfigurationscans": ep(wcsstorage.NewREST),
"workloadconfigurationscansummaries": ep(wcssumstorage.NewREST),
}
if os.Getenv("DISABLE_VIRTUAL_CRDS") == "true" {
delete(apiGroupInfo.VersionedResourcesStorageMap["v1beta1"], "configurationscansummaries")
delete(apiGroupInfo.VersionedResourcesStorageMap["v1beta1"], "generatednetworkpolicies")
delete(apiGroupInfo.VersionedResourcesStorageMap["v1beta1"], "vulnerabilitysummaries")
}

if err := s.GenericAPIServer.InstallAPIGroup(&apiGroupInfo); err != nil {
return nil, err
Expand Down

0 comments on commit dbf4d6c

Please sign in to comment.