Skip to content

Commit

Permalink
Publish HvTypeKubevirt optional capabilities to controller
Browse files Browse the repository at this point in the history
eve info api publishes OptionalCapabilities to the controller.
HvTypeKubevirt is one of the fields which specifies if the device supports kubevirt virtualization.
On kubevirt eve setting that field to true

Signed-off-by: Pramodh Pallapothu <pramodh@zededa.com>
  • Loading branch information
Pramodh Pallapothu authored and eriknordmark committed Mar 27, 2024
1 parent 53f04d9 commit 7859da6
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
7 changes: 7 additions & 0 deletions pkg/pillar/cmd/zedagent/reportinfo.go
Original file line number Diff line number Diff line change
Expand Up @@ -630,6 +630,7 @@ func PublishDeviceInfoToZedCloud(ctx *zedagentContext, dest destinationBitset) {
ReportDeviceInfo.RebootInprogress = ctx.rebootCmd || ctx.deviceReboot

ReportDeviceInfo.Capabilities = getCapabilities(ctx)
ReportDeviceInfo.OptionalCapabilities = getOptionalCapabilities(ctx)

devState := getDeviceState(ctx)
if ctx.devState != devState {
Expand Down Expand Up @@ -1262,6 +1263,12 @@ func getCapabilities(ctx *zedagentContext) *info.Capabilities {
}
}

func getOptionalCapabilities(ctx *zedagentContext) *info.OptionalCapabilities {
return &info.OptionalCapabilities{
HvTypeKubevirt: ctx.hvTypeKube,
}
}

func getBaseosUpdateCounter(ctx *zedagentContext) uint32 {
m, err := ctx.subBaseOsMgrStatus.Get("global")
if err != nil {
Expand Down
4 changes: 4 additions & 0 deletions pkg/pillar/cmd/zedagent/zedagent.go
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,9 @@ type zedagentContext struct {
fatalPtr *bool
hangPtr *bool

// Is Kubevirt eve
hvTypeKube bool

// Netdump
netDumper *netdump.NetDumper // nil if netdump is disabled
netdumpInterval time.Duration
Expand Down Expand Up @@ -608,6 +611,7 @@ func (zedagentCtx *zedagentContext) init() {

attestCtx.zedagentCtx = zedagentCtx
zedagentCtx.attestCtx = attestCtx
zedagentCtx.hvTypeKube = base.IsHVTypeKube()
}

func initializeDirs() {
Expand Down

0 comments on commit 7859da6

Please sign in to comment.