@@ -16,12 +16,22 @@ import (
1616type k8sClientMock struct {}
1717
1818var k8sclientGetResourceQuotaMock func (ctx context.Context , namespace , resource string , opts metav1.GetOptions ) (* v1.ResourceQuota , error )
19+ var k8sclientGetSecretMock func (ctx context.Context , namespace , secretName string , opts metav1.GetOptions ) (* v1.Secret , error )
20+ var k8sclientGetServiceMock func (ctx context.Context , namespace , serviceName string , opts metav1.GetOptions ) (* v1.Service , error )
1921
20- // mock function of getResourceQuota()
22+ // mock functions
2123func (c k8sClientMock ) getResourceQuota (ctx context.Context , namespace , resource string , opts metav1.GetOptions ) (* v1.ResourceQuota , error ) {
2224 return k8sclientGetResourceQuotaMock (ctx , namespace , resource , opts )
2325}
2426
27+ func (c k8sClientMock ) getSecret (ctx context.Context , namespace , secretName string , opts metav1.GetOptions ) (* v1.Secret , error ) {
28+ return k8sclientGetSecretMock (ctx , namespace , secretName , opts )
29+ }
30+
31+ func (c k8sClientMock ) getService (ctx context.Context , namespace , serviceName string , opts metav1.GetOptions ) (* v1.Service , error ) {
32+ return k8sclientGetServiceMock (ctx , namespace , serviceName , opts )
33+ }
34+
2535func Test_ResourceQuota (t * testing.T ) {
2636 mockHardResourceQuota := v1.ResourceList {
2737 "storage" : resource .MustParse ("1000" ),
0 commit comments