mirror of
https://github.com/edgelesssys/constellation.git
synced 2025-11-14 09:30:45 -05:00
AB#2306 Public image sharing in Google (#358)
* document how to publicly share images in gcloud * Write disclamer in debugd * Add disclamer about debug images to contributing file * Print debug banner on startup Signed-off-by: Fabian Kammel <fk@edgeless.systems>
This commit is contained in:
parent
abb4fb4f0f
commit
170a8bf5e0
10 changed files with 118 additions and 16 deletions
|
|
@ -321,3 +321,58 @@ func TestConfig_UpdateMeasurements(t *testing.T) {
|
|||
assert.Equal(newMeasurements, conf.Provider.QEMU.Measurements)
|
||||
}
|
||||
}
|
||||
|
||||
func TestConfig_IsImageDebug(t *testing.T) {
|
||||
testCases := map[string]struct {
|
||||
conf *Config
|
||||
want bool
|
||||
}{
|
||||
"gcp release": {
|
||||
conf: func() *Config {
|
||||
conf := Default()
|
||||
conf.RemoveProviderExcept(cloudprovider.GCP)
|
||||
conf.Provider.GCP.Image = "projects/constellation-images/global/images/constellation-v1-3-0"
|
||||
return conf
|
||||
}(),
|
||||
want: false,
|
||||
},
|
||||
"gcp debug": {
|
||||
conf: func() *Config {
|
||||
conf := Default()
|
||||
conf.RemoveProviderExcept(cloudprovider.GCP)
|
||||
conf.Provider.GCP.Image = "projects/constellation-images/global/images/constellation-20220812102023"
|
||||
return conf
|
||||
}(),
|
||||
want: true,
|
||||
},
|
||||
"azure release": {
|
||||
conf: func() *Config {
|
||||
conf := Default()
|
||||
conf.RemoveProviderExcept(cloudprovider.Azure)
|
||||
conf.Provider.Azure.Image = "/subscriptions/0d202bbb-4fa7-4af8-8125-58c269a05435/resourceGroups/constellation-images/providers/Microsoft.Compute/galleries/Constellation/images/constellation/versions/2022.0805.151600"
|
||||
return conf
|
||||
}(),
|
||||
want: false,
|
||||
},
|
||||
"azure debug": {
|
||||
conf: func() *Config {
|
||||
conf := Default()
|
||||
conf.RemoveProviderExcept(cloudprovider.Azure)
|
||||
conf.Provider.Azure.Image = "/subscriptions/0d202bbb-4fa7-4af8-8125-58c269a05435/resourceGroups/constellation-images/providers/Microsoft.Compute/galleries/Constellation_Debug/images/v1.4.0/versions/2022.0805.151600"
|
||||
return conf
|
||||
}(),
|
||||
want: true,
|
||||
},
|
||||
"empty config": {
|
||||
conf: &Config{},
|
||||
want: false,
|
||||
},
|
||||
}
|
||||
|
||||
for name, tc := range testCases {
|
||||
t.Run(name, func(t *testing.T) {
|
||||
assert := assert.New(t)
|
||||
assert.Equal(tc.want, tc.conf.IsImageDebug())
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue