Skip to content

Commit

Permalink
add more tests and update based on comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Daisy Guo committed Jan 15, 2020
1 parent de2a54d commit 467edd9
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pkg/kn/commands/source/apiserver/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ type resourceSpec struct {
IsController bool
}

// getAPIServerResourceArray is to return an array of ApiServerResource from a string. A sample is Event:v1:true,Pod:v2:false
// getAPIServerResourceArray is to construct an array of resources.
func (f *APIServerSourceUpdateFlags) getAPIServerResourceArray() ([]resourceSpec, error) {
var resourceList []resourceSpec
for _, r := range f.Resources {
Expand All @@ -60,7 +60,7 @@ func (f *APIServerSourceUpdateFlags) getAPIServerResourceArray() ([]resourceSpec
return resourceList, nil
}

// getAPIServerResourceArray is to return an array of ApiServerResource from a string. A sample is Event:v1:true
// getUpdateAPIServerResourceArray is to construct an array of resources for update action.
func (f *APIServerSourceUpdateFlags) getUpdateAPIServerResourceArray() ([]resourceSpec, []resourceSpec, error) {
var added []resourceSpec
var removed []resourceSpec
Expand All @@ -83,6 +83,7 @@ func (f *APIServerSourceUpdateFlags) getUpdateAPIServerResourceArray() ([]resour
return added, removed, nil
}

//getValidResource is to parse resource spec from a string
func getValidResource(resource string) (*resourceSpec, error) {
var isController = false //false as default
var err error
Expand Down

0 comments on commit 467edd9

Please sign in to comment.