mirror of
https://github.com/SAP/jenkins-library.git
synced 2025-03-05 15:15:44 +02:00
* Implement helm step * Create kubernetes package * Refactoring helm.go * Add package, test commands * Add test for helm package * Add tests for helm.go * Add tests for helm.go * Add tests for utils.go * Add tests for helmExecute.go * small fix * Add helm lint * small fix * small fix * Fix according to comments * Fix test * small fix * Add helm add function * Changes according to new comments * Add helm push * Add unit tests * Add tests for helmExecute * Add small fix * small fix * small fix * Move DeployUtilsBundle from kubernetesDeploy to kubernetes package * small fix * small fix * Add unit-tests * Fix * Update resources/metadata/helmExecute.yaml * Update resources/metadata/helmExecute.yaml * Add helm chart server parameterization * small fix * small fix Co-authored-by: “Vitalii <“vitalii.sidorov@sap.com”> Co-authored-by: Oliver Nocon <33484802+OliverNocon@users.noreply.github.com>
40 lines
1.0 KiB
Go
40 lines
1.0 KiB
Go
package kubernetes
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
)
|
|
|
|
func TestRunUtils(t *testing.T) {
|
|
t.Run("Get container info", func(t *testing.T) {
|
|
testTable := []struct {
|
|
config HelmExecuteOptions
|
|
expectedContainerInfo map[string]string
|
|
expectedError error
|
|
}{
|
|
{
|
|
config: HelmExecuteOptions{
|
|
Image: "dtzar/helm-kubectl:3.4.1",
|
|
ContainerImageName: "",
|
|
ContainerImageTag: "",
|
|
ContainerRegistryURL: "https://hub.docker.com/",
|
|
},
|
|
expectedContainerInfo: map[string]string{
|
|
"containerImageName": "dtzar/helm-kubectl",
|
|
"containerImageTag": "3.4.1",
|
|
},
|
|
expectedError: nil,
|
|
},
|
|
}
|
|
|
|
for _, testCase := range testTable {
|
|
containerInfo, err := getContainerInfo(testCase.config)
|
|
assert.NoError(t, err)
|
|
assert.Equal(t, testCase.expectedContainerInfo["containerImageName"], containerInfo["containerImageName"])
|
|
assert.Equal(t, testCase.expectedContainerInfo["containerImageTag"], containerInfo["containerImageTag"])
|
|
|
|
}
|
|
})
|
|
}
|