Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

security fix: removal of go-git #896

Merged
merged 4 commits into from
Jan 24, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
*.html
.vscode
.idea
.run
**/.env
*.DS_Store
managevm
Expand Down
2 changes: 1 addition & 1 deletion docs/development/integration_tests.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ If the Control Cluster is a Gardener SEED cluster, then the suite ideally employ

1. Define the variable `IS_CONTROL_CLUSTER_SEED` in the `.env` file and set it to `true`.
`Warning:` Make sure to set the `CONTROL_NAMESPACE` variable to the shoot namespace where the control plane of the target resides.
1. Please pass `TARGET_RESOURCE_GROUP` in the `.env` file. It will be used for the `ResourceGroupName` in Azure clusters. Keep it as target cluster name for gardener shoot clusters.This is compulsory for Azure clusters.
1. Please pass `TARGET_CLUSTER_NAME` in the `.env` file. It will be used for the `ResourceGroupName` in Azure clusters. Keep it as target cluster name for gardener shoot clusters.This is compulsory for Azure clusters.
rishabh-11 marked this conversation as resolved.
Show resolved Hide resolved
1. (Optional) User can employ a custom `MachineClass` for the tests using below steps:
1. Deploy a `Secret` named `test-mc-secret` (that contains the provider secret and cloud-config) in the shoot namespace of the Control Cluster. That is, the value of `metadata.namespace` should be `technicalID` of the Shoot and it will be of the pattern `shoot--<project>--<shoot-name>`.
1. Create a `dev/machineclassv1.yaml` file and add an entry in the `.env` file with `MACHINECLASS_V1=dev/machineclassv1.yaml`.
Expand Down
14 changes: 0 additions & 14 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ require (
github.com/Masterminds/semver v1.5.0
github.com/cenkalti/backoff/v4 v4.2.1
github.com/davecgh/go-spew v1.1.1
github.com/go-git/go-git/v5 v5.4.2
github.com/google/uuid v1.3.0
github.com/onsi/ginkgo/v2 v2.13.0
github.com/onsi/gomega v1.29.0
Expand All @@ -28,17 +27,11 @@ require (
)

require (
github.com/Microsoft/go-winio v0.4.16 // indirect
github.com/ProtonMail/go-crypto v0.0.0-20210428141323-04723f9f07d7 // indirect
github.com/acomagu/bufpipe v1.0.3 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/blang/semver/v4 v4.0.0 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/emicklei/go-restful/v3 v3.9.0 // indirect
github.com/emirpasic/gods v1.12.0 // indirect
github.com/evanphx/json-patch v4.12.0+incompatible // indirect
github.com/go-git/gcfg v1.5.0 // indirect
github.com/go-git/go-billy/v5 v5.3.1 // indirect
github.com/go-logr/logr v1.3.0 // indirect
github.com/go-openapi/jsonpointer v0.19.6 // indirect
github.com/go-openapi/jsonreference v0.20.2 // indirect
Expand All @@ -53,24 +46,18 @@ require (
github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1 // indirect
github.com/imdario/mergo v0.3.12 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/kevinburke/ssh_config v0.0.0-20201106050909-4977a11b4351 // indirect
github.com/mailru/easyjson v0.7.7 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect
github.com/mitchellh/go-homedir v1.1.0 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/prometheus/client_model v0.4.0 // indirect
github.com/prometheus/common v0.44.0 // indirect
github.com/prometheus/procfs v0.10.1 // indirect
github.com/sergi/go-diff v1.1.0 // indirect
github.com/spf13/cobra v1.7.0 // indirect
github.com/xanzy/ssh-agent v0.3.0 // indirect
golang.org/x/crypto v0.14.0 // indirect
golang.org/x/mod v0.13.0 // indirect
golang.org/x/net v0.17.0 // indirect
golang.org/x/oauth2 v0.8.0 // indirect
Expand All @@ -82,7 +69,6 @@ require (
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/protobuf v1.30.0 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/warnings.v0 v0.1.2 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
k8s.io/gengo v0.0.0-20220902162205-c0856e24416d // indirect
Expand Down
69 changes: 0 additions & 69 deletions go.sum

Large diffs are not rendered by default.

32 changes: 20 additions & 12 deletions pkg/test/integration/common/framework.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import (
"context"
"encoding/json"
"fmt"
"github.com/onsi/ginkgo/v2"
"io"
"log"
"os"
Expand All @@ -29,9 +28,8 @@ import (
"strings"
"time"

"github.com/gardener/machine-controller-manager/pkg/apis/machine/v1alpha1"
"github.com/gardener/machine-controller-manager/pkg/test/integration/common/helpers"
"github.com/gardener/machine-controller-manager/pkg/test/utils/matchers"
"github.com/onsi/ginkgo/v2"

"github.com/onsi/gomega"
"github.com/onsi/gomega/gexec"
appsV1 "k8s.io/api/apps/v1"
Expand All @@ -40,6 +38,10 @@ import (
"k8s.io/apimachinery/pkg/types"
"k8s.io/apimachinery/pkg/watch"
"k8s.io/client-go/util/retry"

"github.com/gardener/machine-controller-manager/pkg/apis/machine/v1alpha1"
"github.com/gardener/machine-controller-manager/pkg/test/integration/common/helpers"
"github.com/gardener/machine-controller-manager/pkg/test/utils/matchers"
)

const (
Expand All @@ -49,8 +51,8 @@ const (
var (
// path for storing log files (mcm & mc processes)
targetDir = filepath.Join("..", "..", "..", ".ci", "controllers-test", "logs")
// Suffix for the`kubernetes-io-cluster` tag and cluster name for the orphan resource tracker. Currently relevant only for Azure
targetClusterName = os.Getenv("TARGET_RESOURCE_GROUP")
// Suffix for the`kubernetes-io-cluster` tag and cluster name for the orphan resource tracker. Used as ResourceGroupName for Azure clusters
targetClusterName = os.Getenv("TARGET_CLUSTER_NAME")
// machine-controller-manager log file
mcmLogFile = filepath.Join(targetDir, "mcm_process.log")

Expand Down Expand Up @@ -778,9 +780,7 @@ func (c *IntegrationTestFramework) SetupBeforeSuite() {
ginkgo.By("Updating MCM Deployemnt")
gomega.Expect(c.prepareMcmDeployment(mcContainerImage, mcmContainerImage, false)).To(gomega.BeNil())
} else {
ginkgo.By("Cloning Machine-Controller-Manager github repo")
gomega.Expect(helpers.CloneRepo("https://github.com/gardener/machine-controller-manager.git", mcmRepoPath)).
To(gomega.BeNil())
checkMcmRepoAvailable()

ginkgo.By("Scaledown existing machine controllers")
gomega.Expect(c.scaleMcmDeployment(0)).To(gomega.BeNil())
Expand All @@ -790,9 +790,7 @@ func (c *IntegrationTestFramework) SetupBeforeSuite() {
} else {
//TODO : Scaledown the MCM deployment of the actual seed of the target cluster

ginkgo.By("Cloning Machine-Controller-Manager github repo")
gomega.Expect(helpers.CloneRepo("https://github.com/gardener/machine-controller-manager.git", mcmRepoPath)).
To(gomega.BeNil())
checkMcmRepoAvailable()

//create the custom resources in the control cluster using yaml files
//available in kubernetes/crds directory of machine-controller-manager repo
Expand Down Expand Up @@ -1414,3 +1412,13 @@ func (c *IntegrationTestFramework) Cleanup() {
}

}

func checkMcmRepoAvailable() {
ginkgo.By("Checking Machine-Controller-Manager repo is available at: " + mcmRepoPath)
_, err := os.Stat(mcmRepoPath)
gomega.Expect(err).To(gomega.BeNil(), "No MCM dir at: "+mcmRepoPath)

_, err = os.Stat(mcmRepoPath + "/.git")
gomega.Expect(err).To(gomega.BeNil(), "Not a git repo at: "+mcmRepoPath)

}
70 changes: 0 additions & 70 deletions pkg/test/integration/common/helpers/handling_git.go

This file was deleted.

1 change: 0 additions & 1 deletion vendor/github.com/Microsoft/go-winio/.gitignore

This file was deleted.

22 changes: 0 additions & 22 deletions vendor/github.com/Microsoft/go-winio/LICENSE

This file was deleted.

22 changes: 0 additions & 22 deletions vendor/github.com/Microsoft/go-winio/README.md

This file was deleted.

Loading