@@ -41,27 +41,35 @@ type InstallationConfig struct {
4141// InstallGatewayAPI installs the specified version of the Gateway API resources.
4242func InstallGatewayAPI (apiVersion string ) ([]byte , error ) {
4343 apiPath := fmt .Sprintf ("%s/v%s/standard-install.yaml" , gwInstallBasePath , apiVersion )
44+ GinkgoWriter .Printf ("Installing Gateway API version %q at API path %q\n " , apiVersion , apiPath )
4445
4546 cmd := exec .CommandContext (
4647 context .Background (),
4748 "kubectl" , "apply" , "-f" , apiPath ,
4849 )
4950 output , err := cmd .CombinedOutput ()
5051 if err != nil {
52+ GinkgoWriter .Printf ("Error installing Gateway API version %q: %v\n " , apiVersion , err )
53+
5154 return output , err
5255 }
56+ GinkgoWriter .Printf ("Successfully installed Gateway API version %q\n " , apiVersion )
5357
5458 return nil , nil
5559}
5660
5761// UninstallGatewayAPI uninstalls the specified version of the Gateway API resources.
5862func UninstallGatewayAPI (apiVersion string ) ([]byte , error ) {
5963 apiPath := fmt .Sprintf ("%s/v%s/standard-install.yaml" , gwInstallBasePath , apiVersion )
64+ GinkgoWriter .Printf ("Uninstalling Gateway API version %q at API path %q\n " , apiVersion , apiPath )
6065
6166 output , err := exec .CommandContext (context .Background (), "kubectl" , "delete" , "-f" , apiPath ).CombinedOutput ()
6267 if err != nil && ! strings .Contains (string (output ), "not found" ) {
68+ GinkgoWriter .Printf ("Error uninstalling Gateway API version %q: %v\n " , apiVersion , err )
69+
6370 return output , err
6471 }
72+ GinkgoWriter .Printf ("Successfully uninstalled Gateway API version %q\n " , apiVersion )
6573
6674 return nil , nil
6775}
@@ -94,9 +102,14 @@ func InstallNGF(cfg InstallationConfig, extraArgs ...string) ([]byte, error) {
94102
95103// CreateLicenseSecret creates the NGINX Plus JWT secret.
96104func CreateLicenseSecret (k8sClient client.Client , namespace , filename string ) error {
105+ GinkgoWriter .Printf ("Creating NGINX Plus license secret in namespace %q from file %q\n " , namespace , filename )
106+
97107 conf , err := os .ReadFile (filename )
98108 if err != nil {
99- return fmt .Errorf ("error reading file %q: %w" , filename , err )
109+ readFileErr := fmt .Errorf ("error reading file %q: %w" , filename , err )
110+ GinkgoWriter .Printf ("ERROR: %v\n " , readFileErr )
111+
112+ return readFileErr
100113 }
101114
102115 ctx , cancel := context .WithTimeout (context .Background (), DefaultTimeoutConfig ().CreateTimeout )
@@ -109,7 +122,10 @@ func CreateLicenseSecret(k8sClient client.Client, namespace, filename string) er
109122 }
110123
111124 if err := k8sClient .Create (ctx , ns ); err != nil && ! apierrors .IsAlreadyExists (err ) {
112- return fmt .Errorf ("error creating namespace: %w" , err )
125+ createNSErr := fmt .Errorf ("error creating namespace: %w" , err )
126+ GinkgoWriter .Printf ("ERROR: %v\n " , createNSErr )
127+
128+ return createNSErr
113129 }
114130
115131 secret := & core.Secret {
@@ -123,7 +139,10 @@ func CreateLicenseSecret(k8sClient client.Client, namespace, filename string) er
123139 }
124140
125141 if err := k8sClient .Create (ctx , secret ); err != nil && ! apierrors .IsAlreadyExists (err ) {
126- return fmt .Errorf ("error creating secret: %w" , err )
142+ createSecretErr := fmt .Errorf ("error creating secret: %w" , err )
143+ GinkgoWriter .Printf ("ERROR: %v\n " , createSecretErr )
144+
145+ return createSecretErr
127146 }
128147
129148 return nil
@@ -170,6 +189,7 @@ func UninstallNGF(cfg InstallationConfig, k8sClient client.Client) ([]byte, erro
170189 args := []string {
171190 "uninstall" , cfg .ReleaseName , "--namespace" , cfg .Namespace ,
172191 }
192+ GinkgoWriter .Printf ("Uninstalling NGF with command: helm %v\n " , strings .Join (args , " " ))
173193
174194 output , err := exec .CommandContext (context .Background (), "helm" , args ... ).CombinedOutput ()
175195 if err != nil && ! strings .Contains (string (output ), "release: not found" ) {
@@ -204,6 +224,7 @@ func UninstallNGF(cfg InstallationConfig, k8sClient client.Client) ([]byte, erro
204224func setTelemetryArgs (cfg InstallationConfig ) []string {
205225 var args []string
206226
227+ GinkgoWriter .Printf ("Setting telemetry to %v\n " , cfg .Telemetry )
207228 if cfg .Telemetry {
208229 args = append (args , formatValueSet ("nginxGateway.productTelemetry.enable" , "true" )... )
209230 } else {
0 commit comments