@@ -43,8 +43,9 @@ import (
4343var (
4444 scheme = runtime .NewScheme ()
4545
46- count int
47- namespaces []string
46+ count int
47+ namespaces []string
48+ skipWorkload bool
4849)
4950
5051func init () {
@@ -70,6 +71,7 @@ func main() {
7071
7172 cmd .Flags ().IntVarP (& count , "count" , "c" , count , "number of websites to generate per project" )
7273 cmd .Flags ().StringSliceVarP (& namespaces , "namespace" , "n" , namespaces , "project namespaces to generate websites in" )
74+ cmd .Flags ().BoolVar (& skipWorkload , "skip-workload" , false , "don't run any actual workload for the generated websites" )
7375
7476 if err := cmd .ExecuteContext (signals .SetupSignalHandler ()); err != nil {
7577 fmt .Printf ("Error generating samples: %v\n " , err )
@@ -111,7 +113,7 @@ func generateSamples(ctx context.Context, c client.Client) error {
111113 }
112114
113115 for i := 0 ; i < websiteCount ; i ++ {
114- if err := c . Create ( ctx , & webhostingv1alpha1.Website {
116+ website := & webhostingv1alpha1.Website {
115117 ObjectMeta : metav1.ObjectMeta {
116118 Name : "sample-" + utils .RandomName (8 ),
117119 Namespace : project ,
@@ -122,7 +124,13 @@ func generateSamples(ctx context.Context, c client.Client) error {
122124 Spec : webhostingv1alpha1.WebsiteSpec {
123125 Theme : utils .PickRandom (themes ),
124126 },
125- }); err != nil {
127+ }
128+
129+ if skipWorkload {
130+ website .Labels [webhostingv1alpha1 .LabelKeySkipWorkload ] = "true"
131+ }
132+
133+ if err := c .Create (ctx , website ); err != nil {
126134 return err
127135 }
128136 }
0 commit comments