Remove unnecessary constants
Change-Id: Ib54ce13e552efb4ac8efe00c18956ed65b46d564
This commit is contained in:
parent
d97dccb4cf
commit
b0d171d0ec
@ -91,7 +91,7 @@ func TestNoContextsGetContextCmd(t *testing.T) {
|
|||||||
|
|
||||||
func getNamedTestContext(contextName string) *config.Context {
|
func getNamedTestContext(contextName string) *config.Context {
|
||||||
newContext := &config.Context{
|
newContext := &config.Context{
|
||||||
NameInKubeconf: fmt.Sprintf("%s_%s", contextName, config.Ephemeral),
|
NameInKubeconf: contextName,
|
||||||
Manifest: fmt.Sprintf("Manifest_%s", contextName),
|
Manifest: fmt.Sprintf("Manifest_%s", contextName),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
contextKubeconf: ContextBar_ephemeral
|
contextKubeconf: ContextBar
|
||||||
managementConfiguration: ""
|
managementConfiguration: ""
|
||||||
manifest: Manifest_ContextBar
|
manifest: Manifest_ContextBar
|
||||||
|
|
||||||
contextKubeconf: ContextBaz_ephemeral
|
contextKubeconf: ContextBaz
|
||||||
managementConfiguration: ""
|
managementConfiguration: ""
|
||||||
manifest: Manifest_ContextBaz
|
manifest: Manifest_ContextBaz
|
||||||
|
|
||||||
contextKubeconf: ContextFoo_ephemeral
|
contextKubeconf: ContextFoo
|
||||||
managementConfiguration: ""
|
managementConfiguration: ""
|
||||||
manifest: Manifest_ContextFoo
|
manifest: Manifest_ContextFoo
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
contextKubeconf: ContextFoo_ephemeral
|
contextKubeconf: ContextFoo
|
||||||
managementConfiguration: ""
|
managementConfiguration: ""
|
||||||
manifest: Manifest_ContextFoo
|
manifest: Manifest_ContextFoo
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
contextKubeconf: ContextBaz_ephemeral
|
contextKubeconf: ContextBaz
|
||||||
managementConfiguration: ""
|
managementConfiguration: ""
|
||||||
manifest: Manifest_ContextBaz
|
manifest: Manifest_ContextBaz
|
||||||
|
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
contextKubeconf: ContextBar_ephemeral
|
contextKubeconf: ContextBar
|
||||||
managementConfiguration: ""
|
managementConfiguration: ""
|
||||||
manifest: Manifest_ContextBar
|
manifest: Manifest_ContextBar
|
||||||
|
|
||||||
contextKubeconf: ContextBaz_ephemeral
|
contextKubeconf: ContextBaz
|
||||||
managementConfiguration: ""
|
managementConfiguration: ""
|
||||||
manifest: Manifest_ContextBaz
|
manifest: Manifest_ContextBaz
|
||||||
|
|
||||||
contextKubeconf: ContextFoo_ephemeral
|
contextKubeconf: ContextFoo
|
||||||
managementConfiguration: ""
|
managementConfiguration: ""
|
||||||
manifest: Manifest_ContextFoo
|
manifest: Manifest_ContextFoo
|
||||||
|
|
||||||
|
@ -18,10 +18,7 @@ import "opendev.org/airship/airshipctl/pkg/remote/redfish"
|
|||||||
|
|
||||||
// Constants related to Phases
|
// Constants related to Phases
|
||||||
const (
|
const (
|
||||||
Ephemeral = "ephemeral"
|
BootstrapPhase = "bootstrap-iso"
|
||||||
InitinfraPhase = "initinfra"
|
|
||||||
ClusterctlPhase = InitinfraPhase
|
|
||||||
BootstrapPhase = "bootstrap-iso"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// Constants defining default values
|
// Constants defining default values
|
||||||
@ -63,3 +60,8 @@ const (
|
|||||||
// DefaultManifestMetadataFile default path to manifest metadata file
|
// DefaultManifestMetadataFile default path to manifest metadata file
|
||||||
DefaultManifestMetadataFile = "manifests/site/test-site/metadata.yaml"
|
DefaultManifestMetadataFile = "manifests/site/test-site/metadata.yaml"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// Default values for auxiliary parameters
|
||||||
|
const (
|
||||||
|
KubectlTempFilePrefix = "initinfra"
|
||||||
|
)
|
||||||
|
@ -21,6 +21,7 @@ import (
|
|||||||
"k8s.io/cli-runtime/pkg/genericclioptions"
|
"k8s.io/cli-runtime/pkg/genericclioptions"
|
||||||
cmdutil "k8s.io/kubectl/pkg/cmd/util"
|
cmdutil "k8s.io/kubectl/pkg/cmd/util"
|
||||||
|
|
||||||
|
"opendev.org/airship/airshipctl/pkg/config"
|
||||||
"opendev.org/airship/airshipctl/pkg/document"
|
"opendev.org/airship/airshipctl/pkg/document"
|
||||||
"opendev.org/airship/airshipctl/pkg/fs"
|
"opendev.org/airship/airshipctl/pkg/fs"
|
||||||
"opendev.org/airship/airshipctl/pkg/log"
|
"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
|
// ApplyYaml is abstraction to kubectl apply command
|
||||||
func (kubectl *Kubectl) ApplyYaml(yaml []byte, ao *ApplyOptions) error {
|
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 {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user