mirror of
https://github.com/edgelesssys/constellation.git
synced 2024-10-01 01:36:09 -04:00
741384158a
KubernetesVersion sent by the init command now controls all downloaded binaries, if they depend on the k8s version. * Move all download links into /internal/versions. * Unify files in /internal/versions package * Move image download links into VersionConfigs and thus make them dependant on the k8s version, where the image version is specific to the k8s version. * Don't specify patch version in k8sVersion
42 lines
1.0 KiB
Go
42 lines
1.0 KiB
Go
package resources
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
"github.com/stretchr/testify/require"
|
|
)
|
|
|
|
func TestAutoscalerDeploymentMarshalUnmarshal(t *testing.T) {
|
|
require := require.New(t)
|
|
assert := assert.New(t)
|
|
|
|
autoscalerDepl := NewDefaultAutoscalerDeployment(nil, nil, nil, "")
|
|
|
|
data, err := autoscalerDepl.Marshal()
|
|
require.NoError(err)
|
|
|
|
t.Log(string(data))
|
|
|
|
var recreated autoscalerDeployment
|
|
require.NoError(UnmarshalK8SResources(data, &recreated))
|
|
assert.Equal(autoscalerDepl, &recreated)
|
|
}
|
|
|
|
func TestAutoscalerDeploymentWithCommandMarshalUnmarshal(t *testing.T) {
|
|
require := require.New(t)
|
|
assert := assert.New(t)
|
|
|
|
autoscalerDepl := NewDefaultAutoscalerDeployment(nil, nil, nil, "")
|
|
autoscalerDepl.SetAutoscalerCommand("someProvider", []string{"group1", "group2"})
|
|
|
|
data, err := autoscalerDepl.Marshal()
|
|
require.NoError(err)
|
|
|
|
t.Log(string(data))
|
|
|
|
var recreated autoscalerDeployment
|
|
require.NoError(UnmarshalK8SResources(data, &recreated))
|
|
assert.Equal(autoscalerDepl, &recreated)
|
|
}
|