go – search for suitable secrets in different structures, but with the same scheme

I'm using the Go client library to run code on my Kubernetes cluster.
My code works and runs, but I have duplicated code.

I am looking for secrets in the work.
In my example, we have two workloads: daemonset and deployments,
You are in a map workloads *map(string)interface{},
Although both are different objects, they have a similar structure:

type DaemonSet struct {
    metav1.TypeMeta `json:",inline"`
    metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
    Spec DaemonSetSpec `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"`
    Status DaemonSetStatus `json:"status,omitempty" protobuf:"bytes,3,opt,name=status"`
}


type Deployment struct {
    metav1.TypeMeta `json:",inline"`
    metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
    Spec DeploymentSpec `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"`
    Status DeploymentStatus `json:"status,omitempty" protobuf:"bytes,3,opt,name=status"`
}

Since they have the same structure, the code looks almost the same, which looks like a duplicate:
Enter image description here

How can I make it more beautiful and efficient without using this duplication?

My code:

func getRelatedWorkloads(secret *v1.Secret, workloads *map(string)interface{})  {
    for controllerName, _ := range *workloads {
        if controllerName != "pods"{
            switch controllerName {
            case "daemonset":
                controller := ((*workloads)(controllerName)).(*v1beta2.DaemonSetList)
                var controllerList ()v1beta2.DaemonSet
                workloadItems := controller.Items
                for _, item := range workloadItems {
                    for _, volume := range item.Spec.Template.Spec.Volumes {
                        if volume.Secret != nil {
                            for _, volumeSecret := range volume.Secret.Items {
                                if volumeSecret.Key == secret.Name {
                                    fmt.Print("equal")
                                    controllerList = append(controllerList, item)
                                }
                            }
                        }
                    }
                }
            case "deployments":
                controller := ((*workloads)(controllerName)).(*v1beta2.DeploymentList)
                var controllerList ()v1beta2.Deployment
                workloadItems := controller.Items
                for _, item := range workloadItems {
                    for _, volume := range item.Spec.Template.Spec.Volumes {
                        if volume.Secret != nil {
                            for _, volumeSecret := range volume.Secret.Items {
                                if volumeSecret.Key == secret.Name {
                                    fmt.Print("equal")
                                    controllerList = append(controllerList, item)
                                }
                            }
                        }
                    }
                }
            }
        }
    }

}

Is the Nikon AF-S NIKKOR 18-35 mm 1: 3.5-4.5 G ED lens suitable for portrait, landscape and general purposes?

The biggest limitation of your Kit 18-55 lens is that it has a very limited maximum aperture as an affordable consumer lens from Nikon. This affects low-light capabilities, but worse, it affects the extent to which you can separate your subject from the background. Unless you are talking about studio work, where you have an infinitely important background.

Here's what I mean … and you can do it yourself by comparing your 50mm lens with your kit lens.

Here we are at f1.8 wide open

Prime lens with a nice maximum aperture like f1.8

Here's the same shot with the kit lens. Due to the larger maximum aperture, you can see everything, including the kitchen sink! Even worse, the shutter speed is longer and we now also have a camera shake as it needs another light curtain or more.

Kit Lens

This is the problem with kit lenses. Cheap Prime lenses like the 50mm and 35mm f1.8 lenses can be much better than cheap zooms. If you want a zoom that is suitable for portraits, be sure to buy the constant lenses f2.8 (which means the iris can still be f2.8, regardless of the position of the zoom), but that will be expensive, and unfortunately (pet peeve of mine) Nikon did not build your camera to work with fantastic older professional zoom lenses that are dirt cheap. The 18-35 is great, but it's still a variable-aperture lens, and at 35mm it's a f4.5, which is not great for portraits.

Honestly, I would suggest the 35mm f1.8 because you seem to want more full body shots than just head and shoulders. Ideally, it would be good if you have more space in the camera, since the 50 mm with your camera is a very flattering lens. If you use shorter lenses, the facial features are distorted, although this is not so bad at 35mm.

On the street, many people swear by a 35mm lens with a FULL FRAME camera that is equivalent to 23mm. Your kit lens is not too shabby for this purpose, as it is not uncommon to take pictures with a smaller aperture, including when shooting on the street. f5.6 or even f8, because there is often a lot going on in the street and the context is important. At f5.6 and f8, the depth of field is large enough to capture more of the moment, and it's important that focus gets a bit sloppy. In other words, if you do not focus on the subject perfectly, there still remains a chance that it will be fine.

