Skip to content

Commit

Permalink
Remove pointer to containerSpec
Browse files Browse the repository at this point in the history
  • Loading branch information
sebrandon1 committed Sep 3, 2024
1 parent 54dacb2 commit 5bfb474
Show file tree
Hide file tree
Showing 19 changed files with 31 additions and 23 deletions.
8 changes: 8 additions & 0 deletions .github/workflows/makefile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,14 @@ jobs:

- uses: actions/checkout@v4

- name: Extract dependent Pull Requests
uses: depends-on/depends-on-action@9e8a61fce18b15281e831f1bba0e14c71d1e1f46 # main
with:
token: ${{ secrets.GITHUB_TOKEN }}

- name: Run vendor
run: go mod vendor

- name: Run lint
run: make lint

Expand Down
2 changes: 1 addition & 1 deletion tests/accel/upgrade/internal/createres/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ func Workload(apiClient *clients.Settings, workloadImage string) (*deployment.Bu
workloadDeployment, err := deployment.NewBuilder(
upgradeinittools.HubAPIClient, upgradeparams.DeploymentName, upgradeparams.TestNamespaceName, map[string]string{
"app": upgradeparams.DeploymentName,
}, containerConfig).WithLabel("app", upgradeparams.DeploymentName).CreateAndWaitUntilReady(time.Second * 120)
}, *containerConfig).WithLabel("app", upgradeparams.DeploymentName).CreateAndWaitUntilReady(time.Second * 120)

if err != nil {
return nil, fmt.Errorf("failed to create workload with error: %w", err)
Expand Down
4 changes: 2 additions & 2 deletions tests/cnf/core/network/cni/tests/tap/tap.go
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ var _ = Describe("", Ordered,
Expect(err).ToNot(HaveOccurred(), "Fail to collect container configuration")
deploymentBuilder := deployment.NewBuilder(
APIClient, "deployment-one",
tsparams.TestNamespaceName, map[string]string{"test": "tap"}, deploymentContainer)
tsparams.TestNamespaceName, map[string]string{"test": "tap"}, *deploymentContainer)

var deploymentNetCfg []*types.NetworkSelectionElement

Expand Down Expand Up @@ -333,7 +333,7 @@ var _ = Describe("", Ordered,
"deployment-one",
tsparams.TestNamespaceName,
map[string]string{"test": "tap"},
deploymentContainer).WithSecondaryNetwork(deploymentNetCfg).
*deploymentContainer).WithSecondaryNetwork(deploymentNetCfg).
CreateAndWaitUntilReady(tsparams.DefaultTimeout)
Expect(err).ToNot(HaveOccurred(), "Fail to create deployment")

