Skip to content

Commit 090a149

Browse files
committed
wip
1 parent 9f54b91 commit 090a149

File tree

11 files changed

+34
-8
lines changed

11 files changed

+34
-8
lines changed

venona/VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.4.12
1+
1.4.13

venona/go.sum

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,7 @@ github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.m
151151
github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
152152
github.com/evanphx/json-patch v4.2.0+incompatible h1:fUDGZCv/7iAN7u0puUVhvKCcsR6vRfwrJatElLBEf0I=
153153
github.com/evanphx/json-patch v4.2.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk=
154+
github.com/evanphx/json-patch v4.5.0+incompatible h1:ouOWdg56aJriqS0huScTkVXPC5IcNrDCXZ6OoTAWu7M=
154155
github.com/evanphx/json-patch v4.5.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk=
155156
github.com/exponent-io/jsonpath v0.0.0-20151013193312-d6023ce2651d/go.mod h1:ZZMPRZwes7CROmyNKgQzC3XPs6L/G2EJLHddWejkmf4=
156157
github.com/fatih/camelcase v1.0.0/go.mod h1:yN2Sb0lFhZJUdVvtELVWefmrXpuZESvPmqwoZc+/fpc=

venonactl/VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.4.12
1+
1.4.13

venonactl/cmd/install-runtime.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ import (
2828
var installRuntimeCmdOptions struct {
2929
codefreshToken string
3030
dryRun bool
31+
insecure bool
3132
kube struct {
3233
namespace string
3334
inCluster bool
@@ -97,6 +98,7 @@ var installRuntimeCmd = &cobra.Command{
9798
CodefreshToken: installRuntimeCmdOptions.codefreshToken,
9899
RuntimeEnvironment: installRuntimeCmdOptions.runtimeEnvironmentName,
99100
ClusterNamespace: installRuntimeCmdOptions.kube.namespace,
101+
Insecure: installRuntimeCmdOptions.insecure,
100102
}
101103

102104
if installRuntimeCmdOptions.kubernetesRunnerType {
@@ -168,6 +170,7 @@ func init() {
168170
installRuntimeCmd.Flags().StringVar(&installRuntimeCmdOptions.storageClass, "storage-class", "", "Set a name of your custom storage class, note: this will not install volume provisioning components")
169171
installRuntimeCmd.Flags().StringVar(&installRuntimeCmdOptions.dockerRegistry, "docker-registry", "", "The prefix for the container registry that will be used for pulling the required components images. Example: --docker-registry=\"docker.io\"")
170172

173+
installRuntimeCmd.Flags().BoolVar(&installRuntimeCmdOptions.insecure, "insecure", false, "Set to true to disable TLS when comunicating with the codefresh platform")
171174
installRuntimeCmd.Flags().BoolVar(&installRuntimeCmdOptions.kube.inCluster, "in-cluster", false, "Set flag if venona is been installed from inside a cluster")
172175
installRuntimeCmd.Flags().BoolVar(&installRuntimeCmdOptions.dryRun, "dry-run", false, "Set to true to simulate installation")
173176
installRuntimeCmd.Flags().BoolVar(&installRuntimeCmdOptions.kubernetesRunnerType, "kubernetes-runner-type", false, "Set the runner type to kubernetes (alpha feature)")

venonactl/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ require (
77
github.com/Masterminds/semver v1.5.0
88
github.com/Masterminds/sprig v2.22.0+incompatible
99
github.com/briandowns/spinner v1.11.1
10-
github.com/codefresh-io/go-sdk v0.18.0
10+
github.com/codefresh-io/go-sdk v0.19.4
1111
github.com/dustin/go-humanize v1.0.0
1212
github.com/gophercloud/gophercloud v0.8.0 // indirect
1313
github.com/huandu/xstrings v1.3.0 // indirect

venonactl/go.sum

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,8 @@ github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDk
7777
github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8=
7878
github.com/codefresh-io/go-sdk v0.18.0 h1:tSP1m89l66qQ2PF5NvuUCL5dCorxQUGhyq7lyRKv35Q=
7979
github.com/codefresh-io/go-sdk v0.18.0/go.mod h1:b6hK9euSW+MDXUDHU1+YgP8vzcij749I31ZIZSXed+I=
80+
github.com/codefresh-io/go-sdk v0.19.4 h1:f0r6lc+XuWQxN152qE80cRw6zWGll2aalo+MRgAfoHg=
81+
github.com/codefresh-io/go-sdk v0.19.4/go.mod h1:b6hK9euSW+MDXUDHU1+YgP8vzcij749I31ZIZSXed+I=
8082
github.com/containerd/cgroups v0.0.0-20190919134610-bf292b21730f/go.mod h1:OApqhQ4XNSNC13gXIwDjhOQxjWa/NxkwZXJ1EvqT0ko=
8183
github.com/containerd/console v0.0.0-20180822173158-c12b1e7919c1/go.mod h1:Tj/on1eG8kiEhd0+fhSDzsPAFESxzBBvdyEgyryXffw=
8284
github.com/containerd/containerd v1.3.0-beta.2.0.20190828155532-0293cbd26c69/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA=
@@ -321,6 +323,7 @@ github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5
321323
github.com/mitchellh/copystructure v1.0.0 h1:Laisrj+bAB6b/yJwB5Bt3ITZhGJdqmxquMKeZ+mmkFQ=
322324
github.com/mitchellh/copystructure v1.0.0/go.mod h1:SNtv71yrdKgLRyLFxmLdkAbkKEFWgYaq1OVrnRcwhnw=
323325
github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0=
326+
github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y=
324327
github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0=
325328
github.com/mitchellh/go-wordwrap v1.0.0/go.mod h1:ZXFpozHsX6DPmq2I0TCekCxypsnAUbP2oI0UX1GXzOo=
326329
github.com/mitchellh/mapstructure v1.1.2 h1:fmNYVwqnSfB9mZU6OS2O6GsXM+wcskZDuKQzvN1EDeE=

venonactl/hack/build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@ go fmt ${PWD}/pkg/obj/kubeobj/kubeobj.go
66
go fmt ${PWD}/pkg/templates/kubernetes/templates.go
77
VERSION="$(cat VERSION)-$(git rev-parse --short HEAD)"
88
echo "Setting up version $VERSION"
9-
go build -ldflags "-X github.com/codefresh-io/venona/venonactl/cmd.version=$VERSION" -o $OUTFILE main.go
9+
go build -ldflags "-X github.com/codefresh-io/venona/venonactl/cmd.version=$VERSION" -v -o $OUTFILE main.go
1010

1111
chmod +x $OUTFILE

venonactl/pkg/codefresh/cfapi.go

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@ package codefresh
1818

1919
import (
2020
"bytes"
21+
"crypto/tls"
2122
"fmt"
23+
"net/http"
2224

2325
"archive/zip"
2426

@@ -39,6 +41,7 @@ type (
3941
ClusterNamespace string
4042
RegisterWithAgent bool
4143
MarkAsDefault bool
44+
Insecure bool
4245
StorageClass string
4346
IsDefaultStorageClass bool
4447
KubernetesRunnerType bool
@@ -73,13 +76,27 @@ type (
7376

7477
// NewCodefreshAPI - creates new codefresh api
7578
func NewCodefreshAPI(opt *APIOptions) API {
79+
httpClient := &http.Client{}
80+
if opt.Insecure {
81+
// #nosec
82+
tr := http.Transport{
83+
TLSClientConfig: &tls.Config{
84+
InsecureSkipVerify: true,
85+
},
86+
}
87+
httpClient = &http.Client{
88+
Transport: &tr,
89+
}
90+
}
91+
7692
return &api{
7793
logger: opt.Logger,
7894
codefresh: codefresh.New(&codefresh.ClientOptions{
7995
Auth: codefresh.AuthOptions{
8096
Token: opt.CodefreshToken,
8197
},
82-
Host: opt.CodefreshHost,
98+
Host: opt.CodefreshHost,
99+
Client: httpClient,
83100
}),
84101
clustername: opt.ClusterName,
85102
clusternamespace: opt.ClusterNamespace,
@@ -123,7 +140,7 @@ func (a *api) Sign() (*certs.ServerCert, error) {
123140
respBodyReaderAt := bytes.NewReader(byteArray)
124141
zipReader, err := zip.NewReader(respBodyReaderAt, int64(len(byteArray)))
125142
if err != nil {
126-
a.logger.Debug("Failed to create zip reader from given certificate " + fmt.Sprintf("%s",byteArray))
143+
a.logger.Debug("Failed to create zip reader from given certificate " + fmt.Sprintf("%s", byteArray))
127144
return nil, err
128145
}
129146
for _, zf := range zipReader.File {

venonactl/pkg/plugins/plugin.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ type (
7575
RuntimeClusterName string
7676
RuntimeServiceAccount string
7777
RestartAgent bool
78+
Insecure bool
7879
}
7980

8081
DeleteOptions struct {

venonactl/pkg/plugins/runtime-environment.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ func (u *runtimeEnvironmentPlugin) Install(opt *InstallOptions, v Values) (Value
6060
KubernetesRunnerType: opt.KubernetesRunnerType,
6161
BuildNodeSelector: opt.BuildNodeSelector,
6262
Annotations: opt.Annotations,
63+
Insecure: opt.Insecure,
6364
}
6465

6566
// Set storage Class by backend
@@ -144,7 +145,7 @@ func (u *runtimeEnvironmentPlugin) Upgrade(_ *UpgradeOptions, v Values) (Values,
144145
func (u *runtimeEnvironmentPlugin) Migrate(opt *MigrateOptions, v Values) error {
145146
return u.Delete(&DeleteOptions{
146147
ClusterNamespace: opt.ClusterNamespace,
147-
KubeBuilder: opt.KubeBuilder,
148+
KubeBuilder: opt.KubeBuilder,
148149
}, v)
149150
}
150151

0 commit comments

Comments
 (0)