Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release 4.8.10 #1703

Merged
merged 5 commits into from
Sep 9, 2021
Merged

Release 4.8.10 #1703

merged 5 commits into from
Sep 9, 2021

Conversation

m1kola
Copy link
Contributor

@m1kola m1kola commented Aug 26, 2021

Which issue this PR addresses:

Work Item №10405746.

What this PR does / why we need it:

Brings installer 4.8 into the RP.

Test plan for issue:

  • E2E run
  • Create a cluster locally

Is there any documentation that needs to be updated for this PR?

No. User facing communications are being handled separately.

@m1kola m1kola force-pushed the installer-release-4.8-azure branch 3 times, most recently from 8d574c4 to 06a9ee2 Compare September 7, 2021 09:42
@m1kola m1kola changed the title Release 4.8.* Release 4.8.10 Sep 7, 2021
@m1kola m1kola force-pushed the installer-release-4.8-azure branch 5 times, most recently from 4dc6416 to 4375e77 Compare September 8, 2021 13:00
Copy link
Contributor Author

@m1kola m1kola left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I recommend reviewing this commit-by-commit. I moved vendoring and generation of assets into separate commits.

I left few comments below which explain why we need some of ARO-RP changes.

Comment on lines +39 to +60
// VHD fetches the URL of the public Azure blob containing the RHCOS image
func VHD(ctx context.Context, arch types.Architecture) (string, error) {
archName := coreosarch.RpmArch(string(arch))
st, err := rhcospkg.FetchCoreOSBuild(ctx)
if err != nil {
return "", err
}
streamArch, err := st.GetArchitecture(archName)
if err != nil {
return "", err
}
ext := streamArch.RHELCoreOSExtensions
if ext == nil {
return "", fmt.Errorf("%s: No azure build found", st.FormatPrefix(archName))
}
azd := ext.AzureDisk
if azd == nil {
return "", fmt.Errorf("%s: No azure build found", st.FormatPrefix(archName))
}

return azd.URL, nil
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New code due to openshift/installer#4582

Comment on lines +19 to +37
// Image returns an image object containing VM image SKU information.
func Image(ctx context.Context) (*azuretypes.Image, error) {
osImage, err := VHD(ctx, types.ArchitectureAMD64)
if err != nil {
return nil, err
}

m := rxRHCOS.FindStringSubmatch(osImage)
if m == nil {
return nil, fmt.Errorf("couldn't match osImage %q", osImage)
}

return &azuretypes.Image{
Publisher: "azureopenshift",
Offer: "aro4",
SKU: "aro_" + m[2], // "aro_4x"
Version: m[1], // "4x.yy.2020zzzz"
}, nil
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This previously was called getRHCOSImage in pkg/cluster/generateconfig.go.

Comment on lines -63 to -65
go mod edit -replace github.com/metal3-io/cluster-api-provider-baremetal=$(go list -mod=mod -m github.com/openshift/cluster-api-provider-baremetal@release-4.7 | sed -e 's/ /@/')
# We use release-4.8 here so we can use new version of sigs.k8s.io/controller-runtime sooner.
go mod edit -replace github.com/metal3-io/baremetal-operator=$(go list -mod=mod -m github.com/openshift/baremetal-operator@release-4.8 | sed -e 's/ /@/')
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These package are now pinned to a specific version (at leat for now). See in go.mod:

github.com/metal3-io/baremetal-operator => github.com/openshift/baremetal-operator v0.0.0-20210706141527-5240e42f012a // Use OpenShift fork
github.com/metal3-io/baremetal-operator/apis => github.com/openshift/baremetal-operator/apis v0.0.0-20210706141527-5240e42f012a // Use OpenShift fork
github.com/metal3-io/cluster-api-provider-baremetal => github.com/openshift/cluster-api-provider-baremetal v0.0.0-20210721192732-726d97e15db7 // Pin OpenShift fork

We pin them to specific commits and I think these commits are from master. It was huge pain to make these two work (and we don't even need them). So it doesn't really matter.

@@ -107,7 +107,7 @@ func (r *Reconciler) Reconcile(ctx context.Context, request ctrl.Request) (ctrl.
GracePeriodSeconds: -1,
IgnoreAllDaemonSets: true,
Timeout: 60 * time.Second,
DeleteLocalData: true,
DeleteEmptyDirData: true,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -31,14 +32,14 @@ func NewResult(m metrics.Interface) kmetrics.ResultMetric {
}
}

func (t *tracer) Observe(verb string, url url.URL, latency time.Duration) {
func (t *tracer) Observe(ctx context.Context, verb string, url url.URL, latency time.Duration) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interface change in k8s.io/client-go/tools/metrics. Same as below.

@@ -81,6 +81,7 @@ func TestMerge(t *testing.T) {
"openshift.io/sa.scc.supplemental-groups": "groups",
"openshift.io/sa.scc.uid-range": "uids",
},
Labels: map[string]string{"kubernetes.io/metadata.name": "test"},
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NamespaceDefaultLabelName feature gate is enabled by default in Kubernetes 1.21: https://kubernetes.io/docs/reference/command-line-tools-reference/feature-gates/

@@ -142,6 +141,7 @@ func (m *manager) generateInstallConfig(ctx context.Context) (*installconfig.Ins
EncryptionAtHost: m.doc.OpenShiftCluster.Properties.MasterProfile.EncryptionAtHost == api.EncryptionAtHostEnabled,
OSDisk: azuretypes.OSDisk{
DiskEncryptionSetID: m.doc.OpenShiftCluster.Properties.MasterProfile.DiskEncryptionSetID,
DiskSizeGB: 1024,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

openshift/installer#4666 breakes our code: we were relying on defaults set here and the fact that installer was mutating the isntallconfig object:

https://github.com/openshift/installer/blob/94125b21304a574ae5bc98039f8eb7f518293b83/pkg/asset/machines/master.go#L252-L253

But these defaults are not longer propogated to the installer config becuase this:

https://github.com/openshift/installer/blob/94125b21304a574ae5bc98039f8eb7f518293b83/pkg/asset/machines/master.go#L150

changed to this in 4.8:

https://github.com/openshift/installer/blob/c06e9b1562ccb76ac23163fb8db35f231ead6e97/pkg/asset/machines/master.go#L150

Fixed it by adding default value to our pkg/cluster/generateconfig.go.

Mikalai Radchuk added 2 commits September 8, 2021 15:53
Updates the codebase to allow vendoring of OCP 4.8
@m1kola m1kola force-pushed the installer-release-4.8-azure branch from 4375e77 to b4b4fd2 Compare September 8, 2021 14:58
@@ -34,11 +35,11 @@ func NewMetrics(log *logrus.Entry, m metrics.Interface) (Runnable, error) {
r: prometheus.NewRegistry(),
}

if err := g.r.Register(prometheus.NewProcessCollector(prometheus.ProcessCollectorOpts{})); err != nil {
if err := g.r.Register(collectors.NewProcessCollector(collectors.ProcessCollectorOpts{})); err != nil {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

github.com/prometheus/client_golang/prometheus got updated and prometheus.NewProcessCollector while still exists - it is depricated. Our golangci-lint job complains about it.

@mjudeikis
Copy link
Contributor

overall looks good! :)

@m1kola m1kola marked this pull request as ready for review September 9, 2021 09:27
@m1kola m1kola requested a review from rolandmkunkel September 9, 2021 09:27
@m1kola
Copy link
Contributor Author

m1kola commented Sep 9, 2021

Previous e2e run failed, but it looked like a flake. Waiting for another e2e run, but I think this is ready for review now.

mjudeikis
mjudeikis previously approved these changes Sep 9, 2021
@m1kola
Copy link
Contributor Author

m1kola commented Sep 9, 2021

I created a separate PR on top of this one to set min TLS version to 1.2 for storage accoutns to reflect what installer is doing: #1730.

We need to merge #1730 after this PR.

ross-bryan
ross-bryan previously approved these changes Sep 9, 2021
Copy link
Contributor

@ross-bryan ross-bryan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good thanks for detailed explanation with links etc.. in comments. Much easier to understand with that information available.

@@ -4,7 +4,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.5.0
controller-gen.kubebuilder.io/version: v0.6.2
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry for my ignorance, where does this version come from?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bryanro92 Good question. I should've explained it too as it is not obvious.

We generate this yaml using controller-gen which is part of sigs.k8s.io/controller-tools. It got updated from v0.5.0 to v0.6.2 and as a result on make generate this yaml got updated too.

You can see version change of sigs.k8s.io/controller-tools in go.mod.

pkg/util/version/const.go Show resolved Hide resolved
@jewzaam
Copy link
Contributor

jewzaam commented Sep 9, 2021

/azp run e2e

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@jewzaam jewzaam merged commit c2def8a into Azure:master Sep 9, 2021
@m1kola m1kola deleted the installer-release-4.8-azure branch September 10, 2021 10:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants