This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"context" | |
"crypto/tls" | |
"crypto/x509" | |
"flag" | |
"fmt" | |
"io/ioutil" | |
"log" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"context" | |
"fmt" | |
"log" | |
"os" | |
"text/tabwriter" | |
"github.com/spf13/pflag" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"context" | |
"encoding/json" | |
"fmt" | |
corev1 "k8s.io/api/core/v1" | |
"k8s.io/apimachinery/pkg/api/errors" | |
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | |
"k8s.io/apimachinery/pkg/types" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"k8s.io/test-infra/prow/apis/prowjobs/v1" | |
"sigs.k8s.io/yaml" | |
) | |
func main() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: v1 | |
kind: Pod | |
metadata: | |
labels: | |
app: crane2 | |
name: rsync-server | |
namespace: default | |
spec: | |
containers: | |
- command: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Copyright 2019 Red Hat Inc. | |
Licensed under the Apache License, Version 2.0 (the "License"); | |
you may not use this file except in compliance with the License. | |
You may obtain a copy of the License at | |
http://www.apache.org/licenses/LICENSE-2.0 | |
Unless required by applicable law or agreed to in writing, software |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export RESOURCE="migrationcontrollers" | |
export NAMESPACE="openshift-migration" | |
if [ -z "$1" ]; then | |
export USER="bob" | |
else | |
export USER=$1 | |
fi | |
if [ -z "$2" ]; then |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
htpasswd -c -B -b users.htpasswd bob bob | |
oc create secret generic htpass-secret --from-file=htpasswd=./users.htpasswd -n openshift-config | |
oc patch oauth cluster --type='json' -p '[ { "op": "replace", "path": "/spec", "value": {"identityProviders": [{"htpasswd": {"fileData": {"name": "htpass-secret"}}, "mappingMethod": "claim", "name": "bob_httpassd_provider", "type": "HTPasswd"}]}}]' | |
oc login -u bob -p bob | |
oc new-project bob-destination | |
oc login -u kubeadmin -p $KUBEADMIN_PASSWORD | |
cat <<EOF | oc create -f - | |
apiVersion: migration.openshift.io/v1alpha1 | |
kind: MigrationTenant | |
metadata: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func (r *ReconcileMigToken) Reconcile(request reconcile.Request) (reconcile.Result, error) { | |
var err error | |
log.Reset() | |
token := &migapi.MigToken{} | |
// prefer a separate function call instead of defer func() {}() | |
// two advantages: | |
// 1. defers are hard(er) to debug/reason about than normal calls | |
// 2. with normal function we can have a matching else condition |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
oc create namespace openshift-migration | |
#create service for mongo-db | |
cat <<EOF | oc create -f - | |
kind: Service | |
apiVersion: v1 | |
metadata: | |
name: mig-operator-noobaa-db | |
namespace: openshift-migration | |
labels: |
NewerOlder