@@ -1806,6 +1806,192 @@ func createGenericJobAWWithStatus(context *context, name string) *arbv1.AppWrapp
1806
1806
return appwrapper
1807
1807
}
1808
1808
1809
+ func createGenericJobAWWithMultipleStatus (context * context , name string ) * arbv1.AppWrapper {
1810
+ rb := []byte (`{
1811
+ "apiVersion": "batch/v1",
1812
+ "kind": "Job",
1813
+ "metadata": {
1814
+ "name": "aw-test-job-with-comp-ms-21-1",
1815
+ "namespace": "test"
1816
+ },
1817
+ "spec": {
1818
+ "completions": 1,
1819
+ "parallelism": 1,
1820
+ "template": {
1821
+ "metadata": {
1822
+ "labels": {
1823
+ "appwrapper.mcad.ibm.com": "aw-test-job-with-comp-ms-21"
1824
+ }
1825
+ },
1826
+ "spec": {
1827
+ "containers": [
1828
+ {
1829
+ "args": [
1830
+ "sleep 5"
1831
+ ],
1832
+ "command": [
1833
+ "/bin/bash",
1834
+ "-c",
1835
+ "--"
1836
+ ],
1837
+ "image": "ubuntu:latest",
1838
+ "imagePullPolicy": "IfNotPresent",
1839
+ "name": "aw-test-job-with-comp-ms-21-1",
1840
+ "resources": {
1841
+ "limits": {
1842
+ "cpu": "100m",
1843
+ "memory": "256M"
1844
+ },
1845
+ "requests": {
1846
+ "cpu": "100m",
1847
+ "memory": "256M"
1848
+ }
1849
+ }
1850
+ }
1851
+ ],
1852
+ "restartPolicy": "Never"
1853
+ }
1854
+ }
1855
+ }
1856
+ }` )
1857
+
1858
+ rb2 := []byte (`{
1859
+ "apiVersion": "batch/v1",
1860
+ "kind": "Job",
1861
+ "metadata": {
1862
+ "name": "aw-test-job-with-comp-ms-21-2",
1863
+ "namespace": "test"
1864
+ },
1865
+ "spec": {
1866
+ "completions": 1,
1867
+ "parallelism": 1,
1868
+ "template": {
1869
+ "metadata": {
1870
+ "labels": {
1871
+ "appwrapper.mcad.ibm.com": "aw-test-job-with-comp-ms-21"
1872
+ }
1873
+ },
1874
+ "spec": {
1875
+ "containers": [
1876
+ {
1877
+ "args": [
1878
+ "sleep 5"
1879
+ ],
1880
+ "command": [
1881
+ "/bin/bash",
1882
+ "-c",
1883
+ "--"
1884
+ ],
1885
+ "image": "ubuntu:latest",
1886
+ "imagePullPolicy": "IfNotPresent",
1887
+ "name": "aw-test-job-with-comp-ms-21-2",
1888
+ "resources": {
1889
+ "limits": {
1890
+ "cpu": "100m",
1891
+ "memory": "256M"
1892
+ },
1893
+ "requests": {
1894
+ "cpu": "100m",
1895
+ "memory": "256M"
1896
+ }
1897
+ }
1898
+ }
1899
+ ],
1900
+ "restartPolicy": "Never"
1901
+ }
1902
+ }
1903
+ }
1904
+ }` )
1905
+
1906
+ aw := & arbv1.AppWrapper {
1907
+ ObjectMeta : metav1.ObjectMeta {
1908
+ Name : name ,
1909
+ Namespace : "test" ,
1910
+ },
1911
+ Spec : arbv1.AppWrapperSpec {
1912
+ AggrResources : arbv1.AppWrapperResourceList {
1913
+ GenericItems : []arbv1.AppWrapperGenericResource {
1914
+ {
1915
+ ObjectMeta : metav1.ObjectMeta {
1916
+ Name : fmt .Sprintf ("%s-%s" , name , "aw-test-job-with-comp-ms-21-1" ),
1917
+ Namespace : "test" ,
1918
+ },
1919
+ DesiredAvailable : 1 ,
1920
+ GenericTemplate : runtime.RawExtension {
1921
+ Raw : rb ,
1922
+ },
1923
+ CompletionStatus : "Complete" ,
1924
+ },
1925
+ {
1926
+ ObjectMeta : metav1.ObjectMeta {
1927
+ Name : fmt .Sprintf ("%s-%s" , name , "aw-test-job-with-comp-ms-21-2" ),
1928
+ Namespace : "test" ,
1929
+ },
1930
+ DesiredAvailable : 1 ,
1931
+ GenericTemplate : runtime.RawExtension {
1932
+ Raw : rb2 ,
1933
+ },
1934
+ CompletionStatus : "Complete" ,
1935
+ },
1936
+ },
1937
+ },
1938
+ },
1939
+ }
1940
+
1941
+ appwrapper , err := context .karclient .ArbV1 ().AppWrappers (context .namespace ).Create (aw )
1942
+ Expect (err ).NotTo (HaveOccurred ())
1943
+
1944
+ return appwrapper
1945
+ }
1946
+
1947
+ func createAWGenericItemWithoutStatus (context * context , name string ) * arbv1.AppWrapper {
1948
+ rb := []byte (`{
1949
+ "apiVersion": "scheduling.sigs.k8s.io/v1alpha1",
1950
+ "kind": "PodGroup",
1951
+ "metadata": {
1952
+ "name": "aw-schd-spec-with-timeout-1",
1953
+ "namespace": "default",
1954
+ "labels":{
1955
+ "appwrapper.mcad.ibm.com": "aw-test-job-with-comp-44"
1956
+ }
1957
+ },
1958
+ "spec": {
1959
+ "minMember": 1
1960
+ }
1961
+ }` )
1962
+ var schedSpecMin int = 1
1963
+ aw := & arbv1.AppWrapper {
1964
+ ObjectMeta : metav1.ObjectMeta {
1965
+ Name : name ,
1966
+ Namespace : "test" ,
1967
+ },
1968
+ Spec : arbv1.AppWrapperSpec {
1969
+ SchedSpec : arbv1.SchedulingSpecTemplate {
1970
+ MinAvailable : schedSpecMin ,
1971
+ },
1972
+ AggrResources : arbv1.AppWrapperResourceList {
1973
+ GenericItems : []arbv1.AppWrapperGenericResource {
1974
+ {
1975
+ ObjectMeta : metav1.ObjectMeta {
1976
+ Name : fmt .Sprintf ("%s-%s" , name , "aw-test-job-with-comp-44" ),
1977
+ Namespace : "test" ,
1978
+ },
1979
+ DesiredAvailable : 1 ,
1980
+ GenericTemplate : runtime.RawExtension {
1981
+ Raw : rb ,
1982
+ },
1983
+ },
1984
+ },
1985
+ },
1986
+ },
1987
+ }
1988
+
1989
+ appwrapper , err := context .karclient .ArbV1 ().AppWrappers (context .namespace ).Create (aw )
1990
+ Expect (err ).NotTo (HaveOccurred ())
1991
+
1992
+ return appwrapper
1993
+ }
1994
+
1809
1995
func createGenericJobAWWithScheduleSpec (context * context , name string ) * arbv1.AppWrapper {
1810
1996
rb := []byte (`{
1811
1997
"apiVersion": "batch/v1",
@@ -3185,6 +3371,42 @@ func createBadGenericPodAW(context *context, name string) *arbv1.AppWrapper {
3185
3371
3186
3372
return appwrapper
3187
3373
}
3374
+
3375
+ func createBadGenericItemAW (context * context , name string ) * arbv1.AppWrapper {
3376
+ //rb := []byte(`""`)
3377
+ var schedSpecMin int = 1
3378
+
3379
+ aw := & arbv1.AppWrapper {
3380
+ ObjectMeta : metav1.ObjectMeta {
3381
+ Name : name ,
3382
+ Namespace : context .namespace ,
3383
+ },
3384
+ Spec : arbv1.AppWrapperSpec {
3385
+ SchedSpec : arbv1.SchedulingSpecTemplate {
3386
+ MinAvailable : schedSpecMin ,
3387
+ },
3388
+ AggrResources : arbv1.AppWrapperResourceList {
3389
+ GenericItems : []arbv1.AppWrapperGenericResource {
3390
+ {
3391
+ ObjectMeta : metav1.ObjectMeta {
3392
+ Name : fmt .Sprintf ("%s-%s" , name , "item" ),
3393
+ Namespace : context .namespace ,
3394
+ },
3395
+ // GenericTemplate: runtime.RawExtension{
3396
+ // Raw: rb,
3397
+ // },
3398
+ },
3399
+ },
3400
+ },
3401
+ },
3402
+ }
3403
+
3404
+ appwrapper , err := context .karclient .ArbV1 ().AppWrappers (context .namespace ).Create (aw )
3405
+ Expect (err ).NotTo (HaveOccurred ())
3406
+
3407
+ return appwrapper
3408
+ }
3409
+
3188
3410
func createBadGenericPodTemplateAW (context * context , name string ) (* arbv1.AppWrapper , error ) {
3189
3411
rb := []byte (`{"metadata":
3190
3412
{
0 commit comments