Skip to content
This repository has been archived by the owner on May 12, 2021. It is now read-only.

Commit

Permalink
vc: deprecate hyperstart agent
Browse files Browse the repository at this point in the history
The hyperstart agent has not been supported in kata since 2.1,
so remove it as a component to kata. Mentioned in issue #1113.

Fixes: #1419

Signed-off-by: Gabi Beyer <gabrielle.n.beyer@intel.com>
  • Loading branch information
gabibeyer authored and Gabi Beyer committed Apr 12, 2019
1 parent d5a759e commit d4ef9c0
Show file tree
Hide file tree
Showing 21 changed files with 50 additions and 3,944 deletions.
11 changes: 4 additions & 7 deletions pkg/katautils/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,7 @@ const (
kataShimTableType = "kata"

// supported agent component types
hyperstartAgentTableType = "hyperstart"
kataAgentTableType = "kata"
kataAgentTableType = "kata"

// the maximum amount of PCI bridges that can be cold plugged in a VM
maxPCIBridges uint32 = 5
Expand Down Expand Up @@ -639,15 +638,13 @@ func updateRuntimeConfigAgent(configPath string, tomlConf tomlConfig, config *oc

for k := range tomlConf.Agent {
switch k {
case hyperstartAgentTableType:
config.AgentType = vc.HyperstartAgent
config.AgentConfig = vc.HyperConfig{}

case kataAgentTableType:
config.AgentType = vc.KataContainersAgent
config.AgentConfig = vc.KataAgentConfig{
UseVSock: config.HypervisorConfig.UseVSock,
}
default:
return fmt.Errorf("%s agent type is not supported", k)
}
}

Expand Down Expand Up @@ -788,7 +785,7 @@ func initConfig() (config oci.RuntimeConfig, err error) {
return oci.RuntimeConfig{}, err
}

defaultAgentConfig = vc.HyperConfig{}
defaultAgentConfig = vc.KataAgentConfig{}

config = oci.RuntimeConfig{
HypervisorType: defaultHypervisor,
Expand Down
4 changes: 2 additions & 2 deletions pkg/katautils/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1364,7 +1364,7 @@ func TestDefaultMachineAccelerators(t *testing.T) {
func TestUpdateRuntimeConfiguration(t *testing.T) {
assert := assert.New(t)

assert.NotEqual(defaultAgent, vc.HyperstartAgent)
assert.Equal(defaultAgent, vc.KataContainersAgent)

config := oci.RuntimeConfig{}

Expand Down Expand Up @@ -1433,7 +1433,7 @@ func TestUpdateRuntimeConfigurationFactoryConfig(t *testing.T) {
func TestUpdateRuntimeConfigurationInvalidKernelParams(t *testing.T) {
assert := assert.New(t)

assert.NotEqual(defaultAgent, vc.HyperstartAgent)
assert.Equal(defaultAgent, vc.KataContainersAgent)

config := oci.RuntimeConfig{}

Expand Down
17 changes: 0 additions & 17 deletions virtcontainers/agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,6 @@ const (
// NoopAgentType is the No-Op agent.
NoopAgentType AgentType = "noop"

// HyperstartAgent is the Hyper hyperstart agent.
HyperstartAgent AgentType = "hyperstart"

// KataContainersAgent is the Kata Containers agent.
KataContainersAgent AgentType = "kata"

Expand All @@ -61,9 +58,6 @@ func (agentType *AgentType) Set(value string) error {
case "noop":
*agentType = NoopAgentType
return nil
case "hyperstart":
*agentType = HyperstartAgent
return nil
case "kata":
*agentType = KataContainersAgent
return nil
Expand All @@ -77,8 +71,6 @@ func (agentType *AgentType) String() string {
switch *agentType {
case NoopAgentType:
return string(NoopAgentType)
case HyperstartAgent:
return string(HyperstartAgent)
case KataContainersAgent:
return string(KataContainersAgent)
default:
Expand All @@ -91,8 +83,6 @@ func newAgent(agentType AgentType) agent {
switch agentType {
case NoopAgentType:
return &noopAgent{}
case HyperstartAgent:
return &hyper{}
case KataContainersAgent:
return &kataAgent{}
default:
Expand All @@ -105,13 +95,6 @@ func newAgentConfig(agentType AgentType, agentConfig interface{}) interface{} {
switch agentType {
case NoopAgentType:
return nil
case HyperstartAgent:
var hyperConfig HyperConfig
err := mapstructure.Decode(agentConfig, &hyperConfig)
if err != nil {
return err
}
return hyperConfig
case KataContainersAgent:
var kataAgentConfig KataAgentConfig
err := mapstructure.Decode(agentConfig, &kataAgentConfig)
Expand Down
26 changes: 1 addition & 25 deletions virtcontainers/agent_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,6 @@ func TestSetNoopAgentType(t *testing.T) {
testSetAgentType(t, "noop", NoopAgentType)
}

func TestSetHyperstartAgentType(t *testing.T) {
testSetAgentType(t, "hyperstart", HyperstartAgent)
}

func TestSetKataAgentType(t *testing.T) {
testSetAgentType(t, "kata", KataContainersAgent)
}
Expand All @@ -43,8 +39,7 @@ func TestSetUnknownAgentType(t *testing.T) {
t.Fatal()
}

if agentType == NoopAgentType ||
agentType == HyperstartAgent {
if agentType == NoopAgentType {
t.Fatal()
}
}
Expand All @@ -60,10 +55,6 @@ func TestStringFromNoopAgentType(t *testing.T) {
testStringFromAgentType(t, NoopAgentType, "noop")
}

func TestStringFromHyperstartAgentType(t *testing.T) {
testStringFromAgentType(t, HyperstartAgent, "hyperstart")
}

func TestStringFromKataAgentType(t *testing.T) {
testStringFromAgentType(t, KataContainersAgent, "kata")
}
Expand All @@ -85,10 +76,6 @@ func TestNewAgentFromNoopAgentType(t *testing.T) {
testNewAgentFromAgentType(t, NoopAgentType, &noopAgent{})
}

func TestNewAgentFromHyperstartAgentType(t *testing.T) {
testNewAgentFromAgentType(t, HyperstartAgent, &hyper{})
}

func TestNewAgentFromKataAgentType(t *testing.T) {
testNewAgentFromAgentType(t, KataContainersAgent, &kataAgent{})
}
Expand Down Expand Up @@ -116,17 +103,6 @@ func TestNewAgentConfigFromNoopAgentType(t *testing.T) {
testNewAgentConfig(t, sandboxConfig, agentConfig)
}

func TestNewAgentConfigFromHyperstartAgentType(t *testing.T) {
agentConfig := HyperConfig{}

sandboxConfig := SandboxConfig{
AgentType: HyperstartAgent,
AgentConfig: agentConfig,
}

testNewAgentConfig(t, sandboxConfig, agentConfig)
}

func TestNewAgentConfigFromKataAgentType(t *testing.T) {
agentConfig := KataAgentConfig{UseVSock: true}

Expand Down
Loading

0 comments on commit d4ef9c0

Please sign in to comment.