Skip to content

Commit

Permalink
rename state.publicIP to cluster endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
elchead committed Sep 25, 2023
1 parent 8503b7d commit 5ce0d30
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion cli/internal/cloudcmd/create_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ func TestCreator(t *testing.T) {
}
} else {
assert.NoError(err)
assert.Equal(ip, idFile.PublicIP)
assert.Equal(ip, idFile.ClusterEndpoint)
}
})
}
Expand Down
2 changes: 1 addition & 1 deletion cli/internal/cmd/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ func (c *createCmd) create(cmd *cobra.Command, creator cloudCreator, fileHandler
func convertToIDFile(infra state.Infrastructure, provider cloudprovider.Provider) clusterid.File {
var file clusterid.File
file.CloudProvider = provider
file.IP = infra.PublicIP
file.IP = infra.ClusterEndpoint
file.APIServerCertSANs = infra.APIServerCertSANs
file.InitSecret = []byte(infra.InitSecret) // Convert string to []byte
file.UID = infra.UID
Expand Down
6 changes: 3 additions & 3 deletions cli/internal/cmd/create_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ func TestCreate(t *testing.T) {
require.NoError(file.WriteYAML(constants.ConfigFilename, defaultConfigWithExpectedMeasurements(t, config.Default(), provider)))
return fs
}
infraState := state.Infrastructure{PublicIP: "192.0.2.1"}
infraState := state.Infrastructure{ClusterEndpoint: "192.0.2.1"}
someErr := errors.New("failed")

testCases := map[string]struct {
Expand Down Expand Up @@ -157,13 +157,13 @@ func TestCreate(t *testing.T) {
var gotIDFile clusterid.File
require.NoError(fileHandler.ReadJSON(constants.ClusterIDsFilename, &gotIDFile))
assert.Equal(gotIDFile, clusterid.File{
IP: infraState.PublicIP,
IP: infraState.ClusterEndpoint,
CloudProvider: tc.provider,
})

var gotState state.State
expectedState := state.Infrastructure{
PublicIP: "192.0.2.1",
ClusterEndpoint: "192.0.2.1",
APIServerCertSANs: []string{},
}
require.NoError(fileHandler.ReadYAML(constants.StateFilename, &gotState))
Expand Down
6 changes: 3 additions & 3 deletions cli/internal/helm/overrides.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ func extraCiliumValues(provider cloudprovider.Provider, conformanceMode bool, ou
}
}

extraVals["k8sServiceHost"] = output.PublicIP
extraVals["k8sServiceHost"] = output.ClusterEndpoint
extraVals["k8sServicePort"] = constants.KubernetesPort
if provider == cloudprovider.GCP {
extraVals["ipv4NativeRoutingCIDR"] = output.GCP.IPCidrPod
Expand All @@ -62,10 +62,10 @@ func extraConstellationServicesValues(
}
extraVals["verification-service"] = map[string]any{
"attestationVariant": cfg.GetAttestationConfig().GetVariant().String(),
"loadBalancerIP": output.PublicIP,
"loadBalancerIP": output.ClusterEndpoint,
}
extraVals["konnectivity"] = map[string]any{
"loadBalancerIP": output.PublicIP,
"loadBalancerIP": output.ClusterEndpoint,
}

extraVals["key-service"] = map[string]any{
Expand Down
2 changes: 1 addition & 1 deletion cli/internal/state/state.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ func NewState(Infrastructure Infrastructure) State {
// Infrastructure describe the state related to the cloud resources of the cluster.
type Infrastructure struct {
UID string `yaml:"uid"`
PublicIP string `yaml:"publicIP"`
ClusterEndpoint string `yaml:"clusterEndpoint"`
InitSecret string `yaml:"initSecret"`
APIServerCertSANs []string `yaml:"apiServerCertSANs"`
Azure *Azure `yaml:"azure"`
Expand Down
2 changes: 1 addition & 1 deletion cli/internal/terraform/terraform.go
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ func (c *Client) ShowInfrastructure(ctx context.Context, provider cloudprovider.
func ConvertToInfrastructure(applyOutput ApplyOutput) state.Infrastructure {
var infra state.Infrastructure
infra.UID = applyOutput.UID
infra.PublicIP = applyOutput.IP
infra.ClusterEndpoint = applyOutput.IP
infra.InitSecret = applyOutput.Secret
infra.APIServerCertSANs = applyOutput.APIServerCertSANs

Expand Down

0 comments on commit 5ce0d30

Please sign in to comment.