go.mondoo.com/cnquery@v0.0.0-20231005093811-59568235f6ea/cli/execruntime/detect.go (about)

     1  // Copyright (c) Mondoo, Inc.
     2  // SPDX-License-Identifier: BUSL-1.1
     3  
     4  package execruntime
     5  
     6  const CLIENT_ENV = "client"
     7  
     8  func Detect() *RuntimeEnv {
     9  	// check if it is a known ci environment
    10  	for k := range environmentDef {
    11  		env := environmentDef[k]
    12  		if env.Detect() {
    13  			return env
    14  		}
    15  	}
    16  
    17  	// if we reach here, no environment matches, return empty env
    18  	return &RuntimeEnv{
    19  		Id:        CLIENT_ENV,
    20  		Name:      "Mondoo Client",
    21  		Namespace: "client.mondoo.com",
    22  	}
    23  }