Expand Down
2 changes: 1 addition & 1 deletion tests/cnf/core/network/dpdk/tests/rootless.go
Original file line number Diff line number Diff line change
Expand Up @@ -491,7 +491,7 @@ var _ = Describe("rootless", Ordered, Label(tsparams.LabelSuite), ContinueOnFail
Expect(err).ToNot(HaveOccurred(), "Fail to get deployment container config")

_, err = deployment.NewBuilder(
APIClient, "deployment-one", tsparams.TestNamespaceName, map[string]string{"test": "dpdk"}, deploymentContainerCfg).
APIClient, "deployment-one", tsparams.TestNamespaceName, map[string]string{"test": "dpdk"}, *deploymentContainerCfg).
WithNodeSelector(map[string]string{"kubernetes.io/hostname": workerNodes[1].Definition.Name}).
WithSecurityContext(&clientPodSC).
WithLabel("test", "dpdk").
Expand Down
2 changes: 1 addition & 1 deletion tests/hw-accel/kmm/mcm/mcm_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ var _ = BeforeSuite(func() {
WithSecurityContext(kmmparams.PrivilegedSC).GetContainerCfg()

deploymentCfg := deployment.NewBuilder(ModulesConfig.SpokeAPIClient, deploymentName, kmmparams.KmmOperatorNamespace,
map[string]string{kmmparams.KmmTestHelperLabelName: ""}, containerCfg)
map[string]string{kmmparams.KmmTestHelperLabelName: ""}, *containerCfg)
deploymentCfg.WithLabel(kmmparams.KmmTestHelperLabelName, "").
WithNodeSelector(map[string]string{"kubernetes.io/hostname": node.Object.Name}).
WithServiceAccountName("kmm-operator-module-loader")
Expand Down
2 changes: 1 addition & 1 deletion tests/hw-accel/kmm/modules/modules_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ var _ = BeforeSuite(func() {
WithSecurityContext(kmmparams.PrivilegedSC).GetContainerCfg()

deploymentCfg := deployment.NewBuilder(APIClient, deploymentName, kmmparams.KmmOperatorNamespace,
map[string]string{kmmparams.KmmTestHelperLabelName: ""}, containerCfg)
map[string]string{kmmparams.KmmTestHelperLabelName: ""}, *containerCfg)
deploymentCfg.WithLabel(kmmparams.KmmTestHelperLabelName, "").
WithNodeSelector(map[string]string{"kubernetes.io/hostname": node.Object.Name}).
WithServiceAccountName("kmm-operator-module-loader")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@ func ValidateSeedRefLogs() {
"kcat",
"default",
map[string]string{"kcat": ""},
deployCfg,
*deployCfg,
)
_, err = createDeploy.CreateAndWaitUntilReady(2 * time.Minute)
Expect(err).ToNot(HaveOccurred(), "Failed to create kcat deployment")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -505,7 +505,7 @@ func startTestWorkload() {
_, err = deployment.NewBuilder(
APIClient, mgmtparams.LCAWorkloadName, mgmtparams.LCAWorkloadName, map[string]string{
"app": mgmtparams.LCAWorkloadName,
}, &v1.Container{
}, v1.Container{
Name: mgmtparams.LCAWorkloadName,
Image: MGMTConfig.IBUWorkloadImage,
Ports: []v1.ContainerPort{
Expand Down
2 changes: 1 addition & 1 deletion tests/system-tests/internal/reboot/reboot.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ func HardRebootNode(nodeName string, nsName string) error {
}

createDeploy := deployment.NewBuilder(APIClient, systemtestsparams.HardRebootDeploymentName, nsName,
map[string]string{"test": "hardreboot"}, deployContainerCfg)
map[string]string{"test": "hardreboot"}, *deployContainerCfg)
createDeploy = createDeploy.WithNodeSelector(map[string]string{"kubernetes.io/hostname": nodeName})

_, err = createDeploy.CreateAndWaitUntilReady(300 * time.Second)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ func CreateWorkload(apiClient *clients.Settings,
deploymentName,
ipsecparams.TestNamespaceName,
workloadLabels,
deployContainerCfg)
*deployContainerCfg)
createDeploy = createDeploy.WithNodeSelector(map[string]string{"kubernetes.io/hostname": nodeName})

_, err = createDeploy.CreateAndWaitUntilReady(300 * time.Second)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ func defineIPVlanDeployment(dName, nsName, dLabels, netDefName, volName string,
dName,
nsName,
map[string]string{strings.Split(dLabels, "=")[0]: strings.Split(dLabels, "=")[1]},
dContainer)
*dContainer)

By("Adding IPVLAN annotations")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ func defineMacVlanDeployment(dName, nsName, dLabels, netDefName, volName string,
dName,
nsName,
map[string]string{strings.Split(dLabels, "=")[0]: strings.Split(dLabels, "=")[1]},
dContainer)
*dContainer)

By("Adding MACVLAN annotations")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ func defineNROPDeployment(containerConfig *corev1.Container, deployName, deployN

By("Defining NROP deployment")

deployNROP := deployment.NewBuilder(APIClient, deployName, deployNs, deployLabels, containerConfig)
deployNROP := deployment.NewBuilder(APIClient, deployName, deployNs, deployLabels, *containerConfig)

By("Adding NodeSelector to the deployment")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ func createWorkloadWithPVC(fNamespace string, fStorageClass string, fPVCName str
wlkdODFDeployName,
fNamespace,
map[string]string{strings.Split(labelsWlkdOneString, "=")[0]: strings.Split(labelsWlkdOneString, "=")[1]},
deployContainerCfg)
*deployContainerCfg)

By("Adding Volume to the deployment")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ func defineDeployment(containerConfig *corev1.Container, deployName, deployNs, s
deployLabels, nodeSelector map[string]string) *deployment.Builder {
glog.V(rdscoreparams.RDSCoreLogLevel).Infof("Defining deployment %q in %q ns", deployName, deployNs)

deploy := deployment.NewBuilder(APIClient, deployName, deployNs, deployLabels, containerConfig)
deploy := deployment.NewBuilder(APIClient, deployName, deployNs, deployLabels, *containerConfig)

By("Defining SR-IOV annotations")

Expand Down
2 changes: 1 addition & 1 deletion tests/system-tests/spk/internal/spkcommon/dns-suite.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ func VerifyDNSResolutionFromNewDeploy(ctx SpecContext) {
SPKConfig.WorkloadDeploymentName,
SPKConfig.Namespace,
map[string]string{strings.Split(wlkdDeployLabel, "=")[0]: strings.Split(wlkdDeployLabel, "=")[1]},
deployContainerCfg)
*deployContainerCfg)

By("Creating deployment")

Expand Down
4 changes: 2 additions & 2 deletions tests/system-tests/spk/internal/spkcommon/setup-workloads.go
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ func createBackendDeployment() {
SPKBackendDeployName,
SPKConfig.Namespace,
deployLabels,
deployContainerCfg)
*deployContainerCfg)

By("Adding Volume to the deployment")

Expand Down Expand Up @@ -406,7 +406,7 @@ func createBackendUDPDeployment() {
SPKBackendUDPDeployName,
SPKConfig.Namespace,
deployLabels,
deployContainerCfg)
*deployContainerCfg)

