mirror of
https://github.com/edgelesssys/constellation.git
synced 2025-01-27 07:47:02 -05:00
Rename IsImageDebug -> IsDebugImage for consistency
This commit is contained in:
parent
dd4ccdd390
commit
fe70231f2a
@ -56,7 +56,7 @@ func configFetchMeasurements(cmd *cobra.Command, fileHandler file.Handler, clien
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
if conf.IsImageDebug() {
|
if conf.IsDebugImage() {
|
||||||
cmd.Println("Configured image does not look like a released production image. Double check image before deploying to production.")
|
cmd.Println("Configured image does not look like a released production image. Double check image before deploying to production.")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -67,7 +67,7 @@ func create(cmd *cobra.Command, creator cloudCreator, fileHandler file.Handler,
|
|||||||
return fmt.Errorf("reading and validating config: %w", err)
|
return fmt.Errorf("reading and validating config: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if config.IsImageDebug() {
|
if config.IsDebugImage() {
|
||||||
cmd.Println("Configured image does not look like a released production image. Double check image before deploying to production.")
|
cmd.Println("Configured image does not look like a released production image. Double check image before deploying to production.")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -61,7 +61,7 @@ func deploy(cmd *cobra.Command, fileHandler file.Handler, constellationConfig *c
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
if !constellationConfig.IsImageDebug() {
|
if !constellationConfig.IsDebugImage() {
|
||||||
log.Println("WARN: constellation image does not look like a debug image. Are you using a debug image?")
|
log.Println("WARN: constellation image does not look like a debug image. Are you using a debug image?")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -384,10 +384,10 @@ func (c *Config) RemoveProviderExcept(provider cloudprovider.Provider) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// IsImageDebug checks whether image name looks like a release image, if not it is
|
// IsDebugImage checks whether image name looks like a release image, if not it is
|
||||||
// probably a debug image. In the end we do not if bootstrapper or debugd
|
// probably a debug image. In the end we do not if bootstrapper or debugd
|
||||||
// was put inside an image just by looking at its name.
|
// was put inside an image just by looking at its name.
|
||||||
func (c *Config) IsImageDebug() bool {
|
func (c *Config) IsDebugImage() bool {
|
||||||
switch {
|
switch {
|
||||||
case c.Provider.GCP != nil:
|
case c.Provider.GCP != nil:
|
||||||
gcpRegex := regexp.MustCompile(`^projects\/constellation-images\/global\/images\/constellation-v[\d]+-[\d]+-[\d]+$`)
|
gcpRegex := regexp.MustCompile(`^projects\/constellation-images\/global\/images\/constellation-v[\d]+-[\d]+-[\d]+$`)
|
||||||
|
@ -381,7 +381,7 @@ func TestConfig_IsImageDebug(t *testing.T) {
|
|||||||
for name, tc := range testCases {
|
for name, tc := range testCases {
|
||||||
t.Run(name, func(t *testing.T) {
|
t.Run(name, func(t *testing.T) {
|
||||||
assert := assert.New(t)
|
assert := assert.New(t)
|
||||||
assert.Equal(tc.want, tc.conf.IsImageDebug())
|
assert.Equal(tc.want, tc.conf.IsDebugImage())
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user