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
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
5 changes: 3 additions & 2 deletions docs/upstream-differences.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ upstream OCP.

## Installer carry patches

See https://github.com/openshift/installer/compare/release-4.7...mjudeikis:release-4.7-azure.
See https://github.com/openshift/installer/compare/release-4.8...mjudeikis:release-4.8-azure.

## Installation differences

Expand Down Expand Up @@ -84,6 +84,7 @@ Once installer fork is ready:
1. `make generate`.
1. Update `pkg/util/version/const.go` to point to the new release.
* You should be able to find latest published release and image hash [on quay.io](https://quay.io/repository/openshift-release-dev/ocp-release?tab=tags).
* After this point, you should be able to create a dev cluster using the RP and it should use the new release.
1. Publish RHCOS image. See [this document](./publish-rhcos-image.md).
1. After this point, you should be able to create a dev cluster using the RP and it should use the new release.
1. `make discoverycache`.
* This command requires a running cluster with the new version.
245 changes: 133 additions & 112 deletions go.mod

Large diffs are not rendered by default.

654 changes: 368 additions & 286 deletions go.sum

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion hack/rhcos-sas/rhcos-sas.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ import (

azstorage "github.com/Azure/azure-sdk-for-go/storage"
"github.com/Azure/go-autorest/autorest/azure/auth"
"github.com/openshift/installer/pkg/rhcos"
"github.com/openshift/installer/pkg/types"
"github.com/sirupsen/logrus"

"github.com/Azure/ARO-RP/pkg/env"
"github.com/Azure/ARO-RP/pkg/util/azureclient/mgmt/storage"
utillog "github.com/Azure/ARO-RP/pkg/util/log"
"github.com/Azure/ARO-RP/pkg/util/rhcos"
"github.com/Azure/ARO-RP/pkg/util/stringutils"
)

Expand Down
12 changes: 4 additions & 8 deletions hack/update-go-module-dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ for x in vendor/github.com/openshift/*; do

# Inconsistent imports: some of our dependencies import it as github.com/metal3-io/cluster-api-provider-baremetal
# but in some places directly from the openshift fork.
# Replace github.com/metal3-io/cluster-api-provider-baremetal with an openshift fork below in this script.
# Replace github.com/metal3-io/cluster-api-provider-baremetal with an openshift fork in go.mod
vendor/github.com/openshift/cluster-api-provider-baremetal)
;;

Expand All @@ -51,20 +51,16 @@ for x in vendor/github.com/openshift/*; do
;;

*)
go mod edit -replace ${x##vendor/}=$(go list -mod=mod -m ${x##vendor/}@release-4.7 | sed -e 's/ /@/')
go mod edit -replace ${x##vendor/}=$(go list -mod=mod -m ${x##vendor/}@release-4.8 | sed -e 's/ /@/')
;;
esac
done

for x in aws azure openstack; do
go mod edit -replace sigs.k8s.io/cluster-api-provider-$x=$(go list -mod=mod -m github.com/openshift/cluster-api-provider-$x@release-4.7 | sed -e 's/ /@/')
go mod edit -replace sigs.k8s.io/cluster-api-provider-$x=$(go list -mod=mod -m github.com/openshift/cluster-api-provider-$x@release-4.8 | sed -e 's/ /@/')
done

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/ /@/')
Comment on lines -63 to -65
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.


go mod edit -replace github.com/openshift/installer=$(go list -mod=mod -m github.com/mjudeikis/installer@release-4.7-azure | sed -e 's/ /@/')
go mod edit -replace github.com/openshift/installer=$(go list -mod=mod -m github.com/mjudeikis/installer@release-4.8-azure | sed -e 's/ /@/')

go get -u ./...

Expand Down
4 changes: 4 additions & 0 deletions hack/validate-imports/validate-imports.go
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,10 @@ func acceptableNames(path string) []string {
return []string{"icazure"}
case "github.com/openshift/installer/pkg/types/azure":
return []string{"azuretypes"}
case "github.com/coreos/stream-metadata-go/arch":
return []string{"coreosarch"}
case "github.com/openshift/installer/pkg/rhcos":
return []string{"rhcospkg"}
case "golang.org/x/crypto/ssh":
return []string{"", "cryptossh"}
case "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1":
Expand Down
3 changes: 3 additions & 0 deletions pkg/cluster/deploystorage_resources.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,9 @@ func (m *manager) storageAccount(name, region string) *arm.Resource {
Sku: &mgmtstorage.Sku{
Name: "Standard_LRS",
},
AccountProperties: &mgmtstorage.AccountProperties{
MinimumTLSVersion: mgmtstorage.TLS12,
},
Name: &name,
Location: &region,
Type: to.StringPtr("Microsoft.Storage/storageAccounts"),
Expand Down
27 changes: 3 additions & 24 deletions pkg/cluster/generateconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import (
"crypto/x509"
"encoding/base64"
"fmt"
"regexp"
"strings"

"github.com/Azure/go-autorest/autorest/azure"
Expand All @@ -17,7 +16,6 @@ import (
icazure "github.com/openshift/installer/pkg/asset/installconfig/azure"
"github.com/openshift/installer/pkg/asset/releaseimage"
"github.com/openshift/installer/pkg/ipnet"
"github.com/openshift/installer/pkg/rhcos"
"github.com/openshift/installer/pkg/types"
azuretypes "github.com/openshift/installer/pkg/types/azure"
"github.com/openshift/installer/pkg/types/validation"
Expand All @@ -27,6 +25,7 @@ import (
"github.com/Azure/ARO-RP/pkg/api"
"github.com/Azure/ARO-RP/pkg/util/computeskus"
"github.com/Azure/ARO-RP/pkg/util/pullsecret"
"github.com/Azure/ARO-RP/pkg/util/rhcos"
"github.com/Azure/ARO-RP/pkg/util/stringutils"
"github.com/Azure/ARO-RP/pkg/util/subnet"
"github.com/Azure/ARO-RP/pkg/util/version"
Expand Down Expand Up @@ -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.

},
},
},
Expand Down Expand Up @@ -215,7 +215,7 @@ func (m *manager) generateInstallConfig(ctx context.Context) (*installconfig.Ins
installConfig.Config.Publish = types.InternalPublishingStrategy
}

installConfig.Config.Azure.Image, err = getRHCOSImage(ctx)
installConfig.Config.Azure.Image, err = rhcos.Image(ctx)
if err != nil {
return nil, nil, err
}
Expand All @@ -234,24 +234,3 @@ func (m *manager) generateInstallConfig(ctx context.Context) (*installconfig.Ins

return installConfig, image, err
}

var rxRHCOS = regexp.MustCompile(`rhcos-((\d+)\.\d+\.\d{8})\d{4}\-\d+-azure\.x86_64\.vhd`)

func getRHCOSImage(ctx context.Context) (*azuretypes.Image, error) {
osImage, err := rhcos.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
}
5 changes: 3 additions & 2 deletions pkg/metrics/statsd/golang/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"time"

"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/collectors"
"github.com/sirupsen/logrus"

"github.com/Azure/ARO-RP/pkg/metrics"
Expand Down Expand Up @@ -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.

return nil, err
}

if err := g.r.Register(prometheus.NewGoCollector()); err != nil {
if err := g.r.Register(collectors.NewGoCollector()); err != nil {
return nil, err
}

Expand Down
5 changes: 3 additions & 2 deletions pkg/metrics/statsd/k8s/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ package k8s
// Licensed under the Apache License 2.0.

import (
"context"
"net/url"
"time"

Expand Down Expand Up @@ -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.

t.m.EmitGauge("client.k8s.duration", latency.Milliseconds(), map[string]string{
"path": url.Path,
"verb": verb,
})
}

func (t *tracer) Increment(code string, verb string, host string) {
func (t *tracer) Increment(ctx context.Context, code string, verb string, host string) {
t.m.EmitGauge("client.k8s.count", 1, map[string]string{
"verb": verb,
"code": code,
Expand Down
3 changes: 2 additions & 1 deletion pkg/metrics/statsd/k8s/metrics_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ package k8s
// Licensed under the Apache License 2.0.

import (
"context"
"testing"

"github.com/golang/mock/gomock"
Expand All @@ -29,5 +30,5 @@ func TestTracer(t *testing.T) {
tr := &tracer{
m: m,
}
tr.Increment("<error>", "GET", "host")
tr.Increment(context.Background(), "<error>", "GET", "host")
}
2 changes: 1 addition & 1 deletion pkg/operator/controllers/node/node_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.

DisableEviction: true,
OnPodDeletedOrEvicted: func(pod *corev1.Pod, usingEviction bool) {
r.log.Printf("deleted pod %s/%s", pod.Namespace, pod.Name)
Expand Down
Loading