Skip to content

Commit 98097c2

Browse files
CR-11030 (#421)
* bump * wip * refactor gsEdit for include exclude * removed comments
1 parent 4462ab5 commit 98097c2

File tree

2 files changed

+20
-16
lines changed

2 files changed

+20
-16
lines changed

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.42.0
1+
0.43.0

pkg/codefresh/ap_git-sources.go

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ import (
1010

1111
type (
1212
IAppProxyGitSourcesAPI interface {
13-
Create(ctx context.Context, appName, appSpecifier, destServer, destNamespace string, isInternal bool) error
13+
Create(ctx context.Context, opts *appProxyModel.CreateGitSourceInput) error
1414
Delete(ctx context.Context, appName string) error
15-
Edit(ctx context.Context, appName, appSpecifier string) error
15+
Edit(ctx context.Context, opts *appProxyModel.EditGitSourceInput) error
1616
}
1717

1818
appProxyGitSources struct {
@@ -37,27 +37,29 @@ type (
3737
graphqlGitSourceEditResponse struct {
3838
Errors []graphqlError
3939
}
40-
4140
)
4241

4342
func newAppProxyGitSourcesAPI(c *codefresh) IAppProxyGitSourcesAPI {
4443
return &appProxyGitSources{codefresh: c}
4544
}
4645

47-
func (c *appProxyGitSources) Create(ctx context.Context, appName, appSpecifier, destServer, destNamespace string, isInternal bool) error {
46+
47+
func (c *appProxyGitSources) Create(ctx context.Context, opts *appProxyModel.CreateGitSourceInput) error {
4848
jsonData := map[string]interface{}{
4949
"query": `
5050
mutation CreateGitSource($args: CreateGitSourceInput!) {
5151
createGitSource(args: $args)
5252
}
53-
`,
53+
`,
5454
"variables": map[string]interface{}{
5555
"args": appProxyModel.CreateGitSourceInput{
56-
AppName: appName,
57-
AppSpecifier: appSpecifier,
58-
DestServer: destServer,
59-
DestNamespace: destNamespace,
60-
IsInternal: &isInternal,
56+
AppName: opts.AppName,
57+
AppSpecifier: opts.AppSpecifier,
58+
DestServer: opts.DestServer,
59+
DestNamespace: opts.DestNamespace,
60+
IsInternal: opts.IsInternal,
61+
Include: opts.Include,
62+
Exclude: opts.Exclude,
6163
},
6264
},
6365
}
@@ -82,7 +84,7 @@ func (c *appProxyGitSources) Delete(ctx context.Context, appName string) error {
8284
mutation DeleteApplication($args: DeleteApplicationInput!) {
8385
deleteApplication(args: $args)
8486
}
85-
`,
87+
`,
8688
"variables": map[string]interface{}{
8789
"args": appProxyModel.DeleteApplicationInput{
8890
AppName: appName,
@@ -104,17 +106,19 @@ func (c *appProxyGitSources) Delete(ctx context.Context, appName string) error {
104106
return nil
105107
}
106108

107-
func (c *appProxyGitSources) Edit(ctx context.Context, appName, appSpecifier string) error {
109+
func (c *appProxyGitSources) Edit(ctx context.Context, opts *appProxyModel.EditGitSourceInput) error {
108110
jsonData := map[string]interface{}{
109111
"query": `
110112
mutation EditGitSource($args: EditGitSourceInput!) {
111113
editGitSource(args: $args)
112114
}
113-
`,
115+
`,
114116
"variables": map[string]interface{}{
115117
"args": appProxyModel.EditGitSourceInput{
116-
AppName: appName,
117-
AppSpecifier: appSpecifier,
118+
AppName: opts.AppName,
119+
AppSpecifier: opts.AppSpecifier,
120+
Include: opts.Include,
121+
Exclude: opts.Exclude,
118122
},
119123
},
120124
}

0 commit comments

Comments
 (0)