Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions cmd/cluster/core/dump.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ import (
"github.com/openshift/hypershift/cmd/util"
"github.com/openshift/hypershift/hypershift-operator/controllers/manifests"
kvinfra "github.com/openshift/hypershift/kubevirtexternalinfra"
"github.com/openshift/hypershift/support/config"
supportutil "github.com/openshift/hypershift/support/util"
)

Expand Down Expand Up @@ -193,7 +192,7 @@ func dumpGuestCluster(ctx context.Context, opts *DumpOptions) error {
Out: forwarderOutput,
ErrOut: forwarderOutput,
}
podPort := supportutil.BindAPIPortWithDefaultFromHostedCluster(hostedCluster, config.DefaultAPIServerPort)
podPort := supportutil.KASPodPortFromHostedCluster(hostedCluster)
forwarderStop := make(chan struct{})
if err := forwarder.ForwardPorts([]string{fmt.Sprintf("%d:%d", localPort, podPort)}, forwarderStop); err != nil {
return fmt.Errorf("cannot forward kube apiserver port: %w, output: %s", err, forwarderOutput.String())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ func ReconcileAutoscalerDeployment(deployment *appsv1.Deployment, hcp *hyperv1.H
},
}

util.AvailabilityProber(kas.InClusterKASReadyURL(deployment.Namespace, util.APIPort(hcp)), availabilityProberImage, &deployment.Spec.Template.Spec)
util.AvailabilityProber(kas.InClusterKASReadyURL(), availabilityProberImage, &deployment.Spec.Template.Spec)

