Skip to content

Commit a060039

Browse files
fix wrong command error (#219)
* fix wrong command error * bump
1 parent d9a1482 commit a060039

File tree

32 files changed

+24
-425
lines changed

32 files changed

+24
-425
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
VERSION=v0.0.199
1+
VERSION=v0.0.200
22

33
OUT_DIR=dist
44
YEAR?=$(shell date +"%Y")

cmd/commands/common.go

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -12,20 +12,6 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
// Copyright 2021 The Codefresh Authors.
16-
//
17-
// Licensed under the Apache License, Version 2.0 (the "License");
18-
// you may not use this file except in compliance with the License.
19-
// You may obtain a copy of the License at
20-
//
21-
// http://www.apache.org/licenses/LICENSE-2.0
22-
//
23-
// Unless required by applicable law or agreed to in writing, software
24-
// distributed under the License is distributed on an "AS IS" BASIS,
25-
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
26-
// See the License for the specific language governing permissions and
27-
// limitations under the License.
28-
2915
package commands
3016

3117
import (
@@ -405,7 +391,7 @@ func checkIngressHostCertificate(ctx context.Context, ingress string) (bool, err
405391
if !insecureOk {
406392
return false, fmt.Errorf("insecure call failed: %w", err)
407393
}
408-
394+
409395
return false, nil
410396
}
411397

cmd/commands/component.go

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -12,20 +12,6 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
// Copyright 2021 The Codefresh Authors.
16-
//
17-
// Licensed under the Apache License, Version 2.0 (the "License");
18-
// you may not use this file except in compliance with the License.
19-
// You may obtain a copy of the License at
20-
//
21-
// http://www.apache.org/licenses/LICENSE-2.0
22-
//
23-
// Unless required by applicable law or agreed to in writing, software
24-
// distributed under the License is distributed on an "AS IS" BASIS,
25-
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
26-
// See the License for the specific language governing permissions and
27-
// limitations under the License.
28-
2915
package commands
3016

3117
import (
@@ -47,6 +33,7 @@ func NewComponentCommand() *cobra.Command {
4733
Use: "component",
4834
Short: "Manage components of Codefresh runtimes",
4935
PersistentPreRunE: cfConfig.RequireAuthentication,
36+
Args: cobra.NoArgs, // Workaround for subcommand usage errors. See: https://github.com/spf13/cobra/issues/706
5037
Run: func(cmd *cobra.Command, args []string) {
5138
cmd.HelpFunc()(cmd, args)
5239
exit(1)

cmd/commands/config.go

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -12,20 +12,6 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
// Copyright 2021 The Codefresh Authors.
16-
//
17-
// Licensed under the Apache License, Version 2.0 (the "License");
18-
// you may not use this file except in compliance with the License.
19-
// You may obtain a copy of the License at
20-
//
21-
// http://www.apache.org/licenses/LICENSE-2.0
22-
//
23-
// Unless required by applicable law or agreed to in writing, software
24-
// distributed under the License is distributed on an "AS IS" BASIS,
25-
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
26-
// See the License for the specific language governing permissions and
27-
// limitations under the License.
28-
2915
package commands
3016

3117
import (
@@ -45,6 +31,7 @@ func NewConfigCommand() *cobra.Command {
4531
Use: "config",
4632
Short: "Manage Codefresh authentication contexts",
4733
PersistentPreRunE: cfConfig.Load,
34+
Args: cobra.NoArgs, // Workaround for subcommand usage errors. See: https://github.com/spf13/cobra/issues/706
4835
Long: util.Doc(`By default, Codefresh authentication contexts are persisted at $HOME/.cfconfig.
4936
You can create, delete and list authentication contexts using the following
5037
commands, respectively:

cmd/commands/git-source.go

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -11,21 +11,6 @@
1111
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
14-
15-
// Copyright 2021 The Codefresh Authors.
16-
//
17-
// Licensed under the Apache License, Version 2.0 (the "License");
18-
// you may not use this file except in compliance with the License.
19-
// You may obtain a copy of the License at
20-
//
21-
// http://www.apache.org/licenses/LICENSE-2.0
22-
//
23-
// Unless required by applicable law or agreed to in writing, software
24-
// distributed under the License is distributed on an "AS IS" BASIS,
25-
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
26-
// See the License for the specific language governing permissions and
27-
// limitations under the License.
28-
2914
package commands
3015

3116
import (
@@ -73,7 +58,7 @@ type (
7358
CreateDemoResources bool
7459
Exclude string
7560
Include string
76-
IngressHost string
61+
IngressHost string
7762
}
7863

7964
GitSourceDeleteOptions struct {
@@ -109,6 +94,7 @@ func NewGitSourceCommand() *cobra.Command {
10994
Use: "git-source",
11095
Short: "Manage git-sources of Codefresh runtimes",
11196
PersistentPreRunE: cfConfig.RequireAuthentication,
97+
Args: cobra.NoArgs, // Workaround for subcommand usage errors. See: https://github.com/spf13/cobra/issues/706
11298
Run: func(cmd *cobra.Command, args []string) {
11399
cmd.HelpFunc()(cmd, args)
114100
exit(1)
@@ -699,7 +685,7 @@ func createGithubExampleIngress() *netv1.Ingress {
699685
ServiceName: store.Get().GithubExampleEventSourceObjectName + "-eventsource-svc",
700686
ServicePort: store.Get().GithubExampleEventSourceServicePort,
701687
},
702-
}, })
688+
}})
703689
}
704690

705691
func getRepoOwnerAndNameFromRepoURL(repoURL string) (owner string, name string) {

cmd/commands/integrations.go

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -11,21 +11,6 @@
1111
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
14-
15-
// Copyright 2021 The Codefresh Authors.
16-
//
17-
// Licensed under the Apache License, Version 2.0 (the "License");
18-
// you may not use this file except in compliance with the License.
19-
// You may obtain a copy of the License at
20-
//
21-
// http://www.apache.org/licenses/LICENSE-2.0
22-
//
23-
// Unless required by applicable law or agreed to in writing, software
24-
// distributed under the License is distributed on an "AS IS" BASIS,
25-
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
26-
// See the License for the specific language governing permissions and
27-
// limitations under the License.
28-
2914
package commands
3015

3116
import (
@@ -70,6 +55,7 @@ func NewIntegrationCommand() *cobra.Command {
7055
Aliases: []string{"integrations", "intg"},
7156
Short: "Manage integrations with git providers, container registries and more",
7257
PersistentPreRunE: getAppProxyClient(&runtime, &client),
58+
Args: cobra.NoArgs, // Workaround for subcommand usage errors. See: https://github.com/spf13/cobra/issues/706
7359
Run: func(cmd *cobra.Command, args []string) {
7460
cmd.HelpFunc()(cmd, args)
7561
exit(1)

cmd/commands/pipeline.go

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -12,20 +12,6 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
// Copyright 2021 The Codefresh Authors.
16-
//
17-
// Licensed under the Apache License, Version 2.0 (the "License");
18-
// you may not use this file except in compliance with the License.
19-
// You may obtain a copy of the License at
20-
//
21-
// http://www.apache.org/licenses/LICENSE-2.0
22-
//
23-
// Unless required by applicable law or agreed to in writing, software
24-
// distributed under the License is distributed on an "AS IS" BASIS,
25-
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
26-
// See the License for the specific language governing permissions and
27-
// limitations under the License.
28-
2915
package commands
3016

3117
import (
@@ -46,6 +32,7 @@ func NewPipelineCommand() *cobra.Command {
4632
Use: "pipeline",
4733
Short: "Manage pipelines of Codefresh runtimes",
4834
PersistentPreRunE: cfConfig.RequireAuthentication,
35+
Args: cobra.NoArgs, // Workaround for subcommand usage errors. See: https://github.com/spf13/cobra/issues/706
4936
Run: func(cmd *cobra.Command, args []string) {
5037
cmd.HelpFunc()(cmd, args)
5138
exit(1)

cmd/commands/root.go

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -12,20 +12,6 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
// Copyright 2021 The Codefresh Authors.
16-
//
17-
// Licensed under the Apache License, Version 2.0 (the "License");
18-
// you may not use this file except in compliance with the License.
19-
// You may obtain a copy of the License at
20-
//
21-
// http://www.apache.org/licenses/LICENSE-2.0
22-
//
23-
// Unless required by applicable law or agreed to in writing, software
24-
// distributed under the License is distributed on an "AS IS" BASIS,
25-
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
26-
// See the License for the specific language governing permissions and
27-
// limitations under the License.
28-
2915
package commands
3016

3117
import (

cmd/commands/runtime.go

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -12,20 +12,6 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
// Copyright 2021 The Codefresh Authors.
16-
//
17-
// Licensed under the Apache License, Version 2.0 (the "License");
18-
// you may not use this file except in compliance with the License.
19-
// You may obtain a copy of the License at
20-
//
21-
// http://www.apache.org/licenses/LICENSE-2.0
22-
//
23-
// Unless required by applicable law or agreed to in writing, software
24-
// distributed under the License is distributed on an "AS IS" BASIS,
25-
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
26-
// See the License for the specific language governing permissions and
27-
// limitations under the License.
28-
2915
package commands
3016

3117
import (
@@ -141,6 +127,7 @@ func NewRuntimeCommand() *cobra.Command {
141127
Use: "runtime",
142128
Short: "Manage Codefresh runtimes",
143129
PersistentPreRunE: cfConfig.RequireAuthentication,
130+
Args: cobra.NoArgs, // Workaround for subcommand usage errors. See: https://github.com/spf13/cobra/issues/706
144131
Run: func(cmd *cobra.Command, args []string) {
145132
cmd.HelpFunc()(cmd, args)
146133
exit(1)
@@ -314,7 +301,7 @@ func ensureIngressHost(cmd *cobra.Command, opts *RuntimeInstallOptions) error {
314301
if err != nil {
315302
log.G(cmd.Context()).Fatalf("failed to check ingress host: %v", err)
316303
}
317-
304+
318305
if !certValid {
319306
if err = askUserIfToProceedWithInsecure(cmd.Context()); err != nil {
320307
return err

cmd/commands/version.go

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -12,20 +12,6 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
// Copyright 2021 The Codefresh Authors.
16-
//
17-
// Licensed under the Apache License, Version 2.0 (the "License");
18-
// you may not use this file except in compliance with the License.
19-
// You may obtain a copy of the License at
20-
//
21-
// http://www.apache.org/licenses/LICENSE-2.0
22-
//
23-
// Unless required by applicable law or agreed to in writing, software
24-
// distributed under the License is distributed on an "AS IS" BASIS,
25-
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
26-
// See the License for the specific language governing permissions and
27-
// limitations under the License.
28-
2915
package commands
3016

3117
import (

0 commit comments

Comments
 (0)