-
Notifications
You must be signed in to change notification settings - Fork 259
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add GMSA support for V2 HCS schema xenon containers
* Add new UVM function 'UpdateHvSocketService' to be able to hot add Hvsocket service table entries. * Add new UVM function 'RemoveHvSocketService' to be able to hot remove an Hvsocket service. * Add disabled field to HvSocketServiceConfig (used to be private in the schema) * Remove hardcoded error if supplying a cred spec and the client asked for a hypervisor isolated container. * Misc refactors (comments, style) Signed-off-by: Daniel Canter <[email protected]>
- Loading branch information
Showing
9 changed files
with
114 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
package uvm | ||
|
||
import ( | ||
"context" | ||
"fmt" | ||
|
||
"github.com/Microsoft/hcsshim/internal/requesttype" | ||
hcsschema "github.com/Microsoft/hcsshim/internal/schema2" | ||
) | ||
|
||
// UpdateHvSocketService calls HCS to update/create the hvsocket service for | ||
// the UVM. Takes in a service ID and the hvsocket service configuration. If there is no | ||
// entry for the service ID already it will be created. The same call on HvSockets side | ||
// handles the Create/Update/Delete cases based on what is passed in. Here is the logic | ||
// for the call. | ||
// | ||
// 1. If the service ID does not currently exist in the service table, it will be created | ||
// with whatever descriptors and state was specified (disabled or not). | ||
// 2. If the service already exists and empty descriptors and Disabled is passed in for the | ||
// service config, the service will be removed. | ||
// 3. Otherwise any combination that is not Disabled && Empty descriptors will just update the | ||
// service. | ||
// | ||
// If the request is crafted with Disabled = True and empty descriptors, then this function | ||
// will behave identically to a call to RemoveHvSocketService. Prefer RemoveHvSocketService for this | ||
// behavior as the relevant fields are set on HCS' side. | ||
func (uvm *UtilityVM) UpdateHvSocketService(ctx context.Context, sid string, doc *hcsschema.HvSocketServiceConfig) error { | ||
request := &hcsschema.ModifySettingRequest{ | ||
RequestType: requesttype.Update, | ||
ResourcePath: fmt.Sprintf(hvsocketConfigResourceFormat, sid), | ||
Settings: doc, | ||
} | ||
return uvm.modify(ctx, request) | ||
} | ||
|
||
// RemoveHvSocketService will remove an hvsocket service entry if it exists. | ||
func (uvm *UtilityVM) RemoveHvSocketService(ctx context.Context, sid string) error { | ||
request := &hcsschema.ModifySettingRequest{ | ||
RequestType: requesttype.Remove, | ||
ResourcePath: fmt.Sprintf(hvsocketConfigResourceFormat, sid), | ||
} | ||
return uvm.modify(ctx, request) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 21 additions & 21 deletions
42
test/vendor/github.com/Microsoft/hcsshim/internal/hcsoci/credentials.go
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
7 changes: 3 additions & 4 deletions
7
test/vendor/github.com/Microsoft/hcsshim/internal/hcsoci/resources.go
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.