deploymentConfig := config.DeploymentConfig{
AdditionalLabels: map[string]string{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ var (
}
)

func ReconcileDeployment(deployment *appsv1.Deployment, ownerRef config.OwnerRef, image string, deploymentConfig config.DeploymentConfig, availabilityProberImage string, apiServerPort *int32) error {
func ReconcileDeployment(deployment *appsv1.Deployment, ownerRef config.OwnerRef, image string, deploymentConfig config.DeploymentConfig, availabilityProberImage string) error {
// preserve existing resource requirements for main CPC container
mainContainer := util.FindContainer(cpcContainerMain().Name, deployment.Spec.Template.Spec.Containers)
if mainContainer != nil {
Expand Down Expand Up @@ -64,7 +64,7 @@ func ReconcileDeployment(deployment *appsv1.Deployment, ownerRef config.OwnerRef
deployment.Spec.Template.Spec.AutomountServiceAccountToken = pointer.Bool(false)
deploymentConfig.ApplyTo(deployment)

util.AvailabilityProber(kas.InClusterKASReadyURL(deployment.Namespace, apiServerPort), availabilityProberImage, &deployment.Spec.Template.Spec)
util.AvailabilityProber(kas.InClusterKASReadyURL(), availabilityProberImage, &deployment.Spec.Template.Spec)
return nil
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ func ReconcileServiceAccount(sa *corev1.ServiceAccount, ownerRef config.OwnerRef
return nil
}

func ReconcileDeployment(dep *appsv1.Deployment, params Params, apiPort *int32) error {
func ReconcileDeployment(dep *appsv1.Deployment, params Params) error {
params.OwnerRef.ApplyTo(dep)

dep.Spec.Replicas = utilpointer.Int32(1)
Expand Down Expand Up @@ -555,7 +555,7 @@ if [[ -n $sc ]]; then kubectl --kubeconfig $kc delete --ignore-not-found validat
}

params.DeploymentConfig.ApplyTo(dep)
util.AvailabilityProber(kas.InClusterKASReadyURL(dep.Namespace, apiPort), params.AvailabilityProberImage, &dep.Spec.Template.Spec, func(o *util.AvailabilityProberOpts) {
util.AvailabilityProber(kas.InClusterKASReadyURL(), params.AvailabilityProberImage, &dep.Spec.Template.Spec, func(o *util.AvailabilityProberOpts) {
o.KubeconfigVolumeName = "hosted-etc-kube"
o.RequiredAPIs = []schema.GroupVersionKind{
{Group: "operator.openshift.io", Version: "v1", Kind: "Network"},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ func TestReconcileDeployment(t *testing.T) {
}

dep := &appsv1.Deployment{}
if err := ReconcileDeployment(dep, tc.params, nil); err != nil {
if err := ReconcileDeployment(dep, tc.params); err != nil {
t.Fatalf("ReconcileDeployment: %v", err)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ var (
}
)

func ReconcileDeployment(deployment *appsv1.Deployment, image, hcpName, openShiftVersion, kubeVersion string, ownerRef config.OwnerRef, deploymentConfig *config.DeploymentConfig, availabilityProberImage string, enableCIDebugOutput bool, platformType hyperv1.PlatformType, apiInternalPort *int32, konnectivityAddress string, konnectivityPort int32, oauthAddress string, oauthPort int32, releaseImage string, additionalTrustBundle *corev1.LocalObjectReference, hcp *hyperv1.HostedControlPlane) error {
func ReconcileDeployment(deployment *appsv1.Deployment, image, hcpName, openShiftVersion, kubeVersion string, ownerRef config.OwnerRef, deploymentConfig *config.DeploymentConfig, availabilityProberImage string, enableCIDebugOutput bool, platformType hyperv1.PlatformType, konnectivityAddress string, konnectivityPort int32, oauthAddress string, oauthPort int32, releaseImage string, additionalTrustBundle *corev1.LocalObjectReference, hcp *hyperv1.HostedControlPlane) error {
// Before this change we did
// Selector: &metav1.LabelSelector{
// MatchLabels: hccLabels,
Expand Down Expand Up @@ -284,7 +284,7 @@ func ReconcileDeployment(deployment *appsv1.Deployment, image, hcpName, openShif
}

deploymentConfig.ApplyTo(deployment)
util.AvailabilityProber(kas.InClusterKASReadyURL(deployment.Namespace, apiInternalPort), availabilityProberImage, &deployment.Spec.Template.Spec, func(o *util.AvailabilityProberOpts) {
util.AvailabilityProber(kas.InClusterKASReadyURL(), availabilityProberImage, &deployment.Spec.Template.Spec, func(o *util.AvailabilityProberOpts) {
o.KubeconfigVolumeName = "kubeconfig"
o.RequiredAPIs = []schema.GroupVersionKind{
{Group: "imageregistry.operator.openshift.io", Version: "v1", Kind: "Config"},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ func cvoLabels() map[string]string {

var port int32 = 8443

func ReconcileDeployment(deployment *appsv1.Deployment, ownerRef config.OwnerRef, deploymentConfig config.DeploymentConfig, controlPlaneImage, image, cliImage, availabilityProberImage, clusterID string, apiPort *int32, platformType hyperv1.PlatformType) error {
func ReconcileDeployment(deployment *appsv1.Deployment, ownerRef config.OwnerRef, deploymentConfig config.DeploymentConfig, controlPlaneImage, image, cliImage, availabilityProberImage, clusterID string, platformType hyperv1.PlatformType) error {
ownerRef.ApplyTo(deployment)

// preserve existing resource requirements for main CVO container
Expand Down Expand Up @@ -148,7 +148,7 @@ func ReconcileDeployment(deployment *appsv1.Deployment, ownerRef config.OwnerRef
}
deploymentConfig.ApplyTo(deployment)
util.AvailabilityProber(
kas.InClusterKASReadyURL(deployment.Namespace, apiPort),
kas.InClusterKASReadyURL(),
availabilityProberImage,
&deployment.Spec.Template.Spec,
func(o *util.AvailabilityProberOpts) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ func NewParams(hcp *hyperv1.HostedControlPlane, version string, releaseImageProv
// hosted-cluster services, or external services, so the operator does not
// require any special proxy configuration or permissions in the management
// cluster.
func ReconcileDeployment(dep *appsv1.Deployment, params Params, apiPort *int32) {
func ReconcileDeployment(dep *appsv1.Deployment, params Params) {
dep.Spec.Selector = &metav1.LabelSelector{
MatchLabels: map[string]string{"name": "dns-operator"},
}
Expand Down Expand Up @@ -161,7 +161,7 @@ func ReconcileDeployment(dep *appsv1.Deployment, params Params, apiPort *int32)
},
}}
util.AvailabilityProber(
kas.InClusterKASReadyURL(dep.Namespace, apiPort),
kas.InClusterKASReadyURL(),
params.AvailabilityProberImage,
&dep.Spec.Template.Spec,
func(o *util.AvailabilityProberOpts) {
Expand Down
Loading