soft question – For which online stock broker is the stock trading in India suitable?

Online stockbroker included Online Share Broker & Mobile Trading with Top Share Broker in India. We offer free Open Demat online account, mutual funds, IPO and algo trading. When you search online stock brokers for your investment needs, you are in the right place and at the right time.

Arihant's goal is to conduct the most comprehensive research on the stock market in India. With our help, our clients can make an imputed decision to select the best stocks that meet their trading needs. We always work as a family and have a personal relationship with our valued customers – an Arihant customer is a customer for life. That makes us different. Our goal is to create wealth for our clients through sound financial advice and appropriate investment strategies. We want to help our clients achieve their financial goals with passion and integrity.

We provide investment solutions based on quality and unbiased research. In addition, we offer personalized services to all investors, institutions and business partners. with success through customer growth. our goal is to make financial services more affordable, understandable and accessible to all Online Share Broker

Source URL: https://arihantcapital.com/

database – Is the JSON type of mariaDB suitable for storing primary keys?

I am developing a database for a local travel agency and have come to a standstill:

I need to take all the passengers and store them in a "travel" entity so that the latter's "Passenger" field is a JSON type, which is an array of passengers' foreign keys.

Example:

-- Retorna um array de ids de passageiros da Ășltima viagem criada.
SELECT passageiros FROM viagens 
ORDER BY created_at DESC
LIMIT 1;

-- retorno
+---------------+
| passageiros   |
+---------------+
| (1,2,3,4,5,6) |
+---------------+

The question is, do you think it's a good deal like this? Finally, if you need to add the ID on the trip, simply use the JSON_MERGE_PRESERVE () function of mariadb, which retains the other IDs, and add the next ID at the bottom of the list. And when I had to search for the passengers on the trip, all I had to do was create an algorithm that searched for the IDs contained in that array.

What's going on Is it good?

I thank you in advance.

Hosting that is suitable for WordPress

Quote Quote by bintarahost
Show contribution

I have checked in, there is no choice but 7.1. So what should I do?

Unfortunately this depends on the host. PHP 7.3 is available to hosts to make it available to their customers, but it's not as easy as I said.

If you are staying at the current host or switching to a new host, ask them if 7.3 is available and use it to switch to the server. The current account may be on a server that was newer than 7.1 came out a few years ago. Because it's not always safe to upgrade to an active server with customers, it's best to move customers to a newer server with a newer operating system or newer options, shut down the older server, or update it for new customers. In either case, ask the host if new accounts have the 7.3 option.

Do the Dems currently have a suitable candidate to challenge Pres Trump next year?

It is not a BOOMING economy. It is 3% GDP growth. This is an "average" economy. Literally. The average growth rate of the USA since the Second World War was 3%. 3% are better than under Obama. I agree with that. But let's face it.

I think the economy will tell the story. If the economy falls into recession within two years of an election in which an incumbent president participates, it almost always loses. When the economy is strong, when an incumbent stands for re-election, that incumbent almost always wins.

Ultimately, Trump is the biggest threat to his re-election. His trade war damages the economy. Does it hurt enough to send it into recession?

Website Design – A suitable UX for distinguishing data from two different tables

I need to create a web application to merge reports. Users can upload 2 identical budget reports. These users come from two different departments where each department may have updated the data (for example, description), or they may have a slightly different description for the same activity ID.

This web application is expected to recognize the differences and select the data from which to generate a report to create a final integrated document. I plan to store data from both reports in database tables (each with its own table) before they appear in the UI. Data Example:

Enter image description here

I am looking for a UX / UI solution / idea to display data differences, and
An option that allows the user to select data from which report
Possibility for the user to change the value.

What I think is to have 1 big html table like the screenshot below, with inline editing, data picking and row / column highlighting if there is a difference.
Another way to possibly display it with 2 tables side by side? Do you have suggestions or better solutions?

Enter image description here

Tech stacks we will use are: Spring Boot, Thymeleaf + JS + jQuery, Bootstrap, Hibernate, JaVers for Diffing

Please advice ..

Greetings,
Hendry