By("Setting Replicas count")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ func VerifyScaleObjectDeployment(ctx SpecContext) {
glog.V(vcoreparams.VCoreLogLevel).Infof("Create test application deployment %s in namespace %s",
vcoreparams.KedaWatchAppName, vcoreparams.KedaWatchNamespace)

prometeusImageURL, err := getImageURL(prometheusOriginMirrorURL, prometheusImageName, prometheusImageTag)
prometheusImageURL, err := getImageURL(prometheusOriginMirrorURL, prometheusImageName, prometheusImageTag)
Expect(err).ToNot(HaveOccurred(),
fmt.Sprintf("Failed to generate prometheus image URL for %s/%s:%s due to: %v",
prometheusOriginMirrorURL, prometheusImageName, prometheusImageTag, err))
Expand All @@ -187,9 +187,9 @@ func VerifyScaleObjectDeployment(ctx SpecContext) {
},
}

appConteiner := corev1.Container{
appContainer := corev1.Container{
Name: "prom-test-app",
Image: prometeusImageURL,
Image: prometheusImageURL,
ImagePullPolicy: "IfNotPresent",
SecurityContext: &securityContext,
}
Expand All @@ -198,7 +198,7 @@ func VerifyScaleObjectDeployment(ctx SpecContext) {
vcoreparams.KedaWatchAppName,
vcoreparams.KedaWatchNamespace,
map[string]string{"app": vcoreparams.KedaWatchAppName},
&appConteiner,
appContainer,
).WithLabel("type", "keda-testing").WithReplicas(int32(1)).Create()
Expect(err).ToNot(HaveOccurred(),
fmt.Sprintf("Failed to create test application %s in namespace %s due to: %v",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ func VerifyNROPSchedulingWorkload(ctx SpecContext) {
vcoreparams.NumaWorkloadName,
vcoreparams.NROPNamespace,
workloadSelector,
&corev1.Container{
corev1.Container{
Name: "ctnr",
Image: workloadImage,
ImagePullPolicy: "IfNotPresent",
Expand Down

0 comments on commit 5bfb474

Please sign in to comment.