@@ -1625,6 +1625,12 @@ func TestQuotaPendingRequeueAfter(t *testing.T) {
16251625 }
16261626}
16271627
1628+ // Shared literals for the instance-sizing / blocking-reason tests below
1629+ // (extracted to satisfy goconst).
1630+ const (
1631+ testContainerName = "app"
1632+ testContainerImage = "test/image:latest"
1633+ )
16281634
16291635// TestReconcileInstanceReadyCondition_ProviderSubConditionSurfacing verifies
16301636// that provider-set sub-condition reasons (e.g. ImageUnavailable written by the
@@ -1950,11 +1956,11 @@ func TestResolveInstanceResources(t *testing.T) {
19501956 }
19511957
19521958 tests := []struct {
1953- name string
1954- instance * computev1alpha.Instance
1955- wantCPU int64
1956- wantMem int64
1957- wantResolved bool
1959+ name string
1960+ instance * computev1alpha.Instance
1961+ wantCPU int64
1962+ wantMem int64
1963+ wantResolved bool
19581964 }{
19591965 {
19601966 // Common production case: instanceType only, no explicit limits.
@@ -1965,7 +1971,7 @@ func TestResolveInstanceResources(t *testing.T) {
19651971 Spec : computev1alpha.InstanceSpec {
19661972 Runtime : computev1alpha.InstanceRuntimeSpec {
19671973 Resources : computev1alpha.InstanceRuntimeResources {
1968- InstanceType : "datumcloud/d1-standard-2" ,
1974+ InstanceType : instanceTypeD1Standard2 ,
19691975 },
19701976 },
19711977 },
@@ -1982,13 +1988,13 @@ func TestResolveInstanceResources(t *testing.T) {
19821988 Spec : computev1alpha.InstanceSpec {
19831989 Runtime : computev1alpha.InstanceRuntimeSpec {
19841990 Resources : computev1alpha.InstanceRuntimeResources {
1985- InstanceType : "datumcloud/d1-standard-2" ,
1991+ InstanceType : instanceTypeD1Standard2 ,
19861992 },
19871993 Sandbox : & computev1alpha.SandboxRuntime {
19881994 Containers : []computev1alpha.SandboxContainer {
19891995 {
1990- Name : "app" ,
1991- Image : "test/image:latest" ,
1996+ Name : testContainerName ,
1997+ Image : testContainerImage ,
19921998 Resources : makeContainerResources (cpu500m , mem256Mi ),
19931999 },
19942000 {
@@ -2015,8 +2021,8 @@ func TestResolveInstanceResources(t *testing.T) {
20152021 Sandbox : & computev1alpha.SandboxRuntime {
20162022 Containers : []computev1alpha.SandboxContainer {
20172023 {
2018- Name : "app" ,
2019- Image : "test/image:latest" ,
2024+ Name : testContainerName ,
2025+ Image : testContainerImage ,
20202026 Resources : makeContainerResources (cpu1 , mem512Mi ),
20212027 },
20222028 },
@@ -2087,13 +2093,13 @@ func TestResolveInstanceResources(t *testing.T) {
20872093 Spec : computev1alpha.InstanceSpec {
20882094 Runtime : computev1alpha.InstanceRuntimeSpec {
20892095 Resources : computev1alpha.InstanceRuntimeResources {
2090- InstanceType : "datumcloud/d1-standard-2" ,
2096+ InstanceType : instanceTypeD1Standard2 ,
20912097 },
20922098 Sandbox : & computev1alpha.SandboxRuntime {
20932099 Containers : []computev1alpha.SandboxContainer {
20942100 {
2095- Name : "app" ,
2096- Image : "test/image:latest" ,
2101+ Name : testContainerName ,
2102+ Image : testContainerImage ,
20972103 // No Resources.Limits set — common for UKC workloads.
20982104 },
20992105 },
@@ -2158,7 +2164,7 @@ func TestReconcileQuotaClaim_RequestsIncludeVCPUsAndMemory(t *testing.T) {
21582164 Runtime : computev1alpha.InstanceRuntimeSpec {
21592165 Resources : computev1alpha.InstanceRuntimeResources {
21602166 // No Requests, no container Limits — catalog must supply the values.
2161- InstanceType : "datumcloud/d1-standard-2" ,
2167+ InstanceType : instanceTypeD1Standard2 ,
21622168 },
21632169 },
21642170 NetworkInterfaces : []computev1alpha.InstanceNetworkInterface {},
0 commit comments