Skip to content

Commit

Permalink
OCM-7902 | ci: Bump ocm-common to support key re-generation for proxy…
Browse files Browse the repository at this point in the history
… preparation
  • Loading branch information
xueli181114 committed May 10, 2024
1 parent 0a5850c commit 6c9cb8e
Show file tree
Hide file tree
Showing 15 changed files with 178 additions and 94 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ require (
github.com/nathan-fiscaletti/consolesize-go v0.0.0-20210105204122-a87d9f614b9d
github.com/onsi/ginkgo/v2 v2.17.1
github.com/onsi/gomega v1.30.0
github.com/openshift-online/ocm-common v0.0.0-20240426075354-0921f33327e3
github.com/openshift-online/ocm-common v0.0.0-20240508111534-37822c515806
github.com/openshift-online/ocm-sdk-go v0.1.418
github.com/pkg/errors v0.9.1
github.com/robfig/cron/v3 v3.0.1
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -271,8 +271,8 @@ github.com/onsi/ginkgo/v2 v2.17.1 h1:V++EzdbhI4ZV4ev0UTIj0PzhzOcReJFyJaLjtSF55M8
github.com/onsi/ginkgo/v2 v2.17.1/go.mod h1:llBI3WDLL9Z6taip6f33H76YcWtJv+7R3HigUjbIBOs=
github.com/onsi/gomega v1.30.0 h1:hvMK7xYz4D3HapigLTeGdId/NcfQx1VHMJc60ew99+8=
github.com/onsi/gomega v1.30.0/go.mod h1:9sxs+SwGrKI0+PWe4Fxa9tFQQBG5xSsSbMXOI8PPpoQ=
github.com/openshift-online/ocm-common v0.0.0-20240426075354-0921f33327e3 h1:y5uWnDsW1kggef4rXfXiHO1avR3q7O/UOyG1LZAq7Vg=
github.com/openshift-online/ocm-common v0.0.0-20240426075354-0921f33327e3/go.mod h1:TajXvAf+ieJvlrCvzbVAq1gqf0CMmtT39sHbL549KKw=
github.com/openshift-online/ocm-common v0.0.0-20240508111534-37822c515806 h1:YEDgruMDet/LJyav5G6VuvMhCf3tm7mQxR9ZS/yjn2E=
github.com/openshift-online/ocm-common v0.0.0-20240508111534-37822c515806/go.mod h1:aAE9ThwbT6pHKyVP15TW724yV0uvdNL3ZnIxena2j5s=
github.com/openshift-online/ocm-sdk-go v0.1.418 h1:UgMcx16YOS0cs6c0b0ZXbffnjciiuvAp2fE63tnLwLI=
github.com/openshift-online/ocm-sdk-go v0.1.418/go.mod h1:CiAu2jwl3ITKOxkeV0Qnhzv4gs35AmpIzVABQLtcI2Y=
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
Expand Down
2 changes: 1 addition & 1 deletion tests/ci/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ func init() {
Test.ClusterInstallLogArtifactFile = path.Join(Test.ArtifactDir, ".install.log")
Test.ClusterAdminFile = path.Join(Test.ArtifactDir, ".admin")
Test.TestFocusFile = path.Join(Test.RootDir, "tests", "ci", "data", "commit-focus")
Test.ProxySSHPemFile = path.Join(Test.OutputDir, "openshift-qe.pem")
Test.ProxySSHPemFile = "ocm-test-proxy"
Test.ProxyCABundleFile = path.Join(Test.OutputDir, "proxy-bundle.ca")

waitingTime, err := strconv.Atoi(common.ReadENVWithDefaultValue("CLUSTER_TIMEOUT", "60"))
Expand Down
2 changes: 1 addition & 1 deletion tests/ci/data/profiles/rosa-classic.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ profiles:
- as: rosa-advanced
version: "latest"
channel_group: "candidate"
region: "us-east-1"
region: "us-west-2"
cluster:
multi_az: true
instance_type: "r5.xlarge"
Expand Down
12 changes: 9 additions & 3 deletions tests/e2e/dummy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import (
"github.com/openshift/rosa/tests/utils/config"
"github.com/openshift/rosa/tests/utils/exec/rosacli"
"github.com/openshift/rosa/tests/utils/log"
"github.com/openshift/rosa/tests/utils/profilehandler"
PH "github.com/openshift/rosa/tests/utils/profilehandler"
)

Expand Down Expand Up @@ -50,12 +49,19 @@ var _ = Describe("ROSA CLI Test", func() {
})
Describe("ocm-common test", func() {
It("VPCClientTesting", func() {
vpcClient, err := profilehandler.PrepareVPC("us-east-1", "xueli-test", "10.0.0.0/16")
vpcClient, err := PH.PrepareVPC("us-east-1", "xueli-test", "10.0.0.0/16")
Expect(err).ToNot(HaveOccurred())
defer vpcClient.DeleteVPCChain(true)
subnets, err := profilehandler.PrepareSubnets(vpcClient, "us-east-1", []string{}, true)
subnets, err := PH.PrepareSubnets(vpcClient, "us-east-1", []string{}, true)
Expect(err).ToNot(HaveOccurred())
Expect(len(subnets)).To(Equal(2))
_, ip, ca, err := vpcClient.LaunchProxyInstance("us-east-1a", "xueli-test", TC.Test.OutputDir)

Expect(err).ToNot(HaveOccurred())
fmt.Println(ip)
fmt.Println(ca)
log.Logger.Infof("Got configured proxy ip: %v", ip)
log.Logger.Infof("Got configured proxy ca: %v", ca)
})

})
Expand Down
4 changes: 2 additions & 2 deletions tests/utils/profilehandler/data_preparation.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,8 @@ func PrepareSubnets(vpcClient *vpc_client.VPC, region string, zones []string, mu
return resultMap, nil
}

func PrepareProxy(vpcClient *vpc_client.VPC, zone string, sshPemFile string, caFile string) (*ProxyDetail, error) {
_, privateIP, caContent, err := vpcClient.LaunchProxyInstance("", zone, sshPemFile)
func PrepareProxy(vpcClient *vpc_client.VPC, zone string, sshPemFileName string, sshPemFileRecordDir string, caFile string) (*ProxyDetail, error) {
_, privateIP, caContent, err := vpcClient.LaunchProxyInstance(zone, sshPemFileName, sshPemFileRecordDir)
if err != nil {
return nil, err
}
Expand Down
6 changes: 5 additions & 1 deletion tests/utils/profilehandler/profile_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,11 @@ func GenerateClusterCreateFlags(profile *Profile, client *rosacli.Client) ([]str
}
}
if profile.ClusterConfig.ProxyEnabled {
proxy, err := PrepareProxy(vpc, profile.Region, config.Test.ProxySSHPemFile, config.Test.ProxyCABundleFile)
proxyName := vpc.VPCName
if proxyName == "" {
proxyName = clusterName
}
proxy, err := PrepareProxy(vpc, profile.Region, proxyName, config.Test.OutputDir, config.Test.ProxyCABundleFile)
if err != nil {
return flags, err
}
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 6c9cb8e

Please sign in to comment.