Remove unnecessary constants

Change-Id: Ib54ce13e552efb4ac8efe00c18956ed65b46d564
This commit is contained in:
Vladimir Kozhukalov 2020-12-16 17:37:52 +03:00 committed by Dmitry Ukov
parent d97dccb4cf
commit b0d171d0ec
7 changed files with 17 additions and 14 deletions

View File

@ -91,7 +91,7 @@ func TestNoContextsGetContextCmd(t *testing.T) {
func getNamedTestContext(contextName string) *config.Context {
newContext := &config.Context{
NameInKubeconf: fmt.Sprintf("%s_%s", contextName, config.Ephemeral),
NameInKubeconf: contextName,
Manifest: fmt.Sprintf("Manifest_%s", contextName),
}

View File

@ -1,12 +1,12 @@
contextKubeconf: ContextBar_ephemeral
contextKubeconf: ContextBar
managementConfiguration: ""
manifest: Manifest_ContextBar
contextKubeconf: ContextBaz_ephemeral
contextKubeconf: ContextBaz
managementConfiguration: ""
manifest: Manifest_ContextBaz
contextKubeconf: ContextFoo_ephemeral
contextKubeconf: ContextFoo
managementConfiguration: ""
manifest: Manifest_ContextFoo

View File

@ -1,4 +1,4 @@
contextKubeconf: ContextFoo_ephemeral
contextKubeconf: ContextFoo
managementConfiguration: ""
manifest: Manifest_ContextFoo

View File

@ -1,4 +1,4 @@
contextKubeconf: ContextBaz_ephemeral
contextKubeconf: ContextBaz
managementConfiguration: ""
manifest: Manifest_ContextBaz

View File

@ -1,12 +1,12 @@
contextKubeconf: ContextBar_ephemeral
contextKubeconf: ContextBar
managementConfiguration: ""
manifest: Manifest_ContextBar
contextKubeconf: ContextBaz_ephemeral
contextKubeconf: ContextBaz
managementConfiguration: ""
manifest: Manifest_ContextBaz
contextKubeconf: ContextFoo_ephemeral
contextKubeconf: ContextFoo
managementConfiguration: ""
manifest: Manifest_ContextFoo

View File

@ -18,9 +18,6 @@ import "opendev.org/airship/airshipctl/pkg/remote/redfish"
// Constants related to Phases
const (
Ephemeral = "ephemeral"
InitinfraPhase = "initinfra"
ClusterctlPhase = InitinfraPhase
BootstrapPhase = "bootstrap-iso"
)
@ -63,3 +60,8 @@ const (
// DefaultManifestMetadataFile default path to manifest metadata file
DefaultManifestMetadataFile = "manifests/site/test-site/metadata.yaml"
)
// Default values for auxiliary parameters
const (
KubectlTempFilePrefix = "initinfra"
)

View File

@ -21,6 +21,7 @@ import (
"k8s.io/cli-runtime/pkg/genericclioptions"
cmdutil "k8s.io/kubectl/pkg/cmd/util"
"opendev.org/airship/airshipctl/pkg/config"
"opendev.org/airship/airshipctl/pkg/document"
"opendev.org/airship/airshipctl/pkg/fs"
"opendev.org/airship/airshipctl/pkg/log"
@ -73,7 +74,7 @@ func (kubectl *Kubectl) ApplyDocs(docs []document.Document, ao *ApplyOptions) er
// ApplyYaml is abstraction to kubectl apply command
func (kubectl *Kubectl) ApplyYaml(yaml []byte, ao *ApplyOptions) error {
tf, err := kubectl.TempFile(kubectl.bufferDir, "initinfra")
tf, err := kubectl.TempFile(kubectl.bufferDir, config.KubectlTempFilePrefix)
if err != nil {
return err
}