Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 3 of 3 for NewGCP (0.2 sec)

  1. pkg/bootstrap/platform/discovery.go

    	if len(CloudPlatform) > 0 {
    		switch strings.ToLower(CloudPlatform) {
    		case "aws":
    			return NewAWS(ipv6)
    		case "azure":
    			return NewAzure()
    		case "gcp":
    			return NewGCP()
    		case "none":
    			return &Unknown{}
    		}
    	}
    	// Discover the platform if user has not specified.
    	return DiscoverWithTimeout(defaultTimeout, ipv6)
    }
    
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Tue May 23 17:08:31 UTC 2023
    - 2.6K bytes
    - Viewed (0)
  2. pkg/bootstrap/platform/gcp_test.go

    				tt.numericProjectIDFn, tt.locationFn, tt.clusterNameFn, tt.instanceNameFn, tt.instanceIDFn, tt.instanceTemplateFn, tt.instanceCreatedByFn
    			e := NewGCP()
    			got := e.Metadata()
    			assert.Equal(t, got, tt.want)
    		})
    	}
    }
    
    func TestMetadataCache(t *testing.T) {
    	tests := []struct {
    		name                string
    		shouldFill          shouldFillFn
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Fri Dec 15 00:37:33 UTC 2023
    - 17.7K bytes
    - Viewed (0)
  3. pkg/bootstrap/platform/gcp.go

    		// Assume this is running on GCP if GCP project env variable is set.
    		return true
    	}
    	return metadata.OnGCE()
    }
    
    // NewGCP returns a platform environment customized for Google Cloud Platform.
    // Metadata returned by the GCP Environment is taken from the GCE metadata
    // service.
    func NewGCP() Environment {
    	return &gcpEnv{
    		fillMetadata: lazy.New(func() (bool, error) {
    			return shouldFillMetadata(), nil
    		}),
    	}
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Fri Dec 15 00:37:33 UTC 2023
    - 11.1K bytes
    - Viewed (0)
Back to top